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


PHP Acl::get_my_users方法代码示例

本文整理汇总了PHP中Acl::get_my_users方法的典型用法代码示例。如果您正苦于以下问题:PHP Acl::get_my_users方法的具体用法?PHP Acl::get_my_users怎么用?PHP Acl::get_my_users使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Acl的用法示例。


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

示例1: get_report_data

function get_report_data($id = NULL)
{
    $conf = $GLOBALS['CONF'];
    $conf = !$conf ? new Ossim_conf() : $conf;
    $y = strftime('%Y', time() - 24 * 60 * 60 * 30);
    $m = strftime('%m', time() - 24 * 60 * 60 * 30);
    $d = strftime('%d', time() - 24 * 60 * 60 * 30);
    $reports['asset_report'] = array('report_name' => _('Asset Details'), 'report_id' => 'asset_report', 'type' => 'external', 'link_id' => 'link_ar_asset', 'link' => '', 'parameters' => array(array('name' => _('Host Name/IP/Network'), 'id' => 'ar_asset', 'type' => 'asset', 'default_value' => '')), 'access' => Session::menu_perms('environment-menu', 'PolicyHosts') || Session::menu_perms('environment-menu', 'PolicyNetworks'), 'send_by_email' => 0);
    $status_values = array('All' => array('text' => _('All')), 'Open' => array('text' => _('Open')), 'Assigned' => array('text' => _('Assigned')), 'Studying' => array('text' => _('Studying')), 'Waiting' => array('text' => _('Waiting')), 'Testing' => array('text' => _('Testing')), 'Closed' => array('text' => _('Closed')));
    $types_values = array('ALL' => array('text' => _('ALL')), 'Expansion Virus' => array('text' => _('Expansion Virus')), 'Corporative Nets Attack' => array('text' => _('Corporative Nets Attack')), 'Policy Violation' => array('text' => _('Policy Violation')), 'Security Weakness' => array('text' => _('Security Weakness')), 'Net Performance' => array('text' => _('Net Performance')), 'Applications and Systems Failures' => array('text' => _('Applications and Systems Failures')), 'Anomalies' => array('text' => _('Anomalies')), 'Vulnerability' => array('text' => _('Vulnerability')));
    $priority_values = array('High' => _('High'), 'Medium' => _('Medium'), 'Low' => _('Low'));
    $reports['tickets_report'] = array('report_name' => _('Tickets Report'), 'report_id' => 'tickets_report', 'type' => 'pdf', 'subreports' => array('title_page' => array('id' => 'title_page', 'name' => _('Title Page'), 'report_file' => 'os_reports/Common/titlepage.php'), 'alarm' => array('id' => 'alarm', 'name' => _('Alarm'), 'report_file' => 'os_reports/Tickets/Alarm.php'), 'event' => array('id' => 'event', 'name' => _('Event'), 'report_file' => 'os_reports/Tickets/Event.php'), 'anomaly' => array('id' => 'anomaly', 'name' => _('Anomaly'), 'report_file' => 'os_reports/Tickets/Anomaly.php'), 'vulnerability' => array('id' => 'vulnerability', 'name' => _('Vulnerability'), 'report_file' => 'os_reports/Tickets/Vulnerability.php')), 'parameters' => array(array('name' => _('Date Range'), 'date_from_id' => 'tr_date_from', 'date_to_id' => 'tr_date_to', 'type' => 'date_range', 'default_value' => array('date_from' => $y . '-' . $m . '-' . $d, 'date_to' => date('Y') . '-' . date('m') . '-' . date('d'))), array('name' => _('Status'), 'id' => 'tr_status', 'type' => 'select', 'values' => $status_values), array('name' => _('Type'), 'id' => 'tr_type', 'type' => 'select', 'values' => $types_values), array('name' => _('Priority'), 'id' => 'tr_priority', 'type' => 'checkbox', 'values' => $priority_values)), 'access' => Session::menu_perms('analysis-menu', 'IncidentsIncidents'), 'send_by_email' => 1);
    $reports['alarm_report'] = array('report_name' => _('Alarms Report'), 'report_id' => 'alarm_report', 'type' => 'pdf', 'subreports' => array('title_page' => array('id' => 'title_page', 'name' => _('Title Page'), 'report_file' => 'os_reports/Common/titlepage.php'), 'top_attacker_host' => array('id' => 'top_attacker_host', 'name' => _('Top 10 Attacker Host'), 'report_file' => 'os_reports/Alarms/AttackerHosts.php'), 'top_attacked_host' => array('id' => 'top_attacked_host', 'name' => _('Top 10 Attacked Host'), 'report_file' => 'os_reports/Alarms/AttackedHosts.php'), 'used_port' => array('id' => 'used_port', 'name' => _('Top 10 Used Ports'), 'report_file' => 'os_reports/Alarms/UsedPorts.php'), 'top_events' => array('id' => 'top_events', 'name' => _('Top 15 Alarms'), 'report_file' => 'os_reports/Alarms/TopAlarms.php'), 'events_by_risk' => array('id' => 'events_by_risk', 'name' => _('Top 15 Alarms by Risk'), 'report_file' => 'os_reports/Alarms/TopAlarmsByRisk.php')), 'parameters' => array(array('name' => _('Date Range'), 'date_from_id' => 'ar_date_from', 'date_to_id' => 'ar_date_to', 'type' => 'date_range', 'default_value' => array('date_from' => $y . '-' . $m . '-' . $d, 'date_to' => date('Y') . '-' . date('m') . '-' . date('d')))), 'access' => Session::menu_perms('analysis-menu', 'ControlPanelAlarms'), 'send_by_email' => 1);
    $reports['bc_pci_report'] = array('report_name' => _('Business & Compliance ISO PCI Report'), 'report_id' => 'bc_pci_report', 'type' => 'pdf', 'subreports' => array('title_page' => array('id' => 'title_page', 'name' => _('Title Page'), 'report_file' => 'os_reports/Common/titlepage.php'), 'threat_overview' => array('id' => 'threat_overview', 'name' => _('Threat overview'), 'report_file' => 'os_reports/BusinessAndComplianceISOPCI/ThreatOverview.php'), 'bri_risks' => array('id' => 'bri_risks', 'name' => _('Business real impact risks'), 'report_file' => 'os_reports/BusinessAndComplianceISOPCI/BusinessPotentialImpactsRisks.php'), 'ciap_impact' => array('id' => 'ciap_impact', 'name' => _('C.I.A Potential impact'), 'report_file' => 'os_reports/BusinessAndComplianceISOPCI/CIAPotentialImpactsRisks.php'), 'pci_dss' => array('id' => 'pci_dss', 'name' => _('PCI-DSS 2.0'), 'report_file' => 'os_reports/BusinessAndComplianceISOPCI/PCI-DSS.php'), 'pci_dss3' => array('id' => 'pci_dss3', 'name' => _('PCI-DSS 3.0'), 'report_file' => 'os_reports/BusinessAndComplianceISOPCI/PCI-DSS3.php'), 'trends' => array('id' => 'trends', 'name' => _('Trends'), 'report_file' => 'os_reports/BusinessAndComplianceISOPCI/Trends.php'), 'iso27002_p_impact' => array('id' => 'iso27002_p_impact', 'name' => _('ISO27002 Potential impact'), 'report_file' => 'os_reports/BusinessAndComplianceISOPCI/ISO27002PotentialImpact.php'), 'iso27001' => array('id' => 'iso27001', 'name' => _('ISO27001'), 'report_file' => 'os_reports/BusinessAndComplianceISOPCI/ISO27001.php')), 'parameters' => array(array('name' => _('Date Range'), 'date_from_id' => 'bc_pci_date_from', 'date_to_id' => 'bc_pci_date_to', 'type' => 'date_range', 'default_value' => array('date_from' => $y . '-' . $m . '-' . $d, 'date_to' => date('Y') . '-' . date('m') . '-' . date('d')))), 'access' => Session::menu_perms('report-menu', 'ReportsReportServer'), 'send_by_email' => 1);
    $reports['siem_report'] = array('report_name' => _('SIEM Events'), 'report_id' => 'siem_report', 'type' => 'pdf', 'subreports' => array('title_page' => array('id' => 'title_page', 'name' => _('Title Page'), 'report_file' => 'os_reports/Common/titlepage.php'), 'top_attacker_host' => array('id' => 'top_attacker_host', 'name' => _('Top 10 Attacker Host'), 'report_file' => 'os_reports/Siem/AttackerHosts.php'), 'top_attacked_host' => array('id' => 'top_attacked_host', 'name' => _('Top 10 Attacked Host'), 'report_file' => 'os_reports/Siem/AttackedHosts.php'), 'used_port' => array('id' => 'used_port', 'name' => _('Top 10 Used Ports'), 'report_file' => 'os_reports/Siem/UsedPorts.php'), 'top_events' => array('id' => 'top_events', 'name' => _('Top 15 Events'), 'report_file' => 'os_reports/Siem/TopEvents.php'), 'events_by_risk' => array('id' => 'events_by_risk', 'name' => _('Top 15 Events by Risk'), 'report_file' => 'os_reports/Siem/TopEventsByRisk.php')), 'parameters' => array(array('name' => _('Date Range'), 'date_from_id' => 'sr_date_from', 'date_to_id' => 'sr_date_to', 'type' => 'date_range', 'default_value' => array('date_from' => $y . '-' . $m . '-' . $d, 'date_to' => date('Y') . '-' . date('m') . '-' . date('d')))), 'access' => Session::menu_perms('analysis-menu', 'EventsForensics'), 'send_by_email' => 1);
    $reports['vulnerabilities_report'] = array('report_name' => _('Vulnerabilities Report'), 'report_id' => 'vulnerabilities_report', 'type' => 'external', 'target' => '_blank', 'link_id' => 'link_vr', 'link' => Menu::get_menu_url('../vulnmeter/lr_respdf.php?ipl=all&scantype=M', 'environment', 'vulnerabilities', 'overview'), 'access' => Session::menu_perms('analysis-menu', 'EventsVulnerabilities'), 'send_by_email' => 0);
    $reports['th_vuln_db'] = array('report_name' => _('Threats & Vulnerabilities Database'), 'report_id' => 'th_vuln_db', 'type' => 'external', 'link_id' => 'link_tvd', 'link' => Menu::get_menu_url('../vulnmeter/threats-db.php', 'environment', 'vulnerabilities', 'threat_database'), 'access' => Session::menu_perms('analysis-menu', 'EventsVulnerabilities'), 'send_by_email' => 0);
    $reports['ticket_status'] = array('report_name' => _('Tickets Status'), 'report_id' => 'ticket_status', 'type' => 'external', 'link_id' => 'link_tr', 'link' => Menu::get_menu_url('../report/incidentreport.php', 'analysis', 'tickets', 'tickets'), 'access' => Session::menu_perms('analysis-menu', 'IncidentsIncidents'), 'send_by_email' => 0);
    $db = new ossim_db();
    $conn = $db->connect();
    $user = Session::get_session_user();
    $session_list = Session::get_list($conn, 'ORDER BY login');
    if (preg_match('/pro|demo/', $conf->get_conf('ossim_server_version')) && !Session::am_i_admin()) {
        $myusers = Acl::get_my_users($conn, Session::get_session_user());
        if (count($myusers) > 0) {
            $is_pro_admin = 1;
        }
    }
    // User Log lists
    if (Session::am_i_admin()) {
        $user_values[''] = array('text' => _('All'));
        if ($session_list) {
            foreach ($session_list as $session) {
                $login = $session->get_login();
                $user_values[$login] = $login == $user ? array('text' => $login, 'selected' => TRUE) : array('text' => $login);
            }
        }
    } elseif ($is_pro_admin) {
        foreach ($myusers as $myuser) {
            $user_values[$myuser['login']] = array('text' => $myuser['login']);
            $user_values[$user] = array('text' => $user, 'selected' => TRUE);
        }
    } else {
        $user_values[$user] = array('text' => $user);
    }
    $code_list = Log_config::get_list($conn, 'ORDER BY descr');
    $action_values[''] = array('text' => _('All'));
    if ($code_list) {
        foreach ($code_list as $code_log) {
            $code_aux = $code_log->get_code();
            $action_values[$code_aux] = array('text' => '[' . sprintf("%02d", $code_aux) . '] ' . _(preg_replace('|%.*?%|', " ", $code_log->get_descr())));
        }
    }
    $reports['user_activity'] = array('report_name' => _('User Activity Report'), 'report_id' => 'user_activity', 'type' => 'external', 'link_id' => 'link_ua', 'link' => Menu::get_menu_url('../userlog/user_action_log.php', 'settings', 'settings', 'user_activity'), 'parameters' => array(array('name' => _('User'), 'id' => 'ua_user', 'type' => 'select', 'values' => $user_values), array('name' => _('Action'), 'id' => 'ua_action', 'type' => 'select', 'values' => $action_values)), 'access' => Session::menu_perms('settings-menu', 'ToolsUserLog'), 'send_by_email' => 0);
    $reports['geographic_report'] = array('report_name' => _('Geographic Report'), 'report_id' => 'geographic_report', 'type' => 'pdf', 'subreports' => array('title_page' => array('id' => 'title_page', 'name' => _('Title Page'), 'report_file' => 'os_reports/Common/titlepage.php'), 'geographic_report' => array('id' => 'geographic_report', 'name' => _('Geographic Report'), 'report_file' => 'os_reports/Various/Geographic.php')), 'parameters' => array(array('name' => _('Date Range'), 'date_from_id' => 'gr_date_from', 'date_to_id' => 'gr_date_to', 'type' => 'date_range', 'default_value' => array('date_from' => $y . '-' . $m . '-' . $d, 'date_to' => date('Y') . '-' . date('m') . '-' . date('d')))), 'access' => Session::menu_perms('analysis-menu', 'EventsForensics'), 'send_by_email' => 1);
    //Sensor list
    $sensor_values[''] = array('text' => ' -- ' . _('Sensors no found') . ' -- ');
    $filters = array('order_by' => 'name');
    $sensor_list = Av_sensor::get_basic_list($conn, $filters);
    $filters = array('order_by' => 'priority desc');
    list($sensor_list, $sensor_total) = Av_sensor::get_list($conn, $filters);
    if ($sensor_total > 0) {
        $sensor_values = array();
        foreach ($sensor_list as $s) {
            $properties = $s['properties'];
            if ($properties['has_nagios']) {
                $sensor_values[$s['ip']] = array('text' => $s['name']);
            }
        }
    }
    /* Nagios link */
    $nagios_link = $conf->get_conf('nagios_link');
    $scheme = empty($_SERVER['HTTPS']) ? 'http://' : 'https://';
    $path = !empty($nagios_link) ? $nagios_link : '/nagios3/';
    $port = !empty($_SERVER['SERVER_PORT']) ? ':' . $_SERVER['SERVER_PORT'] : "";
    $nagios = $port . $path;
    $section_values = array(urlencode($nagios . 'cgi-bin/trends.cgi') => array('text' => _('Trends')), urlencode($nagios . 'cgi-bin/avail.cgi') => array('text' => _('Availability')), urlencode($nagios . 'cgi-bin/histogram.cgi') => array('text' => _('Event Histogram')), urlencode($nagios . 'cgi-bin/history.cgi?host=all') => array('text' => _('Event History')), urlencode($nagios . 'cgi-bin/summary.cgi') => array('text' => _('Event Summary')), urlencode($nagios . 'cgi-bin/notifications.cgi') => array('text' => _('Notifications')), urlencode($nagios . 'cgi-bin/showlog.cgi') => array('text' => _('Performance Info')));
    $reports['availability_report'] = array('report_name' => _('Availability Report'), 'report_id' => 'availability_report', 'type' => 'external', 'link_id' => 'link_avr', 'click' => "nagios_link('avr_nagios_link', 'avr_sensor', 'avr_section');", 'parameters' => array(array('name' => _('Sensor'), 'id' => 'avr_sensor', 'type' => 'select', 'values' => $sensor_values), array('name' => 'Nagioslink', 'id' => 'avr_nagios_link', 'type' => 'hidden', 'default_value' => urlencode($scheme)), array('name' => _('Section'), 'id' => 'avr_section', 'type' => 'select', 'values' => $section_values)), 'access' => Session::menu_perms('environment-menu', 'MonitorsAvailability'), 'send_by_email' => 0);
    $db->close();
    if ($id == NULL) {
        ksort($reports);
        return $reports;
    } else {
        return !empty($reports[$id]) ? $reports[$id] : array();
    }
}
开发者ID:jackpf,项目名称:ossim-arc,代码行数:86,代码来源:os_report_common.php

