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


PHP Session::am_i_admin方法代码示例

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


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

示例1: delete_nfsen_source

function delete_nfsen_source($data)
{
    if (!Session::am_i_admin()) {
        $return['error'] = TRUE;
        $return['msg'] = _('Action not authorized');
        return $return;
    }
    require_once '../sensor/nfsen_functions.php';
    $sensor = $data['sensor'];
    ossim_valid($sensor, OSS_ALPHA, 'illegal:' . _('Nfsen Source'));
    if (ossim_error()) {
        $info_error = _('Error') . ': ' . ossim_get_error();
        ossim_clean_error();
        $return['error'] = TRUE;
        $return['msg'] = $info_error;
        return $return;
    }
    $res = delete_nfsen($sensor);
    if ($res['status'] == 'success') {
        $return['error'] = FALSE;
        $return['msg'] = _('Source deleted successfully');
        //To forcer load variables in session again
        unset($_SESSION['tab']);
    } else {
        $return['error'] = TRUE;
        $return['msg'] = $res['data'];
    }
    return $return;
}
开发者ID:jackpf,项目名称:ossim-arc,代码行数:29,代码来源:nfsen_ajax.php

示例2: check_deploy_perms

function check_deploy_perms()
{
    if (!Session::am_i_admin()) {
        $config_nt = array('content' => _("You do not have permission to see this section"), 'options' => array('type' => 'nf_error', 'cancel_button' => false), 'style' => 'width: 60%; margin: 30px auto; text-align:center;');
        $nt = new Notification('nt_1', $config_nt);
        $nt->show();
        die;
    }
    return true;
}
开发者ID:jackpf,项目名称:ossim-arc,代码行数:10,代码来源:deploy_common.php

示例3: draw_user_header

function draw_user_header($conn, $user)
{
    $entities = "";
    foreach ($user->ctx as $entity) {
        $entities .= Acl::get_entity_name($conn, $entity) . "<br>";
    }
    if (empty($entities) && Session::am_i_admin()) {
        $entities = _("Global Admin");
    }
    $header = "\n\t       <div class='column_header'>\n\t           <div class='db_perm_header_title'>\n\t               " . $user->name . "\n\t           </div>\n\t           <div class='db_perm_header_opts' onclick='toggle_default_tabs(this,\"" . $user->login . "\");'>\n\t               " . _("Show Default Tabs") . "\n\t           </div>\n\t           <div title='{$entities}' class='db_perm_header_icon ui-icon ui-icon-help tooltip'></div>\n\t       </div>";
    return $header;
}
开发者ID:jackpf,项目名称:ossim-arc,代码行数:12,代码来源:permission_common.php

示例4: mapAllowed

function mapAllowed($perms_arr, $version)
{
    if (Session::am_i_admin()) {
        return true;
    }
    $ret = false;
    foreach ($perms_arr as $perm => $val) {
        // ENTITY
        if (preg_match("/^\\d+\$/", $perm)) {
            if (preg_match("/pro|demo/i", $version) && $_SESSION['_user_vision']['entity'][$perm]) {
                $ret = true;
            }
            // USER
        } elseif (Session::get_session_user() == $perm) {
            $ret = true;
        }
    }
    return $ret;
}
开发者ID:jhbsz,项目名称:ossimTest,代码行数:19,代码来源:view.php

