当前位置: 首页>>代码示例>>PHP>>正文


PHP ImportHTTPVar函数代码示例

本文整理汇总了PHP中ImportHTTPVar函数的典型用法代码示例。如果您正苦于以下问题:PHP ImportHTTPVar函数的具体用法?PHP ImportHTTPVar怎么用?PHP ImportHTTPVar使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ImportHTTPVar函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: PrintCleanURL

function PrintCleanURL()
{
    // This function creates the url to display the cleaned up payload -- Kevin
    $query = CleanVariable($_SERVER["QUERY_STRING"], VAR_PERIOD | VAR_DIGIT | VAR_PUNC | VAR_LETTER);
    $sort_order = ImportHTTPVar("sort_order", VAR_LETTER | VAR_USCORE);
    if (isset($_GET['asciiclean']) && $_GET['asciiclean'] == 1 || isset($_COOKIE['asciiclean']) && $_COOKIE['asciiclean'] == "clean" && !isset($_GET['asciiclean'])) {
        //create link to non-cleaned payload display
        $url = '<a href="base_qry_alert.php?' . $query;
        $url .= '&amp;sort_order=' . urlencode($sort_order) . '&amp;asciiclean=0&amp;minimal_view=' . $_GET['minimal_view'] . '">' . _("Normal Display") . '</a>';
        return $url;
    } else {
        //create link to cleaned payload display
        $url = '<a href="base_qry_alert.php?' . $query;
        $url .= '&amp;sort_order=' . urlencode($sort_order) . '&amp;asciiclean=1&amp;minimal_view=' . $_GET['minimal_view'] . '">' . _("Plain Display") . '</a>';
        return $url;
    }
}
开发者ID:alienfault,项目名称:ossim,代码行数:17,代码来源:base_qry_alert.php

示例2: BaseUser

</head>
<body>
<?php 
include "../hmenu.php";
?>
<div style="border:1px solid #AAAAAA;line-height:24px;width:100%;text-align:center;background:url('../pixmaps/fondo_col.gif') 50% 50% repeat-x;color:#222222;font-size:12px;font-weight:bold">&nbsp;Shellcode Analysis </div>
<?php 
// Check role out and redirect if needed -- Kevin
$roleneeded = 10000;
$BUser = new BaseUser();
if ($BUser->hasRole($roleneeded) == 0 && $Use_Auth_System == 1) {
    base_header("Location: " . $BASE_urlpath . "/index.php");
    exit;
}
$cid = ImportHTTPVar("cid", VAR_DIGIT);
$sid = ImportHTTPVar("sid", VAR_DIGIT);
//print $cid."<br>";
//print $sid."<br>";
$db = NewBASEDBConnection($DBlib_path, $DBtype);
$db->baseDBConnect($db_connect_method, $alert_dbname, $alert_host, $alert_port, $alert_user, $alert_password);
/* Get the Payload from the database: */
$sql2 = "SELECT data_payload FROM extra_data WHERE sid='" . $sid . "' AND cid='" . $cid . "'";
$result2 = $db->baseExecute($sql2);
$myrow2 = $result2->baseFetchRow();
$result2->baseFreeRows();
/* get encoding information for payload */
/* 0 == hex, 1 == base64, 2 == ascii;   */
$sql3 = 'SELECT encoding FROM sensor WHERE sid=' . $sid;
$result3 = $db->baseExecute($sql3);
$myrow3 = $result3->baseFetchRow();
$result3->baseFreeRows();
开发者ID:jhbsz,项目名称:ossimTest,代码行数:31,代码来源:shellcode.php

示例3: Geolocation

