コード例 #1
0
ファイル: monitor.php プロジェクト: jfanctil/lamoria
    }
    return TRUE;
}
?>

<HTML>
<HEAD>
<TITLE>Session Monitoring and Maintenance Page</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0033CC" VLINK="#990099"
ALINK="#FF0000" TOPMARGIN=0 LEFTMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>

<CENTER><H2>Session Table Data</H2></CENTER>

<?php 
$submitted = isset($_REQUEST['Submit']) ? TRUE : FALSE;
$offset = (int) isset($_REQUEST['start']) ? intval(strip_tags($_REQUEST['start'])) : 0;
$max_rows = (int) isset($_REQUEST['limit']) ? intval(strip_tags($_REQUEST['limit'])) : 15;
$max_rows = 0 == $max_rows ? 15 : $max_rows;
$order_by = isset($_REQUEST['sort']) ? strip_tags($_REQUEST['sort']) : $sess->getExpiryName();
$asc_desc = (int) isset($_REQUEST['order']) ? intval(strip_tags($_REQUEST['order'])) : 0;
if ($submitted) {
    process_requests();
}
$sort_order = 1 == $asc_desc ? TRUE : FALSE;
$data = $sess->getAllSessInfo($offset, $max_rows, $order_by, $sort_order, $sess_param['confirm_pswd']);
display($data);
?>

</BODY>
</HTML>
コード例 #2
0
ファイル: sched.php プロジェクト: jhbsz/ossimTest
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 "&nbsp;&nbsp;&nbsp;<input type=submit name=submit value='Approve Requests'>";
    echo "</form>";
}