示例2: select_profile

function select_profile()
{
    global $sid, $username, $dbconn, $version, $nessus_path;
    $used_sids = array();
    if (preg_match("/omp\\s*\$/i", $nessus_path)) {
        $omp = new OMP();
        $used_sids = $omp->get_used_sids();
    }
    $entities_nt = array();
    $query = "SELECT ae.id as eid, ae.name as ename, aet.name as etype FROM acl_entities AS ae, acl_entities_types AS aet WHERE ae.type = aet.id";
    $result_entities = $dbconn->Execute($query);
    while (!$result_entities->EOF) {
        $entities_nt[$result_entities->fields['eid']] = $result_entities->fields['ename'] . " [" . $result_entities->fields['etype'] . "]";
        $result_entities->MoveNext();
    }
    $query = "";
    $normal_user_pro = false;
    if ($username == "admin") {
        $query = "SELECT id, name, description, owner, type FROM vuln_nessus_settings \n                    WHERE deleted != '1' ORDER BY name";
    } else {
        if (preg_match("/pro|demo/i", $version)) {
            if (Acl::am_i_proadmin()) {
                $pro_users = array();
                $entities_list = array();
                //list($entities_admin,$num) = Acl::get_entities_admin($dbconn,Session::get_session_user());
                //$entities_list = array_keys($entities_admin);
                $entities_list = Acl::get_user_entities($current_user);
                $users = Acl::get_my_users($dbconn, Session::get_session_user());
                foreach ($users as $us) {
                    $pro_users[] = $us["login"];
                }
                $query = "SELECT id, name, description, owner, type FROM vuln_nessus_settings \n                      WHERE deleted != '1' and (name='Default' or owner in ('0','" . implode("', '", array_merge($entities_list, $pro_users)) . "')) ORDER BY name";
            } else {
                $tmp = array();
                $entities = Acl::get_user_entities($username);
                foreach ($entities as $entity) {
                    $tmp[] = "'" . $entity . "'";
                }
                if (count($tmp) > 0) {
                    $user_where = "owner in ('0','{$username}'," . implode(", ", $tmp) . ")";
                } else {
                    $user_where = "owner in ('0','{$username}')";
                }
                $query = "SELECT id, name, description, owner, type FROM vuln_nessus_settings \n                          WHERE deleted != '1' and (name='Default' or {$user_where}) ORDER BY name";
                $normal_user_pro = true;
            }
        } else {
            $query = "SELECT id, name, description, owner, type FROM vuln_nessus_settings \n                          WHERE deleted != '1' and (name='Default' or owner in ('0','{$username}')) ORDER BY name";
        }
    }
    //var_dump($query);
    $result = $dbconn->execute($query);
    //echo $query;
    echo "<CENTER>";
    echo "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"800\"><tr><td class=\"headerpr\" style=\"border:0;\">" . _("Vulnerability Scan Profiles") . "</td></tr></table>";
    echo "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"800\"><tr><td class=\"noborder\">";
    echo "<p>";
    echo _("Please select a profile to edit") . ":";
    echo "</p>";
    echo "<table align='center'>";
    echo "<tr>";
    if ($username == "admin" || Session::am_i_admin()) {
        echo "<th>" . _("Available for") . "</th>";
    }
    echo "   <th>" . _("Profile") . "</th>";
    echo "   <th>" . _("Description") . "</th>";
    echo "   <th>" . _("Action") . "</th>";
    echo "</tr>";
    while (!$result->EOF) {
        //<td>$sowner</td>
        //<td>$stype</td>
        list($sid, $sname, $sdescription, $sowner, $stype) = $result->fields;
        echo "<tr>";
        if ($username == "admin" || Session::am_i_admin()) {
            if ($sowner == "0") {
                echo "<td>" . _("All") . "</td>";
            } elseif (is_numeric($sowner)) {
                echo "<td style='padding:0px 2px 0px 2px;'>" . $entities_nt[$sowner] . "</td>";
            } else {
                echo "<td>" . html_entity_decode($sowner) . "</td>";
            }
        }
        echo "<td>" . html_entity_decode($sname) . "</td>";
        echo "<td>" . html_entity_decode($sdescription) . "</td>";
        echo "<td>";
        //var_dump($normal_user_pro);
        //var_dump($sowner);
        //var_dump($username);
        //var_dump($used_sids);
        if ($normal_user_pro && $sowner != $username && $sname != "Default") {
            echo "&nbsp";
        } elseif ($username == "admin" || Session::am_i_admin()) {
            if (!in_array($sid, $used_sids)) {
                echo "<a href=\"settings.php?disp=edit&amp;&amp;sid={$sid}\"><img src=\"images/pencil.png\"></a>";
                echo "<a href=\"settings.php?disp=edit&amp;op=delete&amp;sid={$sid}\" onclick=\"return confirmDelete();\"><img src=\"images/delete.gif\"></a>";
            } else {
                echo "<img src=\"images/pencil.png\" title=\"" . _("This profile is being used by a running job now") . "\" style=\"filter:alpha(opacity=50);-moz-opacity:0.5;-khtml-opacity: 0.5;opacity: 0.5;\">";
                echo "<img src=\"images/delete.gif\" title=\"" . _("This profile is being used by a running job now") . "\" style=\"filter:alpha(opacity=50);-moz-opacity:0.5;-khtml-opacity: 0.5;opacity: 0.5;\">";
            }
        } elseif ($sname == "Default") {
//.........这里部分代码省略.........
开发者ID:jhbsz,项目名称:ossimTest,代码行数:101,代码来源:settings.php

示例3: array

        // Opensource
        if ($login == ACL_DEFAULT_OSSIM_ADMIN || $user[0]->get_is_admin()) {
            return "../pixmaps/user-gadmin.png";
        } else {
            return "../pixmaps/user-green.png";
        }
    }
}
$where = "";
$users = array();
$allowed_users = array();
if (Session::am_i_admin() || $pro && Acl::am_i_proadmin()) {
    if (Session::am_i_admin()) {
        $users_list = Session::get_list($dbconn, "ORDER BY login");
    } else {
        $users_list = Acl::get_my_users($dbconn, Session::get_session_user());
    }
    if (is_array($users_list) && !empty($users_list)) {
        foreach ($users_list as $k => $v) {
            $users[] = is_object($v) ? $v->get_login() : $v["login"];
        }
        $where = "WHERE login in ('" . implode("','", $users) . "')";
    }
} else {
    $where = "WHERE login = '" . Session::get_session_user() . "'";
}
$allowed_users = Session_activity::get_list($dbconn, $where . " ORDER BY activity desc");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
	<head>
开发者ID:jhbsz,项目名称:ossimTest,代码行数:31,代码来源:opened_sessions.php

示例4: rsort

            $insert[] = $found[1];
        }
    }
}
rsort($insert);
$dir->close();
if ($pro) {
    // users
    $users = array();
    if (Session::am_i_admin()) {
        $users_list = Session::get_list($conn_ossim);
        foreach ($users_list as $user_data) {
            $users[] = $user_data->login;
        }
    } else {
        $users_list = Acl::get_my_users($conn_ossim, Session::get_session_user());
        foreach ($users_list as $user_data) {
            $users[] = $user_data["login"];
        }
    }
    // entities
    list($entities_all, $num_entities) = Acl::get_entities($conn_ossim);
    list($entities_admin, $num) = Acl::get_entities_admin($conn_ossim, Session::get_session_user());
    $entities_list = array_keys($entities_admin);
}
$db->close($conn);
$db->close($conn_ossim);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
	<head>