include_once "{$BASE_path}/base_stat_common.php";
include_once "{$BASE_path}/base_qry_common.php";
include_once "{$BASE_path}/base_ag_common.php";
include_once "geoip.inc";
$_SESSION["siem_default_group"] = "base_stat_sensor.php?sort_order=occur_d";
$geoloc = new Geolocation("/usr/share/geoip/GeoLiteCity.dat");
$et = new EventTiming($debug_time_mode);
$cs = new CriteriaState("base_stat_sensor.php");
$cs->ReadState();
$qs = new QueryState();
// Check role out and redirect if needed -- Kevin
$roleneeded = 10000;
#$BUser = new BaseUser();
#if (($BUser->hasRole($roleneeded) == 0) && ($Use_Auth_System == 1)) base_header("Location: " . $BASE_urlpath . "/index.php");
$submit = ImportHTTPVar("submit", VAR_ALPHA | VAR_SPACE, array(gettext("Delete Selected"), gettext("Delete ALL on Screen"), _ENTIREQUERY));
$export = intval(ImportHTTPVar("complete", VAR_DIGIT));
// Called from report_launcher.php
$qs->MoveView($submit);
/* increment the view if necessary */
$page_title = gettext("Sensor Listing");
/* Connect to the Alert database */
$db = NewBASEDBConnection($DBlib_path, $DBtype);
$db->baseDBConnect($db_connect_method, $alert_dbname, $alert_host, $alert_port, $alert_user, $alert_password, 0, 1);
if ($event_cache_auto_update == 1) {
    UpdateAlertCache($db);
}
$criteria_clauses = ProcessCriteria();
// Include base_header.php
PrintBASESubHeader($page_title, $page_title, $cs->GetBackLink(), 1);
$mssp = Session::show_entities();
//intval($conf->get_conf("alienvault_mssp", FALSE));
开发者ID:alienfault,项目名称:ossim,代码行数:31,代码来源:base_stat_sensor.php

示例4: EventTiming

*/
require "base_conf.php";
require "vars_session.php";
require "{$BASE_path}/includes/base_constants.inc.php";
require "{$BASE_path}/includes/base_include.inc.php";
include_once "{$BASE_path}/base_db_common.php";
include_once "{$BASE_path}/base_qry_common.php";
include_once "{$BASE_path}/base_stat_common.php";
$_SESSION["siem_default_group"] = "base_stat_alerts.php?sort_order=occur_d";
if ($_REQUEST['sort_order'] == '') {
    $_GET['sort_order'] = 'occur_d';
}
$debug_time_mode >= 1 ? $et = new EventTiming($debug_time_mode) : '';
$cs = new CriteriaState("base_stat_alerts.php");
$submit = ImportHTTPVar("submit", VAR_ALPHA | VAR_SPACE, array(gettext("Delete Selected"), gettext("Delete ALL on Screen"), _ENTIREQUERY));
$export = intval(ImportHTTPVar("export", VAR_DIGIT));
// Called from report_launcher.php
$cs->ReadState();
// Check role out and redirect if needed -- Kevin
$roleneeded = 10000;
#$BUser = new BaseUser();
#if (($BUser->hasRole($roleneeded) == 0) && ($Use_Auth_System == 1)) base_header("Location: " . $BASE_urlpath . "/index.php");
$qs = new QueryState();
$qs->AddCannedQuery("most_frequent", $freq_num_alerts, gettext("Most Frequent Events"), "occur_d");
$qs->AddCannedQuery("last_alerts", $last_num_ualerts, gettext("Last Events"), "last_d");
$qs->MoveView($submit);
/* increment the view if necessary */
$page_title = gettext("Event Listing");
/* Connect to the Alert database */
$db = NewBASEDBConnection($DBlib_path, $DBtype);
$db->baseDBConnect($db_connect_method, $alert_dbname, $alert_host, $alert_port, $alert_user, $alert_password, 0, 1);
开发者ID:jackpf,项目名称:ossim-arc,代码行数:31,代码来源:base_stat_alerts.php

示例5: GET

*/
require 'base_conf.php';
require 'vars_session.php';
require_once 'classes/Util.inc';
require "{$BASE_path}/includes/base_constants.inc.php";
require "{$BASE_path}/includes/base_include.inc.php";
include_once "{$BASE_path}/base_db_common.php";
include_once "{$BASE_path}/base_qry_common.php";
include_once "{$BASE_path}/base_stat_common.php";
require_once 'classes/geolocation.inc';
if (GET('fqdn') == 'yes' || GET('fqdn') == 'no') {
    $_SESSION['siem_default_group'] = "base_stat_iplink.php?sort_order=events_d&fqdn=" . GET('fqdn');
}
$geoloc = new Geolocation('/usr/share/geoip/GeoLiteCity.dat');
$submit = ImportHTTPVar("submit", VAR_ALPHA | VAR_SPACE, array(gettext("Delete Selected"), gettext("Delete ALL on Screen"), _ENTIREQUERY));
$fqdn = ImportHTTPVar("fqdn", VAR_ALPHA | VAR_SPACE);
$et = new EventTiming($debug_time_mode);
$cs = new CriteriaState("base_stat_iplink.php");
$cs->ReadState();
// Check role out and redirect if needed -- Kevin
$roleneeded = 10000;
#$BUser = new BaseUser();
#if (($BUser->hasRole($roleneeded) == 0) && ($Use_Auth_System == 1)) base_header("Location: " . $BASE_urlpath . "/index.php");
$qs = new QueryState();
$qs->AddCannedQuery("most_frequent", $freq_num_alerts, gettext("Most Frequent Events"), "occur_d");
$qs->AddCannedQuery("last_alerts", $last_num_ualerts, gettext("Last Events"), "last_d");
$qs->MoveView($submit);
/* increment the view if necessary */
$page_title = gettext("IP Links");
/* Connect to the Alert database */
$db = NewBASEDBConnection($DBlib_path, $DBtype);
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:31,代码来源:base_stat_iplink.php

