function auth_request($op, $submit, $rids) { global $dbconn; echo "<h2>Pending Scan Requests</h2>"; //echo "<pre>$op = "; print_r($rids); echo "</pre>"; if ($op != "" and !empty($rids)) { switch ($op) { case "process": process_requests($submit, $rids); break; case "accept": accept_request($rid); break; case "reject": reject_request($rid); break; default: break; } echo "<br>"; } $query = "SELECT id, username, meth_VSET, meth_TARGET, scan_SUBMIT,\n date_format(scan_NEXT,'%m/%d/%Y %T')\n FROM vuln_jobs \n\t WHERE job_TYPE= 'R' AND authorized='0'\n ORDER BY scan_NEXT"; $result = $dbconn->execute($query); echo <<<EOT <form method="post" action="sched.php"> <input type=hidden name="op" value="process"> <input type=hidden name="disp" value="auth_request"> <table summary="Request Details" width=100%> <tr> <th>Requested Scan Date</th> <th>Request Submit Date</th> <th>Requester</th> <th>Host IP(s)</th> \t <th></th> \t </tr> EOT; while (!$result->EOF) { list($rid, $rname, $rsid, $rhostip, $submit, $scantime) = $result->fields; $rhostip = trim($rhostip); // get rid of any extra whitespace at the end echo "<tr>"; echo "<td>{$scantime}</td>"; echo "<td>{$submit}</td>"; //$requestor = getUserName($rname); //echo "<td>$rname"; //if($requestor{'fname'} != "") { echo " - " . $requestor{'fname'};} //if($requestor{'lname'} != "") { echo " " . $requestor{'lname'}; } //echo "</td>"; //echo "<td>" . getProfileName( $rsid ) . "</td>"; $ips = explode("\n", $rhostip); //echo "<pre>"; //print_r($ips); //echo "</pre>"; $hosttext = array(); foreach ($ips as $ip) { $hosttext[] = gethostbyaddr("{$ip}") . " ({$ip})"; } echo "<td>" . implode("<br>", $hosttext) . "</td>"; echo "<td><input type=checkbox name='process[]' value='{$rid}'></td>"; $result->MoveNext(); } echo "</table>"; echo "<input type=submit name=submit value='Reject Requests'>"; echo " <input type=submit name=submit value='Approve Requests'>"; echo "</form>"; }
<?php include "config/config.php"; include "admin/include/function.php"; include "include/common-scripts.php"; include "include/logincheck.php"; if (isset($_GET["accept"])) { accept_request($_GET["accept"]); header("location:connections.php#connection"); } html("START"); ?> <!-- BEGIN HEAD --> <head> <?php common_head("META"); put_seo(array("title" => get_the_option("website_title") . " | Connections", "desc" => "", "author" => "", "keywords" => "", "image" => "")); common_style("MANDATORY_STYLES"); page_style("CONNECTIONS"); common_style("THEME_STYLES"); common_head("FAVICON"); ?> <body class="page-header-fixed page-sidebar-closed-hide-logo page-sidebar-fixed page-sidebar-closed-hide-logo page-sidebar-closed"> <!-- BEGIN HEADER --> <div class="page-header navbar navbar-fixed-top"> <!-- BEGIN HEADER INNER --> <?php include "include/header.php"; ?>
<?php if (isset($_GET['cmr'])) { $message = cancel_my_request($_GET['cmr']); echo '<div style="border:1px solid #000; padding: 5px; background-color:orange">' . $message . '</div>'; } if (isset($_GET['ar'])) { $message = accept_request($_GET['ar']); echo '<div style="border:1px solid #000; padding: 5px; background-color:orange">' . $message . '</div>'; } if (isset($_GET['dr'])) { $message = decline_request($_GET['dr']); echo '<div style="border:1px solid #000; padding: 5px; background-color:orange">' . $message . '</div>'; } ?> <div class="container"> <div class="row"> <section class="content"> <h2>My requests</h2> <div class="col-md-8 col-md-offset-2"> <div class="panel panel-default"> <div class="panel-body"> <div class="table-container"> <table class="table table-filter"> <tbody> <?php $requests = show_my_requests(); if (!empty($requests)) { foreach ($requests as $key => $value) { global $connection;