|
0) { $id = $_POST['id']; } $type = $_GET['t']; if (strlen($_POST['t'])>0) { $type = $_POST['t']; } if ($_GET['act'] == "del") { if ($_GET['type'] == 'cmd') { switch (htmlspecialchars($type)) { case "earlyshellcmd": $a_earlyshellcmd = &$config['system']['earlyshellcmd']; unset($a_earlyshellcmd[$_GET['id']]); write_config(); php_sync_package(); header("Location: shellcmd.php"); exit; break; case "shellcmd": $a_shellcmd = &$config['system']['shellcmd']; unset($a_shellcmd[$_GET['id']]); write_config(); php_sync_package(); header("Location: shellcmd.php"); exit; break; case "afterfilterchangeshellcmd": // $a_afterfilterchangeshellcmd = &$config['system']['afterfilterchangeshellcmd']; // unset($a_afterfilterchangeshellcmd[$_GET['id']]); // write_config(); // php_sync_package(); // header("Location: shellcmd.php"); // exit; break; default: break; } } } //get value for the form edit value if (strlen($id) > 0) { switch (htmlspecialchars($type)) { case "earlyshellcmd": $a_earlyshellcmd = &$config['system']['earlyshellcmd']; if ($a_earlyshellcmd[$id]) { $pconfig['command'] = $a_earlyshellcmd[$id]['command']; } break; case "shellcmd": $a_shellcmd = &$config['system']['shellcmd']; if ($a_shellcmd[$id]) { $pconfig['command'] = $a_shellcmd[$id]['command']; } break; case "afterfilterchangeshellcmd": //$a_afterfilterchangeshellcmd = &$config['system']['afterfilterchangeshellcmd']; //if ($a_afterfilterchangeshellcmd[$id]) { // $pconfig['command'] = $a_afterfilterchangeshellcmd[$id]['command']; //} break; default: break; } } if ($_POST) { unset($input_errors); if (!$input_errors) { if (strlen($_POST['command']) > 0) { $ent = array(); $ent['command'] = $_POST['command']; if (strlen($id)>0) { //update switch (htmlspecialchars($type)) { case "earlyshellcmd": $a_earlyshellcmd = &$config['system']['earlyshellcmd']; if ($a_earlyshellcmd[$id]) { $a_earlyshellcmd[$id] = $ent; } break; case "shellcmd": $a_shellcmd = &$config['system']['shellcmd']; if ($a_shellcmd[$id]) { $a_shellcmd[$id] = $ent; } break; case "afterfilterchangeshellcmd": //$a_afterfilterchangeshellcmd = &$config['system']['afterfilterchangeshellcmd']; //if ($a_afterfilterchangeshellcmd[$id]) { // $a_afterfilterchangeshellcmd[$id] = $ent; //} break; default: break; } } else { //add switch (htmlspecialchars($type)) { case "earlyshellcmd": $a_earlyshellcmd = &$config['system']['earlyshellcmd']; $a_earlyshellcmd[] = $ent; break; case "shellcmd": $a_shellcmd = &$config['system']['shellcmd']; $a_shellcmd[] = $ent; break; case "afterfilterchangeshellcmd": //$a_afterfilterchangeshellcmd = &$config['system']['afterfilterchangeshellcmd']; //$a_afterfilterchangeshellcmd[] = $ent; break; default: break; } } write_config(); php_sync_package(); } header("Location: shellcmd.php"); exit; } } include("head.inc"); ?>
Shellcmd: Edit
|