示例6: Action_del_alert_post

function Action_del_alert_post($action_arg, &$action_ctx, $db, &$num_alert, $action_cnt, $context, $deltmp)
{
    $sel_cnt = 0;
    $action_lst_cnt = count(ImportHTTPVar("action_lst"));
    $action_chk_lst = ImportHTTPVar("action_chk_lst");
    /* count the number of check boxes selected  */
    for ($i = 0; $i < $action_lst_cnt; $i++) {
        if (isset($action_chk_lst[$i])) {
            $sel_cnt++;
        }
    }
    if ($sel_cnt > 0) {
        /* 1 or more check boxes selected ? */
        $num_alert -= $sel_cnt;
    } elseif ($context == 1) {
        /* detail alert list ? */
        $num_alert -= $action_cnt;
    } else {
        $num_alert -= count(ImportHTTPVar("action_chk_lst"));
    }
    if ($deltmp != "") {
        // launch delete in background
        $rnd = explode("_", $deltmp);
        $_SESSION["deletetask"] = $rnd[1];
        //error_log("launch $deltmp\n",3,"/var/tmp/dellog");
        shell_exec("nohup cat {$deltmp} | /usr/bin/ossim-db snort > /var/tmp/latest_siem_events_purge.sql.log 2>&1 &");
        echo "<script>bgtask();</script>\n";
    }
}
开发者ID:jhbsz,项目名称:ossimTest,代码行数:29,代码来源:base_action.inc.php

