本文整理汇总了PHP中Session::get_session_user方法的典型用法代码示例。如果您正苦于以下问题:PHP Session::get_session_user方法的具体用法?PHP Session::get_session_user怎么用?PHP Session::get_session_user使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Session
的用法示例。
在下文中一共展示了Session::get_session_user方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add_note
function add_note($conn, $type)
{
$validate = array('asset_id' => array('validation' => 'OSS_HEX', 'e_message' => 'illegal:' . _('Asset ID')), 'txt' => array('validation' => 'OSS_TEXT, OSS_PUNC_EXT', 'e_message' => 'illegal:' . _('Note text')));
$validation_errors = validate_form_fields('POST', $validate);
if (is_array($validation_errors) && !empty($validation_errors)) {
Av_exception::throw_error(Av_exception::USER_ERROR, _('Error! Note could not be added'));
}
$asset_id = POST('asset_id');
$txt = POST('txt');
// Check Asset Type
$asset_types = array('asset' => 'asset_host', 'network' => 'asset_net', 'group' => 'asset_group', 'net_group' => 'net_group');
// Note type
$type_tr = array('group' => 'host_group', 'network' => 'net', 'asset' => 'host', 'net_group' => 'net_group');
$class_name = $asset_types[$type];
$asset_type = $type_tr[$type];
// Check Asset Permission
if (method_exists($class_name, 'is_allowed') && !$class_name::is_allowed($conn, $asset_id)) {
$error = sprintf(_('Error! %s is not allowed'), ucwords($type));
Av_exception::throw_error(Av_exception::USER_ERROR, $error);
}
$note_id = Notes::insert($conn, $asset_type, gmdate('Y-m-d H:i:s'), $asset_id, $txt);
if (intval($note_id) > 0) {
$tz = Util::get_timezone();
$data['msg'] = _('Note added successfully');
$data['id'] = $note_id;
$data['note'] = $txt;
$data['date'] = gmdate('Y-m-d H:i:s', Util::get_utc_unixtime(gmdate('Y-m-d H:i:s')) + 3600 * $tz);
$data['user'] = Session::get_session_user();
$data['editable'] = 1;
} else {
Av_exception::throw_error(Av_exception::USER_ERROR, _('Error! Note could not be added'));
}
return $data;
}
示例2: load_layout
function load_layout($name_layout, $category = 'policy')
{
$db = new ossim_db();
$conn = $db->connect();
$config = new User_config($conn);
$login = Session::get_session_user();
$data = $config->get($login, $name_layout, 'php', $category);
return $data == null ? array() : $data;
}
示例3: reorder_widgets
function reorder_widgets($dbconn, $tab)
{
$user = Session::get_session_user();
ossim_valid($tab, OSS_DIGIT, 'illegal:' . _("Tab ID"));
if (ossim_error()) {
die(ossim_error());
}
$query = "UPDATE dashboard_widget_config set fil = (fil + 1) WHERE panel_id=? and user=? and col=0";
$params = array($tab, $user);
if (!$dbconn->Execute($query, $params)) {
print $dbconn->ErrorMsg();
return TRUE;
} else {
return FALSE;
}
}
示例4: check_report_availability
function check_report_availability($user_perm, $entity_perm, $creator, $wizard_perms)
{
$me = Session::get_session_user();
if (Session::am_i_admin() || $me == $creator || $wizard_perms['user_perms'][$creator] > 1) {
return TRUE;
} else {
if ($user_perm >= 0) {
if ($user_perm == "0" || $wizard_perms['user_perms'][$user_perm] > 1) {
return TRUE;
}
} elseif ($entity_perm > 0) {
if ($wizard_perms['entity_perms'][$entity_perm] >= 1) {
return TRUE;
}
}
}
return FALSE;
}
示例5: getSourceLocalSSIYear
function getSourceLocalSSIYear($conn, $date_from, $date_to)
{
$where_range = whereYM($date_from, $date_to);
$user = Session::get_session_user();
$sql = "SELECT source, count(*) as volume from datawarehouse.ssi_user WHERE ssi_user.user = ? AND {$where_range} Group BY source;";
//print_r($sql);
$result = array();
$rs = $conn->Execute($sql, array($user));
if (!$rs) {
Av_exception::write_log(Av_exception::DB_ERROR, $conn->ErrorMsg());
return $result;
}
while (!$rs->EOF) {
$result[] = $rs->fields;
$rs->MoveNext();
}
return $result;
}
示例6: 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;
}
示例7: get_report_uuid
function get_report_uuid()
{
require_once 'classes/Session.inc';
$uuid = Session::get_secure_id();
$url = null;
if (empty($uuid)) {
$db = new ossim_db();
$dbconn = $db->connect();
$user = Session::get_session_user();
$query = 'SELECT * FROM `users` WHERE login="' . $user . '"';
$result = $dbconn->Execute($query);
if (is_array($result->fields) && !empty($result->fields)) {
$pass = $result->fields["pass"];
$uuid = sha1($user . "#" . $pass);
} else {
$uuid = false;
}
}
return $uuid;
}
示例8: gettabsavt
function gettabsavt($configs_dir, $cloud_instance = false)
{
$user = Session::get_session_user();
$tabsavt = array();
if (is_dir($configs_dir)) {
if ($dh = opendir($configs_dir)) {
while (($file = readdir($dh)) !== false) {
if (preg_match("/^{$user}.*\\.avt/", $file)) {
list($avt_id, $avt_values) = getavt($file, $configs_dir);
if (!$cloud_instance || $cloud_instance && $avt_id != 1004) {
// if cloud disable Compliance Tab
$tabsavt[$avt_id] = $avt_values;
}
}
}
closedir($dh);
}
}
return $tabsavt;
}
示例9: 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();
}
}
示例10: ossim_set_lang
//Regional settings
require_once 'classes/locale.inc';
//Set language
ossim_set_lang();
//Sessions (users, activity, permissions, etc)
require_once 'classes/session.inc';
//Security functions
require_once 'classes/Security.inc';
//Check IDS Security
ids();
//Check session status
//No check in these cases (Scheduled reports and migration)
if (!preg_match('/AV Report Scheduler/', $_SERVER['HTTP_USER_AGENT']) && !preg_match('/migration/', $_SERVER['REQUEST_URI'])) {
Session::is_expired();
}
if (Session::get_session_user() != '') {
//Set menu options
$m_opt = REQUEST('m_opt');
$sm_opt = REQUEST('sm_opt');
$h_opt = REQUEST('h_opt');
$l_opt = REQUEST('l_opt');
ossim_valid($m_opt, OSS_LETTER, OSS_DIGIT, OSS_SCORE, OSS_NULLABLE, 'illegal:' . _('Menu option'));
ossim_valid($sm_opt, OSS_LETTER, OSS_DIGIT, OSS_SCORE, OSS_NULLABLE, 'illegal:' . _('Submenu option'));
ossim_valid($h_opt, OSS_LETTER, OSS_DIGIT, OSS_SCORE, OSS_NULLABLE, 'illegal:' . _('Hmenu option'));
ossim_valid($l_opt, OSS_LETTER, OSS_DIGIT, OSS_SCORE, OSS_NULLABLE, 'illegal:' . _('Lmenu option'));
//Chenck menu options
if (ossim_error()) {
header('Location: ' . AV_MAIN_PATH . '/session/login.php?action=logout');
}
$av_menu = @unserialize($_SESSION['av_menu']);
//Check menu object
示例11: is_allowed_format
*/
require_once 'av_init.php';
Session::logcheck('environment-menu', 'PolicyHosts');
function is_allowed_format($type_uf)
{
$types = '/force-download|octet-stream|text|csv|plain|spreadsheet|excel|comma-separated-values/';
if (preg_match($types, $type_uf) == FALSE) {
return FALSE;
} else {
return TRUE;
}
}
$import_type = POST('import_type');
$ctx = POST('ctx');
$path = '../tmp/';
$current_user = md5(Session::get_session_user());
$file_csv = $path . $current_user . '_assets_import.csv';
if ($import_type != 'hosts' && $import_type != 'welcome_wizard_hosts') {
?>
<script type='text/javascript'>
parent.show_error('<?php
echo _('Error! Import Type not found');
?>
');
</script>
<?php
exit;
}
if (!isset($_POST['ctx']) || empty($_POST['ctx'])) {
?>
<script type='text/javascript'>
示例12: array
if ($munin_link == '') {
$munin_link = "/munin/";
}
$server_ip = Util::get_default_admin_ip();
if ($server_ip == '') {
$server_ip = $ossim_conf->get_conf('frameworkd_address');
}
$protocol = 'http';
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
$protocol = 'https';
}
$port = "";
if (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] != "80" && $_SERVER['SERVER_PORT'] != '443') {
$port = ":" . $_SERVER['SERVER_PORT'];
}
$current_user = Session::get_session_user();
if ($ip == $server_ip) {
$munin_url = $protocol . '://' . $_SERVER['SERVER_NAME'] . $port . $munin_link;
$munin_url = str_replace('localhost', $ip, $munin_url);
$testmunin = $protocol . '://' . $ip . '/munin/';
} else {
$munin_url = $protocol . '://' . $ip . $port . $munin_link;
$testmunin = $munin_url;
}
// check valid munin url
$default_opts = array('http' => array('header' => "Cookie: PHPSESSID=" . $_COOKIE["PHPSESSID"]));
$resource = stream_context_get_default($default_opts);
$data = @file($testmunin, FILE_SKIP_EMPTY_LINES, $resource);
$munin_valid = TRUE;
if (is_array($data)) {
foreach ($data as $line) {
示例13: edit_autoenable
function edit_autoenable($sid)
{
global $dbconn, $username, $version;
navbar($sid);
$query = "select id, name, description, autoenable, type, owner, update_host_tracker\n FROM vuln_nessus_settings where id={$sid}";
$dbconn->SetFetchMode(ADODB_FETCH_BOTH);
$result = $dbconn->execute($query);
echo <<<EOT
<form method="post" action="settings.php" id="profile_config">
<input type="hidden" name="type" value="update">
<input type="hidden" name="sid" value="{$sid}">
EOT;
list($sid, $sname, $sdescription, $sautoenable, $stype, $sowner, $tracker) = $result->fields;
$sname = mb_convert_encoding($sname, 'ISO-8859-1', 'UTF-8');
//if($stype=='G') { $stc = "checked"; } else { $stc = ""; }
if (valid_hex32($sowner)) {
$user_entity = $sowner;
} else {
$user = $sowner;
}
$old_user = $sowner;
if ($tracker == '1') {
$cktracker = "checked";
} else {
$cktracker = "";
}
echo <<<EOT
<input type="hidden" name="old_owner" value="{$old_user}">
<input type="hidden" name="old_name" value="{$sname}">
<center>
<table cellspacing="2" cellpadding="4">
<tr>
EOT;
echo "<th>" . _("Name") . ":</th>";
echo '
<td><input type="text" name="sname" value="' . $sname . '" size=50/>
</tr>
<tr>
';
echo "<th>" . _("Description") . ":</th>";
echo '
<td><input type="text" name="sdescription" value="' . $sdescription . '" size=50/></td>
</tr>';
$users = Session::get_users_to_assign($dbconn);
$entities = Session::am_i_admin() || $pro && Acl::am_i_proadmin() ? Session::get_entities_to_assign($dbconn) : null;
?>
<tr>
<th><?php
echo _("Make this profile available for");
?>
:</th>
<td>
<table cellspacing="0" cellpadding="0" align='center' class="transparent">
<tr>
<td class='nobborder'><span style='margin-right:3px'><?php
echo _("User:");
?>
</span></td>
<td class='nobborder'>
<select name="user" style="width:150px" id="user" onchange="switch_user('user');return false;" >
<?php
$num_users = 0;
$current_user = Session::get_session_user();
if (!Session::am_i_admin()) {
$user = $user == "" && $entity == "" ? $current_user : $user;
}
foreach ($users as $k => $v) {
$login = $v->get_login();
$selected = $login == $user ? "selected='selected'" : "";
$options .= "<option value='" . $login . "' {$selected}>{$login}</option>\n";
$num_users++;
}
if ($num_users == 0) {
echo "<option value='-1' style='text-align:center !important;'>- " . _("No users found") . " -</option>";
} else {
echo "<option value='-1' style='text-align:center !important;'>- " . _("Select users") . " -</option>";
if (Session::am_i_admin()) {
$default_selected = ($user == "" || intval($user) == 0) && $entity == "" ? "selected='selected'" : "";
echo "<option value='0' {$default_selected}>" . _("ALL") . "</option>\n";
}
echo $options;
}
?>
</select>
</td>
<?php
if (!empty($entities)) {
?>
<td style='text-align:center; border:none; !important'><span style='padding:5px;'><?php
echo _("OR");
?>
<span></td>
<td class='nobborder'><span style='margin-right:3px'><?php
echo _("Entity:");
?>
</span></td>
<td class='nobborder'>
//.........这里部分代码省略.........
示例14: UserAuth
/* Deklarasi class UserAuth
* Class Name : UserAuth
* Location :root_path/function/userAuth/user_func.php
* Warning !!! Jangan buat nama variabel sama dengan nama variabel ini
*/
$USERAUTH = new UserAuth();
$SESSION = new Session();
/* Ambil session user */
$UserSession = $SESSION->get_session_user();
if (isset($_POST['login']))
{
$dataVar = array ('username'=>$_POST['username'], 'password'=>md5($_POST['password']), 'token' => 0);
$dataValid = $DBVAR->form_validation($dataVar);
if (is_array($dataValid))
{
$dataLogin = $USERAUTH->check_login_user($dataValid);
if ($dataLogin == true)
{
//header ("location:$url_rewrite");
echo "<script>window.location.href='$url_rewrite';</script>script>";
}
示例15: UserAuth
<?php
include "../../../config/config.php";
$USERAUTH = new UserAuth();
$SESSION = new Session();
$menu_id = 28;
$SessionUser = $SESSION->get_session_user();
$USERAUTH->FrontEnd_check_akses_menu($menu_id, $SessionUser);
?>
<?php ob_start(); ?>
<html>
<?php
include "$path/header.php";
include "$path/title.php";
?>
<body>
<?php
include "$path/menu.php";
open_connection();
echo '<pre>';
//print_r($_POST);
echo '</pre>';
echo '<pre>';
//print_r($dataArr);
echo '</pre>';