Portions created by the Initial Developer are Copyright (C) 2008-2012 the Initial Developer. All Rights Reserved. Contributor(s): Mark J Crane */ include "root.php"; require_once "includes/require.php"; require_once "includes/checkauth.php"; if (permission_exists('modules_view')) { //access granted } else { echo "access denied"; exit; } require_once "includes/header.php"; require_once "includes/paging.php"; $order_by = $_GET["order_by"]; $order = $_GET["order"]; $fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']); if (strlen($_GET["a"]) > 0) { if ($_GET["a"] == "stop") { $module_name = $_GET["m"]; if ($fp) { $cmd = "api unload $module_name"; $response = trim(event_socket_request($fp, $cmd)); $msg = 'Unload Module:
'.$response.'
'; } } if ($_GET["a"] == "start") { $module_name = $_GET["m"]; if ($fp) { $cmd = "api load $module_name"; $response = trim(event_socket_request($fp, $cmd)); $msg = 'Load Module:
'.$response.'
'; } } } //use the module class to get the list of modules from the db and add any missing modules require_once "includes/classes/switch_modules.php"; $mod = new switch_modules; $mod->db = $db; $mod->dir = $_SESSION['switch']['mod']['dir']; $mod->get_modules(); $result = $mod->modules; $module_count = count($result); $mod->synch(); $msg = $mod->msg; //show the msg if ($msg) { save_module_xml(); echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Message
$msg
\n"; echo "
\n"; } //show the content echo "
"; echo "\n"; echo "\n"; echo " "; echo ""; echo "
\n"; echo "
"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Module List 
\n"; echo "Modules extend the features of the system. Use this page to enable or disable modules. "; echo "
\n"; $c = 0; $row_style["0"] = "row_style0"; $row_style["1"] = "row_style1"; echo "
\n"; echo "\n"; $tmp_module_header = "\n"; $tmp_module_header .= "\n"; //$tmp_module_header .= "\n"; $tmp_module_header .= "\n"; //$tmp_module_header .= "\n"; $tmp_module_header .= "\n"; $tmp_module_header .= "\n"; $tmp_module_header .= "\n"; $tmp_module_header .= "\n"; //$tmp_module_header .= "\n"; $tmp_module_header .= "\n"; $tmp_module_header .= "\n"; if ($module_count > 0) { $prev_module_category = ''; foreach($result as $row) { if ($prev_module_category != $row["module_category"]) { $c=0; if (strlen($prev_module_category) > 0) { echo "\n"; echo "\n"; echo "\n"; } echo "\n"; echo $tmp_module_header; } echo "\n"; //echo " \n"; echo " \n"; //echo " \n"; echo " \n"; if ($mod->active($row["module_name"])) { echo " \n"; echo " \n"; } else { if ($row['module_enabled']=="true") { echo " \n"; } else { echo " \n"; } echo " \n"; } echo " \n"; //echo " \n"; echo " \n"; echo "\n"; $prev_module_category = $row["module_category"]; if ($c==0) { $c=1; } else { $c=0; } } //end foreach unset($sql, $modules, $row_count); } //end if results echo "\n"; echo "\n"; echo "\n"; echo "
Module CategoryLabelModule NameDescriptionStatusActionEnabledDefault Enabled\n"; $tmp_module_header .= " $v_link_label_add\n"; $tmp_module_header .= "
\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
  \n"; if (permission_exists('modules_add')) { echo " $v_link_label_add\n"; } echo "
\n"; echo "
\n"; echo "
\n"; echo "
\n"; echo " ".$row["module_category"]." 
".$row["module_category"]."".$row["module_label"]."".$row["module_name"]."".$row["module_description"]." RunningStopStoppedStopped $noticeStart".$row["module_enabled"]."".$row["module_default_enabled"]."\n"; if (permission_exists('modules_edit')) { echo " $v_link_label_edit\n"; } if (permission_exists('modules_delete')) { echo " $v_link_label_delete\n"; } echo "
\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
 $paging_controls\n"; if (permission_exists('modules_add')) { echo " $v_link_label_add\n"; } echo "
\n"; echo "
"; echo "
"; echo "

"; echo "

"; echo "
"; echo "
"; echo "

"; //show the footer require_once "includes/footer.php"; ?>