示例5: showSubCategoryHTML

 function showSubCategoryHTML()
 {
     $html = '';
     $check_ossim = $check_snort = '';
     if ($this->get('cloud_db') == 'snort') {
         $check_snort = 'checked';
     } else {
         $check_ossim = 'checked';
     }
     $resolv_yes = $resolv_no = '';
     if ($this->get('cloud_resolv_ip') == '1') {
         $resolv_yes = 'checked';
     } else {
         $resolv_no = 'checked';
     }
     $html .= _("Database") . ':<br/>
         <input type="radio" name="cloud_db" value="ossim" ' . $check_ossim . '>Ossim<br/>
         <input type="radio" name="cloud_db" value="snort" ' . $check_snort . '>Snort
         <br/>
         <hr noshade>
     ';
     $html .= _("SQL code") . ':<br/>';
     $hidden = !Session::am_i_admin() ? ' style="display:none"' : '';
     $html .= '<textarea name="cloud_sql" rows="6" cols="55" wrap="soft"' . $hidden . '>';
     $html .= $this->get('cloud_sql');
     $html .= '</textarea>';
     if (!Session::am_i_admin()) {
         $html .= '<b>' . _("Only global admins can change this query!") . "</b><br/>";
     }
     $html .= '<br/>';
     $html .= _("Cloud link. Use _TAG_ for placeholder");
     $html .= ': <input type ="text" name="cloud_link" size="30" value ="' . $this->get('cloud_link') . '"><br/>';
     $html .= _("Cloud tag max length, 0 means unlimited");
     $html .= ': <input type ="text" name="cloud_tag_max_len" value ="' . $this->get('cloud_tag_max_len') . '"><br/>';
     $html .= "<hr noshade>";
     $html .= _("Resolve hostname on column?") . ':<br/>
         <input type="radio" name="cloud_resolv_ip" value="1" ' . $resolv_yes . '>' . _("Yes") . '<br/>
         <input type="radio" name="cloud_resolv_ip" value="0" ' . $resolv_no . '>' . _("No") . '
         <br/>
     ';
     return $html;
 }
开发者ID:jhbsz,项目名称:ossimTest,代码行数:42,代码来源:custom_cloud.php

示例6: get_wizard_perms

function get_wizard_perms($dbconn)
{
    define("NO_PERMS", 0);
    define("VISION_PERMS", 1);
    define("EDITING_PERMS", 2);
    $perms = array("entity_perms" => array(), "user_perms" => array());
    $user_vision = !isset($_SESSION['_user_vision']) ? Acl::get_user_vision($dbconn) : $_SESSION['_user_vision'];
    //User permission
    $perms['user_perms'] = $user_vision['user'];
    //Entity permissions
    if (Session::am_i_admin()) {
        $perms['entity_perms'] = $user_vision['entity'];
    } else {
        foreach ($user_vision['entity'] as $entity_id => $perm) {
            $perms['entity_perms'][$entity_id] = NO_PERMS;
            //Initial permissions
        }
        $my_entities = Acl::get_my_entities($dbconn, '', FALSE);
        $my_entities_admin = $user_vision['entity_admin'];
        foreach ($my_entities as $entity_id => $entity) {
            if (!empty($my_entities_admin[$entity_id])) {
                $perms['entity_perms'][$entity_id] = EDITING_PERMS;
            } else {
                if ($perms['entity_perms'][$entity_id] < EDITING_PERMS) {
                    $perms['entity_perms'][$entity_id] = VISION_PERMS;
                }
            }
            foreach ($entity['children'] as $entity_child_id) {
                if (!empty($my_entities_admin[$entity_id]) || !empty($my_entities_admin[$entity_child_id])) {
                    $perms['entity_perms'][$entity_child_id] = EDITING_PERMS;
                } else {
                    if ($perms['entity_perms'][$entity_child_id] < EDITING_PERMS) {
                        $perms['entity_perms'][$entity_child_id] = VISION_PERMS;
                    }
                }
            }
        }
    }
    return $perms;
}
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:40,代码来源:wizard_common.php

示例7: showSubCategoryHTML

 function showSubCategoryHTML()
 {
     $html = '';
     $check_ossim = $check_snort = '';
     if ($this->get('graph_db') == 'snort') {
         $check_snort = 'checked';
     } else {
         $check_ossim = 'checked';
     }
     $html .= 'Database:
         <input type="radio" name="graph_db" value="ossim" ' . $check_ossim . '>Ossim
         <input type="radio" name="graph_db" value="snort" ' . $check_snort . '>Snort
         <br/>
     ';
     $html .= _("SQL code") . ':<br/>';
     $hidden = !Session::am_i_admin() ? ' style="display:none"' : '';
     $html .= '<textarea name="graph_sql" rows="17" cols="55" wrap="soft"' . $hidden . '>';
     $html .= $this->get('graph_sql');
     $html .= '</textarea>';
     if (!Session::am_i_admin()) {
         $html .= '<b>' . _("Only global admins can change this query!") . "</b><br/>";
     }
     return $html;
 }