开发者ID:jhbsz,项目名称:ossimTest,代码行数:31,代码来源:index.php

示例5: showSubCategoryHTML

    function showSubCategoryHTML()
    {
        // get list reports
        $db = new ossim_db();
        $dbconn = $db->connect();
        $creports = array();
        $subreports_ac = array();
        $sql_search = "";
        if ($search != "") {
            $sql_search = "AND name like '%{$search}%'";
        }
        $result = $dbconn->Execute("SELECT login, name, value FROM user_config where category='custom_report' {$sql_search} ORDER BY name ASC");
        $hi = 0;
        while (!$result->EOF) {
            $available = false;
            $unserializedata = unserialize($result->fields["value"]);
            $available_for_user = $unserializedata["user"];
            $available_for_entity = $unserializedata["entity"];
            // check if this report is available for session user
            if (Session::am_i_admin()) {
                $available = true;
            } else {
                if ($available_for_user == "0") {
                    $available = true;
                } else {
                    if ($available_for_user != "" && $available_for_user == $session_user || $result->fields["login"] == $session_user) {
                        $available = true;
                    } else {
                        if (preg_match("/pro|demo/i", $version)) {
                            if (Acl::am_i_proadmin()) {
                                $entities_list = Acl::get_entities_admin($dbconn, Session::get_session_user());
                                $entities = array_keys($entities_list[0]);
                                $users = Acl::get_my_users($dbconn, Session::get_session_user());
                                $users_login = array();
                                foreach ($users as $user) {
                                    $users_login[] = $user["login"];
                                }
                                if (in_array($available_for_entity, $entities) || in_array($available_for_user, $users_login) || in_array($result->fields["login"], $users_login)) {
                                    $available = true;
                                }
                            } else {
                                $entities = Acl::get_user_entities(Session::get_session_user());
                                if (in_array($available_for_entity, $entities)) {
                                    $available = true;
                                }
                            }
                        }
                    }
                }
            }
            // save report if is available
            $maxpag = 20;
            $to = $pag * $maxpag;
            $from = $to - $maxpag;
            if ($available) {
                if ($from <= $hi && $hi < $to) {
                    $creports[] = $result->fields;
                }
                // autocomplete
                $key = base64_encode($result->fields["name"] . "###" . $result->fields["login"]);
                $subreports_ac[$key] = trim($result->fields["name"]);
                $hi++;
            }
            $result->MoveNext();
        }
        $dbconn->disconnect();
        //
        $html = '<table style="margin:0;padding:0;width:100%;font-size:11px">
					<tr>
						<td colspan="2">' . _('Properties report') . ':</td>
					</tr>
					<tr>
						<td>' . _('Report Name') . ':</td>
						<td>
							<select name="run">';
        foreach ($subreports_ac as $key => $value) {
            $html .= '<option value="' . $key . '"';
            $html .= $this->get('run') == $key ? ' selected="selected"' : "";
            $html .= '>' . $value . '</option>';
        }
        $html .= ' 		</select>
						</td>
					</tr>
					<tr>
						<td>' . _('Refresh report') . ':</td>
						<td><input name="refresh" value="false" ';
        if ($this->get('refresh') == 'false') {
            $html .= 'checked="checked" ';
        }
        $html .= 'type="radio">' . _('No') . '
					<input name="refresh" value="true" ';
        if ($this->get('refresh') == 'true') {
            $html .= 'checked="checked" ';
        }
        $html .= 'type="radio">' . _('Yes') . '
						<input style="width:80px" type="text" name="secondRefresh" value="' . $this->get('secondRefresh') . '" /> ' . _('seconds') . '</td>
					</tr>
				</table>';
        return $html;
    }
