break; } // Assigning PHP 5 to a template variable so that I can prevent displaying // the cancel scan if the user is not running php 5 $tpl->assign(array('scans' => $scans, 'type' => $type)); $tpl->display('admin_scans_list.tpl'); break; case "x_count_scans": require_once _ABSPATH . '/lib/Scans.php'; $_scn = new Scans(); $not_running = 0; $pending = 0; $running = 0; $finished = 0; $all = 0; $not_running = $_scn->count_not_running_scans(); $pending = $_scn->count_pending_scans(); $running = $_scn->count_running_scans(); $finished = $_scn->count_finished_scans(); $all = $not_running + $pending + $running + $finished; echo "pass::{$not_running};{$pending};{$running};{$finished};{$all};admin"; break; case "show_scans_view": $type = import_var('type', 'P'); $tpl->assign('type', $type); $tpl->display('admin_scans_viewer.tpl'); break; case "show_scans_list": require_once _ABSPATH . '/lib/User.php'; $type = import_var('type', 'P'); $refine_scan = import_var('refine_scan', 'P');
return; } $stmt1->execute($time, $profile_id); $stmt2->execute($profile_id); echo "pass"; break; case "x_count_scans": require_once _ABSPATH . '/lib/Scans.php'; $_scn = new Scans(); $username = import_var('username', 'S'); $not_running = 0; $pending = 0; $running = 0; $finished = 0; $all = 0; $not_running = $_scn->count_not_running_scans($username); $pending = $_scn->count_pending_scans($username); $running = $_scn->count_running_scans($username); $finished = $_scn->count_finished_scans($username); $all = $not_running + $pending + $running + $finished; echo "pass::{$not_running};{$pending};{$running};{$finished};{$all}"; break; case "x_show_scan_history": $username = import_var('username', 'S'); $results = array(); $sql = array('scans' => "\tSELECT pl.profile_id,us.setting_name \n\t\t\t\t\tFROM profile_list AS pl\n\t\t\t\t\tLEFT JOIN profile_settings AS us\n\t\t\t\t\tON pl.profile_id=us.profile_id \n\t\t\t\t\tWHERE pl.username='******';", 'results' => "\tSELECT results_id \n\t\t\t\t\tFROM saved_scan_results \n\t\t\t\t\tWHERE profile_id=':1'"); $stmt1 = $db->prepare($sql['scans']); $stmt2 = $db->prepare($sql['results']); $stmt1->execute($username); while ($row = $stmt1->fetch_assoc()) { $stmt2->execute($row['profile_id']);