开发者ID:jhbsz,项目名称:ossimTest,代码行数:24,代码来源:custom_sql.php

示例8: SendHeader


//.........这里部分代码省略.........
                 send($(this).val(), $('#interface option:selected').text());
             });
             
             <?php 
    if (isset($_POST['ip'])) {
        ?>
                 send('<?php 
        echo Util::htmlentities($_POST['ip']);
        ?>
', $('#interface option:selected').text());
                 <?php 
    }
    ?>
             // ************

             $('.scriptinfo').tipTip({
                 defaultPosition: "down",
                 content: function (e) {
                    
                    var ip_data = $(this).attr('data-title');
                        ip_data = ip_data.split('-');
                    
                    $.ajax({
                        url: '../alarm/alarm_netlookup.php?ip=' + ip_data[0],
                        success: function (response) {
                          e.content.html(response); // the var e is the callback function data (see above)
                        }
                    });
                    return '<?php 
    echo _("Searching") . "...";
    ?>
'; // We temporary show a Please wait text until the ajax success callback is called.
                 }
              });
  			
			$(".repinfo").tipTip({
				defaultPosition: 'left',
				content: function (e) { 
					return $(this).attr('txt');
				}
			});  
                
			$('#filter').on('keyup', function(e){
                $(this).val(function(i, val) {
					return val.replace(/[\t\r\b]/g, '');
				});
			});
										  
			<?php 
    if (GET('ip') != "") {
        ?>
				$("#process_button").click();
				<?php 
    }
    ?>
			
		}

		function lastsessions() {
			$('#modeselect0').click();
			$("#listN option[value='3']").attr('selected', 'selected');
			$("#process_button").click();
		}
		
		function launch(val,order) {
			$('#modeselect1').click();
			$("#TopN option[value='0']").attr('selected', 'selected');
			$("#StatTypeSelector option[value='"+val+"']").attr('selected', 'selected');
			$("#statorder option[value='"+order+"']").attr('selected', 'selected');
			$("#process_button").click();
		}
		
		function remote_interface(ip) {
			$("#FlowProcessingForm").attr("action", "menu.php");
			$("#FlowProcessingForm").attr("target", "menu_nfsen");
			$("#FlowProcessingForm").append("<input type='hidden' name='process' value='Process' />");
			$("#FlowProcessingForm").append("<input type='hidden' name='ip' value='"+ip+"' />");
			$("#FlowProcessingForm").submit();
		}
		
		function clean_remote_data() {
			$("#FlowProcessingForm").removeAttr("target");
			$("#FlowProcessingForm").attr("action", $("#FlowProcessingForm").attr("laction")); // set the local action
		}
	</script>	
</head>

<body>

<?php 
    $db_aux = new ossim_db();
    $conn_aux = $db_aux->connect();
    $aux_ri_interfaces = Remote_interface::get_list($conn_aux, "WHERE status = 1");
    $ri_list = $aux_ri_interfaces[0];
    $ri_total = $aux_ri_interfaces[1];
    $db_aux->close();
    if (Session::am_i_admin() && count($ri_total) > 0) {
        include 'menu.php';
    }
}
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:101,代码来源:nfsen.php

示例9: _

        <div id="db_tab_blob"></div>

    </div>

    <div class='dashboard_options_tab'> 

        <?php 
if ($can_edit) {
    ?>
        <img id='op_edition' class='db_img_opt' src='pixmaps/edit.png' title="<?php 
    echo $show_edit ? _('Switch to View Mode') : _('Switch to Edit Mode');
    ?>
"/>
        <?php 
}
if (Session::am_i_admin() || $pro && Acl::am_i_proadmin()) {
    ?>
        <img id='op_permissions' class='db_img_opt'src='pixmaps/permissions.png' title="<?php 
    echo _('Permissions');
    ?>
"/>
        <?php 
}
?>
        <img id='op_fullscreen' class='db_img_opt' src='pixmaps/full-screen.png' title="<?php 