开发者ID:jhbsz,项目名称:ossimTest,代码行数:100,代码来源:custom_report.php

示例6: elseif

				</tr>
			</table>
			<input type="hidden" name="action" value="save" />
			<input type="hidden" name="name" value="<?php 
        echo $name;
        ?>
" />
			<input type="hidden" name="url" value="<?php 
        echo $url;
        ?>
" />
	<?php 
    } elseif (Acl::am_i_proadmin()) {
        // pro admin
        //users
        $users_admin = Acl::get_my_users($dbconn, Session::get_session_user());
        foreach ($users_admin as $u) {
            //	if($u["login"]!=Session::get_session_user()){
            $users_pro_login[] = $u["login"];
            //	}
        }
        //if(!in_array(Session::get_session_user(), $users_pro_login) && $incident_in_charge!=Session::get_session_user())   $users_pro_login[] = Session::get_session_user();
        //entities
        list($entities_all, $num_entities) = Acl::get_entities($dbconn);
        list($entities_admin, $num) = Acl::get_entities_admin($dbconn, Session::get_session_user());
        $entities_list = array_keys($entities_admin);
        $entities_types_aux = Acl::get_entities_types($dbconn);
        $entities_types = array();
        foreach ($entities_types_aux as $etype) {
            $entities_types[$etype['id']] = $etype;
        }
开发者ID:jhbsz,项目名称:ossimTest,代码行数:31,代码来源:add_to_all_dashboards.php

示例7: tab_discovery


//.........这里部分代码省略.........
            if ($editdata['scan_ASSIGNED'] != "" && $editdata['scan_ASSIGNED'] == $SVRid) {
                $discovery .= " SELECTED";
            }
            if ($SVRid_selected == $SVRid) {
                $discovery .= " SELECTED";
            }
            $discovery .= ">" . strtoupper($sname) . " [{$shostIP}] </option>";
        }
        $result->MoveNext();
    }
    $discovery .= <<<EOT
      </select>
    </td>
  </tr>
  <tr>