示例7: die

    die("If you wish to re-run the setup routine, please either move OR delete your previous base_conf file first.");
}
$errorMsg = '';
if (@$_GET['action'] == "check") {
    // form was submitted do the checks!
    $dbtype = ImportHTTPVar("dbtype", VAR_ALPHA);
    $dbport = ImportHTTPVar("dbport", VAR_DIGIT);
    $dbhost = ImportHTTPVar("dbhost", VAR_ALPHA | VAR_PERIOD | VAR_SCORE);
    $dbusername = ImportHTTPVar("dbusername");
    $dbpasswd = ImportHTTPVar("dbpasswd");
    $dbname = ImportHTTPVar("dbname", VAR_ALPHA | VAR_SCORE | VAR_USCORE);
    $arcdbport = ImportHTTPVar("arcdbport", VAR_DIGIT);
    $arcdbhost = ImportHTTPVar("arcdbhost", VAR_ALPHA | VAR_PERIOD | VAR_SCORE);
    $arcdbusername = ImportHTTPVar("arcdbusername");
    $arcdbpasswd = ImportHTTPVar("arcdbpasswd");
    $arcdbname = ImportHTTPVar("arcdbname", VAR_ALPHA | VAR_SCORE | VAR_USCORE);
    $db = NewADOConnection($dbtype);
    $dbconnect = $db->Connect($dbport == "" ? $dbhost : $dbhost . ":" . $dbport, $dbusername, $dbpasswd, $dbname);
    if (!$dbconnect) {
        $errorMsg = $errorMsg . "Database connection failed!<br>Please try again!";
        $error = 1;
    }
    $_SESSION['dbtype'] = $dbtype;
    $_SESSION['dbhost'] = $dbhost;
    $_SESSION['dbport'] = $dbport;
    $_SESSION['dbname'] = $dbname;
    $_SESSION['dbusername'] = $dbusername;
    $_SESSION['dbpasswd'] = $dbpasswd;
    $_SESSION['usearchive'] = 0;
    if (@$_POST['usearchive'] == "on") {
        $_SESSION['usearchive'] = 1;
开发者ID:jhbsz,项目名称:ossimTest,代码行数:31,代码来源:setup2.php

示例8: geoip_open

include_once "{$BASE_path}/base_db_common.php";
include_once "{$BASE_path}/base_qry_common.php";
include_once "{$BASE_path}/base_stat_common.php";
Session::logcheck("MenuEvents", "EventsForensics");
include "geoip.inc";
require_once 'classes/Util.inc';
$gi = geoip_open("/usr/share/geoip/GeoIP.dat", GEOIP_STANDARD);
$hosts_ips = array_keys($hosts);
$debug_time_mode >= 1 ? $et = new EventTiming($debug_time_mode) : '';
$cs = new CriteriaState("base_timeline.php");
$submit = ImportHTTPVar("submit", VAR_ALPHA | VAR_SPACE, array(gettext("Delete Selected"), gettext("Delete ALL on Screen"), _ENTIREQUERY));
$max = ImportHTTPVar("max", VAR_DIGIT);
if (!$max) {
    $max = 50;
}
$resolution = ImportHTTPVar("resolution", VAR_ALPHA);
if ($resolution == "") {
    $resolution = "m";
}
//
$cs->ReadState();
// Check role out and redirect if needed -- Kevin
$roleneeded = 10000;
$BUser = new BaseUser();
if ($BUser->hasRole($roleneeded) == 0 && $Use_Auth_System == 1) {
    base_header("Location: " . $BASE_urlpath . "/index.php");
}
$qs = new QueryState();
$qs->AddCannedQuery("most_frequent", $freq_num_alerts, gettext("Most Frequent Events"), "occur_d");
$qs->AddCannedQuery("last_alerts", $last_num_ualerts, gettext("Last Events"), "last_d");
$qs->MoveView($submit);
开发者ID:jhbsz,项目名称:ossimTest,代码行数:31,代码来源:base_timeline.php

示例9: Import

 function Import()
 {
     parent::Import();
     include dirname(__FILE__) . '/../base_conf.php';
     $vals = NULL;
     /* expand IP into octets */
     $this->criteria = $_SESSION['ip_addr'];
     $this->criteria_cnt = $_SESSION['ip_addr_cnt'];
     for ($i = 0; $i < $this->criteria_cnt; $i++) {
         if (isset($this->criteria[$i][3]) && preg_match("/([0-9]*)\\.([0-9]*)\\.([0-9]*)\\.([0-9]*)/", $this->criteria[$i][3])) {
             $tmp_ip_str = $this->criteria[$i][7] = $this->criteria[$i][3];
             $this->criteria[$i][3] = strtok($tmp_ip_str, ".");
             $this->criteria[$i][4] = strtok(".");
             $this->criteria[$i][5] = strtok(".");
             $this->criteria[$i][6] = strtok("/");
             $this->criteria[$i][10] = strtok("");
         }
         $vals[] = $this->criteria[$i];
     }
     //print_r ($this->criteria);
     $this->criteria = $vals;
     $this->criteria_cnt = count($vals);
     $new = ImportHTTPVar("new", VAR_DIGIT);
     $submit = ImportHTTPVar("submit", VAR_ALPHA | VAR_SPACE);
     if ($new == 1 && $submit == "") {
         // This is commented.
         // When you return to the search form, you must preserve all criteria. Lately only was reseting the _cnt vars
         // Now doesn't reset anything
         //$this->criteria = NULL;
         //$this->criteria_cnt = 1;
     }
     if ($this->criteria_cnt == "") {
         $this->criteria_cnt = 1;
     }
     //print_r ($this->criteria);
     $_SESSION['ip_addr'] =& $this->criteria;
     $_SESSION['ip_addr_cnt'] =& $this->criteria_cnt;
 }
开发者ID:jackpf,项目名称:ossim-arc,代码行数:38,代码来源:base_state_citems.inc.php

示例10: ImportHTTPVar

** Built upon work by the BASE Project Team <kjohnson@secureideas.net>
*/
require "base_conf.php";
require "vars_session.php";
require_once 'classes/Util.inc';
require "{$BASE_path}/includes/base_constants.inc.php";
require "{$BASE_path}/includes/base_include.inc.php";
include_once "{$BASE_path}/base_db_common.php";
include_once "{$BASE_path}/base_qry_common.php";
include_once "{$BASE_path}/base_stat_common.php";
if ($_SESSION['_siem_plugins_query'] == "") {
    echo "-##-";
    die;
}
$plugin_id = ImportHTTPVar("plugin", VAR_DIGIT | VAR_USCORE);
$device_id = ImportHTTPVar("id", VAR_HEX);
$sql = str_replace("DID", $device_id, $_SESSION['_siem_plugins_query']);
if (preg_match("/\\d+_\\d+/", $plugin_id)) {
    $sc = explode("_", $plugin_id);
    $sql = str_replace("PLUGIN_ID", $sc[0], str_replace("SUBCAT", $sc[1], $sql));
} else {
    $sql = str_replace("PLUGIN_ID", $plugin_id, $sql);
}
session_write_close();
$tz = Util::get_timezone();
$qs = new QueryState();
$db = NewBASEDBConnection($DBlib_path, $DBtype);
$db->baseDBConnect($db_connect_method, $alert_dbname, $alert_host, $alert_port, $alert_user, $alert_password);
$name = $timestamp = '-';
$rs = $qs->ExecuteOutputQueryNoCanned($sql, $db);
if ($row = $rs->baseFetchRow()) {
开发者ID:jackpf,项目名称:ossim-arc,代码行数:31,代码来源:base_stat_plugin_data.php

示例11: ImportHTTPVar

** (see the file 'base_main.php' for license details)
**
** Built upon work by Roman Danyliw <rdd@cert.org>, <roman@danyliw.com>
** Built upon work by the BASE Project Team <kjohnson@secureideas.net>
*/
require "base_conf.php";
require "vars_session.php";
require_once 'classes/Util.inc';
require "{$BASE_path}/includes/base_constants.inc.php";
require "{$BASE_path}/includes/base_include.inc.php";
include_once "{$BASE_path}/base_db_common.php";
include_once "{$BASE_path}/base_qry_common.php";
include_once "{$BASE_path}/base_stat_common.php";
if ($_SESSION['_siem_port_query'] == "") {
    echo "-##-";
    die;
}
$device_id = ImportHTTPVar("id", VAR_HEX);
$ip_port = ImportHTTPVar("port", VAR_DIGIT);
$sql = str_replace("DEVICEID", $device_id, str_replace("IP_PORT", $ip_port, $_SESSION['_siem_port_query']));
session_write_close();
$qs = new QueryState();
$db = NewBASEDBConnection($DBlib_path, $DBtype);
$db->baseDBConnect($db_connect_method, $alert_dbname, $alert_host, $alert_port, $alert_user, $alert_password);
$rs = $qs->ExecuteOutputQueryNoCanned($sql, $db);
if ($row = $rs->baseFetchRow()) {
    $src_addrs = $row[0];
    $dst_addrs = $row[1];
}
$rs->baseFreeRows();
echo "{$src_addrs}##{$dst_addrs}";
开发者ID:jackpf,项目名称:ossim-arc,代码行数:31,代码来源:base_stat_ports_data.php

示例12: NewBASEDBConnection

require "{$BASE_path}/includes/base_constants.inc.php";
require "{$BASE_path}/includes/base_include.inc.php";
include_once "{$BASE_path}/includes/base_action.inc.php";
include_once "{$BASE_path}/base_db_common.php";
include_once "{$BASE_path}/base_common.php";
include_once "{$BASE_path}/base_ag_common.php";
include_once "{$BASE_path}/base_qry_common.php";
require_once 'av_init.php';
Session::logcheck("analysis-menu", "EventsForensics");
/* Connect to the Alert database */
$db = NewBASEDBConnection($DBlib_path, $DBtype);
$db->baseDBConnect($db_connect_method, $alert_dbname, $alert_host, $alert_port, $alert_user, $alert_password);
$cs = new CriteriaState("base_qry_main.php", "&amp;new=1&amp;submit=" . gettext("Query+DB"));
$cs->ReadState();
/* This call can include many values. */
$submit = Util::htmlentities(ImportHTTPVar("submit", VAR_DIGIT | VAR_PUNC | VAR_LETTER, array(gettext("Delete Selected"), gettext("Delete ALL on Screen"), gettext("Delete Entire Query"), gettext("Query DB"), gettext("ADD TIME"), gettext("ADD Addr"), gettext("ADD IP Field"), gettext("ADD TCP Port"), gettext("ADD TCP Field"), gettext("ADD UDP Port"), gettext("ADD UDP Field"), _ADDICMPFIELD)));
if ($submit == "TCP") {
    $cs->criteria['layer4']->Set("TCP");
}
if ($submit == "UDP") {
    $cs->criteria['layer4']->Set("UDP");
}
if ($submit == "ICMP") {
    $cs->criteria['layer4']->Set("ICMP");
}
if ($submit == gettext("no layer4")) {
    $cs->criteria['layer4']->Set("");
}
if ($submit == gettext("ADD TIME") && $cs->criteria['time']->GetFormItemCnt() < $MAX_ROWS) {
    $cs->criteria['time']->AddFormItem($submit, $cs->criteria['layer4']->Get());
}
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:31,代码来源:base_qry_form.php

示例13: NewBASEDBConnection

$db = NewBASEDBConnection($DBlib_path, $DBtype);
/* FIXME: OSSIM */
/* This used to break the port filters, have to look deeply on this
maybe changing db_connect_method in base_conf.php */
$db->baseDBConnect($db_connect_method, $alert_dbname, $alert_host, $alert_port, $alert_user, $alert_password);
$cs = new CriteriaState("base_stat_ports.php");
$cs->ReadState();
// Check role out and redirect if needed -- Kevin
$roleneeded = 10000;
$port_proto = "TCP";
$qs = new QueryState();
$qs->AddCannedQuery("most_frequent", $freq_num_uports, gettext("Most Frequent Ports"), "occur_d");
$qs->AddCannedQuery("last_ports", $last_num_uports, gettext("Last Ports"), "last_d");
$submit = ImportHTTPVar("submit", VAR_ALPHA | VAR_SPACE, array(gettext("Delete Selected"), gettext("Delete ALL on Screen"), _ENTIREQUERY));
$port_type = ImportHTTPVar("port_type", VAR_DIGIT);
$proto = ImportHTTPVar("proto", VAR_DIGIT | VAR_PUNC);
$qs->MoveView($submit);
/* increment the view if necessary */
$page_title = "";
switch ($proto) {
    case TCP:
        $page_title = gettext("Unique") . " TCP ";
        $displaytitle = $port_type == SOURCE_PORT ? gettext("Displaying source tcp ports %d-%d of <b>%s</b> matching your selection. <b>%s</b> total events in database.") : gettext("Displaying destination tcp ports %d-%d of <b>%s</b> matching your selection. <b>%s</b> total events in database.");
        break;
    case UDP:
        $page_title = gettext("Unique") . " UDP ";
        $displaytitle = $port_type == SOURCE_PORT ? gettext("Displaying source udp ports %d-%d of <b>%s</b> matching your selection. <b>%s</b> total events in database.") : gettext("Displaying destination udp ports %d-%d of <b>%s</b> matching your selection. <b>%s</b> total events in database.");
        break;
    case -1:
        $page_title = gettext("Unique") . " ";
        $displaytitle = $port_type == SOURCE_PORT ? gettext("Displaying source ports %d-%d of <b>%s</b> matching your selection. <b>%s</b> total events in database.") : gettext("Displaying destination ports %d-%d of <b>%s</b> matching your selection. <b>%s</b> total events in database.");
开发者ID:jhbsz,项目名称:ossimTest,代码行数:31,代码来源:base_stat_ports.php

示例14: Import

 function Import()
 {
     parent::Import();
     require dirname(__FILE__) . '/../base_conf.php';
     $vals = NULL;
     $empty = 1;
     /* expand IP into octets */
     $this->criteria = $_SESSION['ip_addr'];
     $this->criteria_cnt = $_SESSION['ip_addr_cnt'];
     for ($i = 0; $i < $this->criteria_cnt; $i++) {
         if (isset($this->criteria[$i][3]) && ereg("([0-9]*)\\.([0-9]*)\\.([0-9]*)\\.([0-9]*)", $this->criteria[$i][3])) {
             if ($use_ossim_session && Session::allowedNets()) {
                 require_once 'classes/Net.inc';
                 $domain = Session::allowedNets();
                 if ($domain != "") {
                     $tmp_myip = $this->criteria[$i][3];
                     $myip = strtok($tmp_myip, "/");
                     if (Net::isIpInNet($myip, $domain)) {
                         $tmp_ip_str = $this->criteria[$i][7] = $this->criteria[$i][3];
                         $this->criteria[$i][2] = "=";
                         $this->criteria[$i][3] = strtok($tmp_ip_str, ".");
                         $this->criteria[$i][4] = strtok(".");
                         $this->criteria[$i][5] = strtok(".");
                         $this->criteria[$i][6] = strtok("/");
                         $this->criteria[$i][10] = strtok("");
                         $empty = 0;
                         $vals[] = $this->criteria[$i];
                     }
                 }
             } else {
                 $tmp_ip_str = $this->criteria[$i][7] = $this->criteria[$i][3];
                 $this->criteria[$i][3] = strtok($tmp_ip_str, ".");
                 $this->criteria[$i][4] = strtok(".");
                 $this->criteria[$i][5] = strtok(".");
                 $this->criteria[$i][6] = strtok("/");
                 $this->criteria[$i][10] = strtok("");
                 $empty = 0;
                 $vals[] = $this->criteria[$i];
             }
         } elseif (is_array($this->criteria[$i]) && array_key_exists(7, $this->criteria[$i]) && ereg("([0-9]*)\\.([0-9]*)\\.([0-9]*)\\.([0-9]*)", $this->criteria[$i][7])) {
             $empty = 0;
             $vals[] = $this->criteria[$i];
         }
     }
     //print_r ($this->criteria);
     $this->criteria = $vals;
     $this->criteria_cnt = count($vals);
     if ($use_ossim_session && $empty) {
         $domain = Session::allowedNets();
         if ($domain != "") {
             $nets = explode(",", $domain);
             $this->criteria = array();
             for ($i = 0; $i < count($nets); $i++) {
                 $tmp_ip_str = $tmp[7] = $nets[$i];
                 $tmp[0] = " ";
                 $tmp[1] = "ip_both";
                 $tmp[2] = "=";
                 $tmp[3] = strtok($tmp_ip_str, ".");
                 $tmp[4] = strtok(".");
                 $tmp[5] = strtok(".");
                 $tmp[6] = strtok("/");
                 $tmp[10] = strtok("");
                 $tmp[8] = " ";
                 if ($i == count($nets) - 1) {
                     $tmp[9] = " ";
                 } else {
                     $tmp[9] = "OR";
                 }
                 $this->criteria[$this->criteria_cnt] = $tmp;
                 $this->criteria_cnt++;
             }
         }
     }
     $new = ImportHTTPVar("new", VAR_DIGIT);
     $submit = ImportHTTPVar("submit", VAR_ALPHA | VAR_SPACE);
     if ($new == 1 && $submit == "") {
         $this->criteria = NULL;
         $this->criteria_cnt = 1;
     }
     if ($this->criteria_cnt == "") {
         $this->criteria_cnt = 1;
     }
     //print_r ($this->criteria);
     $_SESSION['ip_addr'] =& $this->criteria;
     $_SESSION['ip_addr_cnt'] =& $this->criteria_cnt;
 }
开发者ID:jhbsz,项目名称:ossimTest,代码行数:86,代码来源:base_state_citems.inc.php

示例15: while

$errorMsg = '';
/* build array of languages */
$i = 0;
if ($handle = opendir('../languages')) {
    while (false !== ($file = readdir($handle))) {
        if ($file != "." && $file != ".." && $file != "CVS" && $file != "index.php") {
            $filename = explode(".", $file);
            $languages[$i] = $filename[0];
            $i++;
        }
    }
    closedir($handle);
}
if (@$_GET['action'] == "check") {
    // form has been submitted.  Check answers.
    $_SESSION['language'] = ImportHTTPVar("language", "", $languages);
    //Check path to ADODB
    $adodbexists = file_exists($_POST['adodbpath'] . "/adodb.inc.php");
    if ($adodbexists != 1) {
        $errorMsg = $errorMsg . "<br>The Path to ADODB does not appear to be correct!<br>";
        $errorMsg = $errorMsg . "Please correct.";
        $error = 1;
    } else {
        $_SESSION['adodbpath'] = $_POST['adodbpath'];
        $error = 0;
    }
    if ($error != 1) {
        header("Location: setup2.php");
    }
    exit;
}
开发者ID:jhbsz,项目名称:ossimTest,代码行数:31,代码来源:setup1.php


注:本文中的ImportHTTPVar函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。