echo _('Full Screen');
?>
"/>

    </div>
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:30,代码来源:tabs.php

示例10: list_results


//.........这里部分代码省略.........
            $data['vHigh'] = 0;
            $data['vMed'] = 0;
            $data['vLow'] = 0;
            $data['vInfo'] = 0;
            // query for reports for each IP
            $query_risk = "SELECT distinct risk, port, protocol, app, scriptid, msg, hostIP FROM vuln_nessus_latest_results WHERE hostIP = '" . $data['hostIP'];
            $query_risk .= "' AND username = '" . $data['username'] . "' AND sid =" . $data['sid'] . " AND ctx = UNHEX('" . $data['ctx'] . "') AND falsepositive='N'";
            $result_risk = $dbconn->Execute($query_risk);
            while (!$result_risk->EOF) {
                if ($result_risk->fields["risk"] == 7) {
                    $data['vInfo']++;
                } else {
                    if ($result_risk->fields["risk"] == 6) {
                        $data['vLow']++;
                    } else {
                        if ($result_risk->fields["risk"] == 3) {
                            $data['vMed']++;
                        } else {
                            if ($result_risk->fields["risk"] == 2) {
                                $data['vHigh']++;
                            } else {
                                if ($result_risk->fields["risk"] == 1) {
                                    $data['vSerious']++;
                                }
                            }
                        }
                    }
                }
                $result_risk->MoveNext();
            }
            $data['plink'] = "lr_respdf.php?treport=latest&ipl=" . urlencode($data['hostIP']) . "&ctx=" . $data['ctx'] . "&scantype=" . $data['scantype'];
            $data['hlink'] = "lr_reshtml.php?treport=latest&ipl=" . urlencode($data['hostIP']) . "&ctx=" . $data['ctx'] . "&scantype=" . $data['scantype'];
            $data['xlink'] = "lr_rescsv.php?treport=latest&ipl=" . urlencode($data['hostIP']) . "&ctx=" . $data['ctx'] . "&scantype=" . $data['scantype'];
            if (Session::am_i_admin()) {
                $data['dlink'] = "index.php?delete=" . $data['report_key'] . "&scantime=" . $data['scantime'];
            }
            $list = explode("\n", trim($data['meth_target']));
            if (count($list) == 1) {
                $list[0] = trim($list[0]);
                $data['target'] = resolve_asset($dbconn, $list[0]);
            } elseif (count($list) == 2) {
                $list[0] = trim($list[0]);
                $list[0] = resolve_asset($dbconn, $list[0]);
                $list[1] = trim($list[1]);
                $list[1] = resolve_asset($dbconn, $list[1]);
                $data['target'] = $list[0] . ' ' . $list[1];
            } else {
                $list[0] = trim($list[0]);
                $list[0] = resolve_asset($dbconn, $list[0]);
                $list[count($list) - 1] = trim($list[count($list) - 1]);
                $list[count($list) - 1] = resolve_asset($dbconn, $list[count($list) - 1]);
                $data['target'] = $list[0] . " ... " . $list[count($list) - 1];
            }
            $tdata[] = $data;
        }
        if ($sortdir == "ASC") {
            $sortdir = "DESC";
        } else {
            $sortdir = "ASC";
        }
        $url = $_SERVER['SCRIPT_NAME'] . "?offset={$offset}&sortby=%var%&sortdir={$sortdir}" . $url_filter;
        $fieldMapLinks = array();
        $fieldMapLinks = array(gettext("HTML Results") => array('url' => '%param%', 'param' => 'hlink', 'target' => 'main', 'icon' => 'images/html.png'), gettext("PDF Results") => array('url' => '%param%', 'param' => 'plink', 'target' => '_blank', 'icon' => 'images/pdf.png'), gettext("EXCEL Results") => array('url' => '%param%', 'param' => 'xlink', 'target' => '_blank', 'icon' => 'images/page_white_excel.png'));
        if (Session::am_i_admin()) {
            $fieldMapLinks["DELETE Results"] = array('url' => '%param%', 'param' => 'dlink', 'target' => 'main', 'icon' => 'images/delete.gif');
        }