EOT;
    $discovery .= "<td align='right' width='25%'>" . _("Profile") . ":</td>";
    $discovery .= "<td style='text-align:left;'><select name='sid'>";
    //$query = "SELECT distinct(t1.id), t1.name, t1.description
    //  FROM vuln_nessus_settings t1
    //   LEFT JOIN vuln_nessus_settings_users t2 ON t1.id = t2.sid
    //   WHERE t1.type = 'G' OR t2.username='$username'
    //   ORDER BY t1.name";
    $query = "";
    if ($username == "admin" || Session::am_i_admin()) {
        $query = "SELECT distinct(t1.id), t1.name, t1.description \n                 FROM vuln_nessus_settings t1 WHERE deleted='0'\n                 ORDER BY t1.name";
    } else {
        if (preg_match("/pro|demo/i", $version)) {
            if (Acl::am_i_proadmin()) {
                $pro_users = array();
                $entities_list = Acl::get_user_entities($current_user);
                //list($entities_admin,$num) = Acl::get_entities_admin($dbconn,Session::get_session_user());
                //$entities_list = array_keys($entities_admin);
                $users = Acl::get_my_users($dbconn, Session::get_session_user());
                foreach ($users as $us) {
                    $pro_users[] = $us["login"];
                }
                $query = "SELECT distinct(t1.id), t1.name, t1.description FROM vuln_nessus_settings t1\n                      WHERE deleted = '0' and (name='Default' or owner in ('0','" . implode("','", array_merge($entities_list, $pro_users)) . "')) ORDER BY t1.name";
            } else {
                $tmp = array();
                $entities = Acl::get_user_entities($username);
                foreach ($entities as $entity) {
                    $tmp[] = "'" . $entity . "'";
                }
                if (count($tmp) > 0) {
                    $user_where = "owner in ('0','{$username}'," . implode(", ", $tmp) . ")";
                } else {
                    $user_where = "owner in ('0','{$username}')";
                }
                $query = "SELECT distinct(t1.id), t1.name, t1.description FROM vuln_nessus_settings t1\n                      WHERE deleted = '0' and (name='Default' or {$user_where}) ORDER BY t1.name";
            }
        } else {
            $query = "SELECT distinct(t1.id), t1.name, t1.description FROM vuln_nessus_settings t1\n                     WHERE deleted = '0' and (name='Default' or owner in ('0','{$username}')) ORDER BY t1.name";
        }
    }
    //var_dump($query);
    $result = $dbconn->execute($query);
    $job_profiles = array();
    $id_found = false;
    $ipr = 0;
    while (!$result->EOF) {
        list($sid, $sname, $sdescription) = $result->fields;
        if ($sid_selected == $sid) {
            $id_found = true;
        }
        $job_profiles[$ipr]["sid"] = $sid;
开发者ID:jhbsz,项目名称:ossimTest,代码行数:67,代码来源:sched.php

示例8: tab_discovery


//.........这里部分代码省略.........
    $discovery .= "</tr>";
    list($sensor_list, $total) = Av_sensor::get_list($dbconn);
    $discovery .= "<tr>";
    $discovery .= "<td class='job_option'>" . Util::strong(_("Select Server") . ":") . "</td>";
    $discovery .= "<td style='text-align:left;'><select id='SVRid' style='width:212px' name='SVRid'>";
    $discovery .= "<option value='Null'>" . _("First Available Server-Distributed") . "</option>";
    foreach ($sensor_list as $_sensor_id => $sensor_data) {
        if (intval($sensor_data['properties']['has_vuln_scanner']) == 1) {
            $discovery .= "<option value=\"{$_sensor_id}\" ";
            if ($editdata['email'] == $_sensor_id || $editdata['scan_ASSIGNED'] == $_sensor_id) {
                $discovery .= " SELECTED";
            }
            if ($SVRid_selected == $_sensor_id) {
                $discovery .= " SELECTED";
            }
            $discovery .= ">" . strtoupper($sensor_data['name']) . " [" . $sensor_data['ip'] . "] </option>";
        }
    }
    $discovery .= <<<EOT
      </select>
    </td>
  </tr>
  <tr>
EOT;
    $discovery .= "<td class='job_option'>" . Util::strong(_("Profile") . ":") . "</td>";
    $discovery .= "<td style='text-align:left;'><select name='sid'>";
    $query = "";
    if ($username == "admin" || Session::am_i_admin()) {
        $query = "SELECT distinct(t1.id), t1.name, t1.description \n                 FROM vuln_nessus_settings t1 WHERE deleted='0'\n                 ORDER BY t1.name";
    } else {
        if (Session::is_pro()) {
            $users_and_entities = Acl::get_entities_to_assign($dbconn);
            if (Acl::am_i_proadmin()) {
                $users = Acl::get_my_users($dbconn, Session::get_session_user());
                foreach ($users as $us) {
                    $users_and_entities[$us->get_login()] = $us->get_login();
                }
                $owner_list['0'] = '0';
                $owner_list = array_keys($users_and_entities);
                $owner_list = implode("','", $owner_list);
                $query = "SELECT distinct(t1.id), t1.name, t1.description FROM vuln_nessus_settings t1\n                      WHERE deleted = '0' and (name='Default' or owner in ('" . $owner_list . "')) ORDER BY t1.name";
            } else {
                $owner_list['0'] = '0';
                $owner_list[$username] = $username;
                $owner_list = array_keys($users_and_entities);
                $owner_list[] = Session::get_session_user();
                $owner_list = implode("','", $owner_list);
                $user_where = "owner in ('" . $owner_list . "')";
                $query = "SELECT distinct(t1.id), t1.name, t1.description FROM vuln_nessus_settings t1\n                      WHERE deleted = '0' and (name='Default' or {$user_where}) ORDER BY t1.name";
            }
        } else {
            $query = "SELECT distinct(t1.id), t1.name, t1.description FROM vuln_nessus_settings t1\n                     WHERE deleted = '0' and (name='Default' or owner in ('0','{$username}')) ORDER BY t1.name";
        }
    }
    $dbconn->SetFetchMode(ADODB_FETCH_BOTH);
    $result = $dbconn->execute($query);
    $job_profiles = array();
    $id_found = false;
    $ipr = 0;
    while (!$result->EOF) {
        list($sid, $sname, $sdescription) = $result->fields;
        if ($sid_selected == $sid) {
            $id_found = true;
        }
        $job_profiles[$ipr]["sid"] = $sid;
        $job_profiles[$ipr]["sname"] = $sname;
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:67,代码来源:sched.php

示例9: foreach

    } else {
        $hosts .= '{ txt:"' . $_ip . '", id: "' . $_ip . '" },';
    }
}
// Plugin
require_once 'classes/Plugin.inc';
$_plugin = Plugin::get_id_and_name($conn);
$plugins = '';
foreach ($_plugin as $id => $name) {
    $plugins .= '{ txt:"' . $name . '", id: "' . $id . '" },';
}
// User Log lists
$session_list = Session::get_list($conn, "ORDER BY login");
if (preg_match("/pro|demo/", $conf->get_conf("ossim_server_version", FALSE)) && !Session::am_i_admin()) {
    require_once 'classes/Acl.inc';
    $myusers = Acl::get_my_users($conn, Session::get_session_user());
    if (count($myusers) > 0) {
        $is_pro_admin = 1;
    }
}
$code_list = Log_config::get_list($conn, "ORDER BY descr");
// Sensor list for availability
require_once 'classes/Sensor.inc';
$sensor_list = Sensor::get_all($conn, "ORDER BY name");
require_once 'ossim_conf.inc';
$nagios_default = parse_url($conf->get_conf("nagios_link"));
/* nagios link */
$scheme = isset($nagios_default["scheme"]) ? $nagios_default["scheme"] : "http";
$path = isset($nagios_default["path"]) ? $nagios_default["path"] : "/nagios/";
$path = str_replace("//", "/", $path);
if ($path[0] != "/") {
开发者ID:jhbsz,项目名称:ossimTest,代码行数:31,代码来源:jasper_simple.php


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