开发者ID:jackpf,项目名称:ossim-arc,代码行数:67,代码来源:index.php

示例11: _

        ?>
</option>
	   <?php 
    }
    ?>
	   </select>
	   </td></tr>
	   <tr><td class="nobborder">
	   <select name="entity">
	   <option value="">- <?php 
    echo _("All Entities");
    ?>
 -</option>
	   <?php 
    foreach ($entities_all as $entity) {
        if (Session::am_i_admin() || Acl::am_i_proadmin() && in_array($entity["id"], $entities_list)) {
            ?>
            <option value="<?php 
            echo $entity["id"];
            ?>
"><?php 
            echo $entity["name"];
            ?>
</option>
        <?php 
        }
    }
    ?>
	   </select>
	   </td></tr>
	   <?php 
开发者ID:jhbsz,项目名称:ossimTest,代码行数:31,代码来源:index.php

示例12: GET

$scan_name = GET("scan_name");
$sensor_name = GET("sensor_name");
ossim_valid($scan_name, OSS_SCORE, OSS_NULLABLE, OSS_ALPHA, OSS_DOT, 'illegal:' . _("Scan name"));
ossim_valid($sensor_name, OSS_NULLABLE, OSS_ALPHA, OSS_SPACE, OSS_PUNC, 'illegal:' . _("Sensor name"));
if (ossim_error()) {
    die(ossim_error());
}
$db = new ossim_db();
$dbconn = $db->connect();
$scan_info = explode("_", $scan_name);
$users = Session::get_users_to_assign($dbconn);
$my_users = array();
foreach ($users as $k => $v) {
    $my_users[$v->get_login()] = 1;
}
if ($my_users[$scan_info[1]] != 1 && !Session::am_i_admin()) {
    return;
}
$scan = new TrafficScan();
$file = $scan->get_pcap_file($scan_name, $sesor_name);
if (file_exists($file)) {
    header('Cache-Control: cache, must-revalidate');
    header('Pragma: no-cache');
    // no-cache, public
    header('Expires: Sat, 26 Jul 1997 05:00:00 GMT');
    // Date in the past
    header('Content-Description: File Transfer');
    header('Content-Type: application/binary');
    header('Content-Length: ' . filesize($file));
    header('Content-Disposition: inline; filename=' . $scan_name);
    readfile($file);
开发者ID:jhbsz,项目名称:ossimTest,代码行数:31,代码来源:download.php

示例13: _

            $conf = $GLOBALS['CONF'];
            $pass_length_min = $conf->get_conf('pass_length_min') ? $conf->get_conf('pass_length_min') : 7;
            $pass_length_max = $conf->get_conf('pass_length_max') ? $conf->get_conf('pass_length_max') : 255;
            $pass_length_max = $pass_length_max < $pass_length_min || $pass_length_max < 1 ? 255 : $pass_length_max;
            $pass_expire_min = $conf->get_conf('pass_expire_min') ? $conf->get_conf('pass_expire_min') : 0;
            if (0 != strcmp($pass1, $pass2)) {
                $validation_errors['pass'] = _('Authentication failure') . '. ' . _('Passwords mismatch');
            } elseif (strlen($pass1) < $pass_length_min) {
                $validation_errors['pass'] = _('Password is not long enough') . ' [' . _('Minimum password size is') . ' ' . $pass_length_min . ']';
            } elseif (strlen($pass1) > $pass_length_max) {
                $validation_errors['pass'] = _('Password is long enough') . ' [' . _('Maximum password size is') . ' ' . $pass_length_max . ']';
            } elseif (!Session::pass_check_complexity($pass1)) {
                $validation_errors['pass'] = _('Password is not strong enough. Check the password policy configuration for more details');
            } elseif ($mode == 'update') {
                $recent_pass = Log_action::get_last_pass($conn, $login);
                if ($pass_expire_min > 0 && dateDiff_min($last_pass_change, date('Y-m-d H:i:s')) < $pass_expire_min && !Session::am_i_admin()) {
                    $validation_errors['pass'] = _('Password lifetime is too short to allow change. Wait a few minutes...');
                } elseif (count($recent_pass) > 0 && (in_array(md5($pass1), $recent_pass) || in_array(hash('sha256', $pass1), $recent_pass))) {
                    $validation_errors['pass'] = _('This password is recently used. Try another');
                }
            }
        }
    }
}
//Checking entities field requirements
if (empty($validation_errors['entities[]'])) {
    //Check allowed entities
    if ($pro && !$is_my_profile) {
        foreach ($entities as $ent_id) {
            if (!Acl::entityAllowed($ent_id)) {
                $validation_errors['entities[]'] = _("You don't have permission to create users at this level");
开发者ID:alienfault,项目名称:ossim,代码行数:31,代码来源:users_edit.php

示例14: _

        						<td class='right'>
        							<input type="button" class="av_b_secondary small" value="<?php 
    echo _('Add New');
    ?>
" onclick="javascript:add_frw_server();return false;"/>
        						</td>
        					</tr>
        				</table>
        			</td>
        		</tr>
        		<?php 
}
?>
    		
    		<?php 
if ($mssp && !empty($id) && !$opensource && (Session::am_i_admin() || Acl::am_i_proadmin())) {
    $tooltip = "<ul class='tip'>\n    \t\t\t\t\t\t\t<li>" . _('Right-click on engine nodes to change its name') . "</li>\n    \t\t\t\t\t\t\t<li>" . _('Drag and drop contexts between engines') . "</li>\n    \t\t\t\t\t\t</ul>";
    ?>
        		<tr id='engine_notification'>			
        			<td colspan=2 class="noborder">
        				<div></div>
        			</td>
        		</tr>
        		<tr id='engines_server' >
        			<th style="text-decoration:underline">
        				<label for='eng_name'><?php 
    echo _('Correlation Options');
    ?>
</label>
        				<a href='javascript:;' class='tiptip' title="<?php 
    echo $tooltip;
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:31,代码来源:newserverform.php

示例15: array

$d_c_from = $filters[1]->get_from();
$d_c_to = $filters[1]->get_to();
//Vulnerabilities
$flag_vulns = $filters[5]->is_active();
$vulns_from = $flag_vulns ? $filters[5]->get_to() : 7;
$vulns_to = $flag_vulns ? $filters[5]->get_from() : 1;
//Asset Value
$flag_av = $filters[6]->is_active();
$av_from = $flag_av ? $filters[6]->get_from() : 0;
$av_to = $flag_av ? $filters[6]->get_to() : 5;
// Getting Filter Legends
$f_legend = Filter_list::get_filter_legends();
// Getting Permissions:
$perm_add = Session::can_i_create_assets();
// Getting Permissions:
$perms = array('admin' => Session::am_i_admin(), 'create' => $perm_add, 'delete' => $perm_add, 'vulnerabilities' => Session::logcheck_bool('environment-menu', 'EventsVulnerabilitiesScan'), 'alarms' => Session::logcheck_bool('analysis-menu', 'ControlPanelAlarms'), 'events' => Session::logcheck_bool('analysis-menu', 'EventsForensics'), 'availability' => Session::logcheck_bool('environment-menu', 'MonitorsAvailability'), 'deploy_agents' => Session::logcheck_bool('environment-menu', 'EventsHidsConfig'), 'nmap' => Session::logcheck_bool('environment-menu', 'ToolsScan'));
switch ($notif) {
    case 'delete':
        $msg = _('Network has been permanently deleted.');
        show_notif($msg, 'nf_success');
        break;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <title><?php 
echo _('AlienVault ' . (Session::is_pro() ? 'USM' : 'OSSIM'));
?>
</title>
    <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"/>
开发者ID:jackpf,项目名称:ossim-arc,代码行数:31,代码来源:list.php


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