本文整理汇总了PHP中Session::is_pro方法的典型用法代码示例。如果您正苦于以下问题:PHP Session::is_pro方法的具体用法?PHP Session::is_pro怎么用?PHP Session::is_pro使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Session
的用法示例。
在下文中一共展示了Session::is_pro方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_targets
$select_targets = get_targets($conn, $database['meth_TARGET']);
} else {
if ($action == 'delete_scan') {
$query = 'SELECT username, name, id, scan_SERVER, report_id, status FROM vuln_jobs WHERE id=?';
$params = array($job_id);
$result = $conn->execute($query, $params);
$username = $result->fields['username'];
$job_name = $result->fields['name'];
$kill_id = $result->fields['id'];
$nserver_id = $result->fields['scan_SERVER'];
$report_id = $result->fields['report_id'];
$can_i_delete = FALSE;
if (Session::am_i_admin() || Session::get_session_user() == $username) {
$can_i_delete = TRUE;
} else {
if (Session::is_pro() && Acl::am_i_proadmin()) {
$user_vision = !isset($_SESSION['_user_vision']) ? Acl::get_user_vision($conn) : $_SESSION['_user_vision'];
$my_entities_admin = array_keys($user_vision['entity_admin']);
if (in_array($username, $my_entities_admin)) {
$can_i_delete = TRUE;
}
}
}
if ($can_i_delete) {
$query = 'DELETE FROM vuln_jobs WHERE id=?';
$params = array($kill_id);
$result = $conn->execute($query, $params);
$query = 'DELETE FROM vuln_nessus_reports WHERE report_id=?';
$params = array($report_id);
$result = $conn->execute($query, $params);
$query = 'DELETE FROM vuln_nessus_report_stats WHERE report_id=?';
示例2: _
</div>
<div id='otx_config_section' class='section otx_admin'>
<div id='otx_loading'>
<img src='<?php
echo AV_PIXMAPS_DIR;
?>
/loading.gif'/>
</div>
<div id='token_text' data-otx='text-token'>
<?php
$msg = _('Connect your OTX account to %s by adding your OTX key in the space below. If you do not have an OTX key, <a href="javascript:;" data-otx="get-token">sign up</a> for an OTX account now!');
echo sprintf($msg, Session::is_pro() ? 'USM' : 'OSSIM');
?>
</div>
<div class='col_60'>
<div class='field'>
<label class='field_label col_25'><?php
echo _('OTX Key:');
?>
</label>
<div class='field_edit col_75' data-otx="token"></div>
</div>
<div class='field'>
<label class='field_label col_25'><?php
示例3: import_assets_from_csv
function import_assets_from_csv($filename, $iic, $ctx, $import_type)
{
//Process status
$summary = array('general' => array('status' => '', 'data' => '', 'statistics' => array('total' => 0, 'warnings' => 0, 'errors' => 0, 'saved' => 0)), 'by_nets' => array());
$db = new ossim_db();
$conn = $db->connect();
$str_data = file_get_contents($filename);
if ($str_data === FALSE) {
$summary['general']['status'] = 'error';
$summary['general']['data']['errors'] = _('Failed to read data from CSV file');
$summary['general']['statistics']['errors'] = 1;
return $summary;
}
$array_data = preg_split('/\\n|\\r/', $str_data);
foreach ($array_data as $k => $v) {
if (trim($v) != '') {
$data[] = explode('";"', trim($v));
}
}
set_time_limit(360);
/*********************************************************************************************************************
* From net section:
* - Version 4.x.x: "Netname"*;"CIDRs(CIDR1,CIDR2,...)"*;"Description";"Asset value"*;"Net ID"
* - Version 3.x.x: "Netname"*;"CIDRs(CIDR1,CIDR2,...)"*;"Description";"Asset value";"Sensors(Sensor1,Sensor2,...)"*
*
* From welcome wizard:
* - Version 4.x.x: "Netname"*;"CIDRs(CIDR1,CIDR2,...)"*;"Description"
*
*********************************************************************************************************************/
//Check file size
if (count($data) <= 0 || count($data) == 1 && preg_match('/Netname/', $data[0][0])) {
$summary['general']['status'] = 'error';
$summary['general']['data'] = _('CSV file is empty');
$summary['general']['statistics']['errors'] = 1;
return $summary;
}
//Check importation type and headers
$csv_headers = array();
if ($import_type == 'networks') {
if (preg_match('/Net ID/', $data[0][4]) || preg_match('/Sensors/', $data[0][4])) {
$csv_headers = array_shift($data);
} else {
$summary['general']['status'] = 'error';
$summary['general']['data'] = _('Headers not found');
$summary['general']['statistics']['errors'] = 1;
return $summary;
}
}
//Setting total nets to import
$summary['general']['statistics']['total'] = count($data);
//Allowed sensors
$filters = array('where' => "acl_sensors.entity_id = UNHEX('{$ctx}')");
$a_sensors = Av_sensor::get_basic_list($conn, $filters);
$sensor_ids = array_keys($a_sensors);
if (count($sensor_ids) == 0) {
$summary['general']['status'] = 'error';
$s_error_msg = Session::is_pro() ? _('There is no sensor for this context') : _('There is no sensor for this net');
$summary['general']['data'] = $s_error_msg;
$summary['general']['statistics']['errors'] = 1;
return $summary;
}
Util::disable_perm_triggers($conn, TRUE);
foreach ($data as $k => $v) {
//Clean previous errors
ossim_clean_error();
$num_line = $k + 1;
//Set default status
$summary['by_nets'][$num_line]['status'] = 'error';
//Check file format
$cnd_1 = $import_type == 'networks' && count($v) < 5;
$cnd_2 = $import_type == 'welcome_wizard_nets' && count($v) < 3;
if ($cnd_1 || $cnd_2) {
$summary['by_nets'][$num_line]['errors']['Format'] = _('Number of fields is incorrect');
$summary['general']['statistics']['errors']++;
continue;
}
//Clean values
$param = array();
foreach ($v as $field) {
$parameter = trim($field);
$pattern = '/^\\"|\\"$|^\'|\'$/';
$param[] = preg_replace($pattern, '', $parameter);
}
//Values
$is_in_db = FALSE;
$net_id = '';
$name = $param[0];
$cidrs = preg_replace("/[\n\r\t]+/", '', $param[1]);
$descr = $param[2];
$asset_value = $param[3] == '' ? 2 : intval($param[3]);
$sensors = $sensor_ids;
//Permissions
$can_i_create_assets = Session::can_i_create_assets();
$can_i_modify_ips = TRUE;
//CIDRs
if (!ossim_valid($cidrs, OSS_IP_CIDR, 'illegal:' . _('CIDR'))) {
$summary['by_nets'][$num_line]['errors']['CIDRs'] = ossim_get_error_clean();
$summary['general']['statistics']['errors']++;
continue;
}
//.........这里部分代码省略.........
示例4: gettext
*
* You should have received a copy of the GNU General Public License
* along with this package; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
* MA 02110-1301 USA
*
*
* On Debian GNU/Linux systems, the complete text of the GNU General
* Public License can be found in `/usr/share/common-licenses/GPL-2'.
*
* Otherwise you can read it here: http://www.gnu.org/licenses/gpl-2.0.txt
*
*/
require_once 'av_init.php';
Session::logcheck('analysis-menu', 'EventsForensics');
if (!Session::is_pro()) {
Session::unallowed_section(NULL, 'noback');
}
// load column layout
require_once '../conf/layout.php';
$category = "policy";
$name_layout = "databases_layout";
$layout = load_layout($name_layout, $category);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> <?php
echo gettext("OSSIM Framework");
?>
</title>
示例5: server_get_sensor_plugins
function server_get_sensor_plugins($sensor_ip = "")
{
$ossim_conf = $GLOBALS['CONF'];
if (!$ossim_conf) {
$ossim_conf = new Ossim_conf();
$GLOBALS['CONF'] = $ossim_conf;
}
/* get the port and IP address of the server */
$address = $ossim_conf->get_conf('server_address');
$port = $ossim_conf->get_conf('server_port');
/* create socket */
$socket = socket_create(AF_INET, SOCK_STREAM, 0);
if ($socket < 0) {
echo _("socket_create() failed: reason: ") . socket_strerror($socket) . "\n";
}
$list = array();
/* connect */
socket_set_block($socket);
socket_set_option($socket, SOL_SOCKET, SO_RCVTIMEO, array('sec' => 5, 'usec' => 0));
socket_set_option($socket, SOL_SOCKET, SO_SNDTIMEO, array('sec' => 5, 'usec' => 0));
$result = @socket_connect($socket, $address, $port);
if (!$result) {
echo sprintf(_("Unable to connect to %s server. Please, wait until it's available again or check if it's running at %s"), Session::is_pro() ? "USM" : "OSSIM", "{$address}:{$port}");
return $list;
}
/* first send a connect message to server */
$in = 'connect id="1" type="web"' . "\n";
$out = '';
socket_write($socket, $in, strlen($in));
$out = @socket_read($socket, 2048, PHP_BINARY_READ);
if (strncmp($out, "ok id=", 4)) {
echo sprintf(_("Bad response from %s server. Please, wait until it's available again or check if it's running at %s"), Session::is_pro() ? "USM" : "OSSIM", "{$address}:{$port}");
return $list;
}
/* get sensor plugins from server */
$in = 'server-get-sensor-plugins id="2"' . "\n";
$out = '';
socket_write($socket, $in, strlen($in));
$pattern = '/sensor="(' . str_replace(".", "\\.", $sensor_ip) . ')" plugin_id="([^"]*)" ' . 'state="([^"]*)" enabled="([^"]*)"/';
while ($output = socket_read($socket, 2048, PHP_BINARY_READ)) {
$lines = explode("\n", $output);
foreach ($lines as $out) {
if (preg_match($pattern, $out, $regs)) {
$s['sensor'] = $regs[1];
$s['plugin_id'] = $regs[2];
$s['state'] = $regs[3];
$s['enabled'] = $regs[4];
if (!in_array($s, $list)) {
$list[] = $s;
}
} elseif (!strncmp($out, "ok id=", 4)) {
break;
}
}
}
socket_close($socket);
return $list;
}
示例6: _
');
</script>
<?php
exit;
}
if (!isset($_POST['ctx']) || empty($_POST['ctx'])) {
?>
<script type='text/javascript'>
parent.show_error('<?php
echo _('You must select an entity');
?>
');
</script>
<?php
}
if (Session::is_pro()) {
if (!valid_hex32($ctx) || Acl::entityAllowed($ctx) < 1) {
$msg_error = empty($ctx) ? _('You must select an entity') : _('Entity not allowed');
?>
<script type='text/javascript'>
parent.show_error('<?php
echo $msg_error;
?>
');
</script>
<?php
exit;
}
} else {
$ctx = Session::get_default_ctx();
示例7: _
*
*
* On Debian GNU/Linux systems, the complete text of the GNU General
* Public License can be found in `/usr/share/common-licenses/GPL-2'.
*
* Otherwise you can read it here: http://www.gnu.org/licenses/gpl-2.0.txt
*
*/
require_once 'av_init.php';
Session::useractive();
?>
<!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>
<link rel="Shortcut Icon" type="image/x-icon" href="/ossim/favicon.ico">
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"/>
<meta http-equiv="Pragma" content="no-cache"/>
<?php
//CSS Files
$_files = array(array('src' => 'av_common.css?only_common=1', 'def_path' => TRUE), array('src' => '/wizard/wizard.css', 'def_path' => TRUE));
Util::print_include_files($_files, 'css');
//JS Files
$_files = array(array('src' => 'jquery.min.js', 'def_path' => TRUE));
Util::print_include_files($_files, 'js');
?>
示例8: PrintPredefinedViews
function PrintPredefinedViews()
{
global $opensource;
$current_str = $_SESSION['current_cview'] != "default" && $_SESSION['current_cview'] != "" ? Util::htmlentities($_SESSION['current_cview']) : _("Default");
// Get default view
require_once "ossim_conf.inc";
$conf = $GLOBALS["CONF"];
$idm_enabled = $conf->get_conf("enable_idm") == 1 && Session::is_pro() ? true : false;
$login = Session::get_session_user();
$db_aux = new ossim_db(true);
$conn_aux = $db_aux->connect();
$config = new User_config($conn_aux);
$default_view = $config->get($login, 'custom_view_default', 'php', "siem") != "" ? $config->get($login, 'custom_view_default', 'php', "siem") : ($idm_enabled ? 'IDM' : 'default');
$db_aux->close($conn_aux);
?>
<button id="views_link" class="button av_b_secondary">
<?php
echo _('Change View');
?>
▾
</button>
<div id="custom_views" class="dropdown dropdown-secondary dropdown-close dropdown-tip dropdown-anchor-right dropdown-scrolling" style='display:none'>
<ul id="custom_views_ul" class="dropdown-menu">
<?php
if (Session::am_i_admin()) {
?>
<li><a href="#" onclick="GB_show('<?php
echo _("Edit Current View");
?>
','/forensics/custom_view_edit.php?edit=1',480,700);$('#custom_views').hide();return false"><?php
echo _("Edit Current View");
?>
</a></li>
<li><a href="#" onclick="GB_show('<?php
echo _("Create new custom view");
?>
','/forensics/custom_view_edit.php',480,700);$('#custom_views').hide();return false"><?php
echo _("Create New View");
?>
</a></li>
<?php
}
foreach ($_SESSION['views'] as $name => $attr) {
$dname = $name == "default" ? "Default" : $name;
$selected = $_SESSION['current_cview'] == $name ? "► " : "";
?>
<li><a href="#" onclick="change_view('<?php
echo Util::htmlentities($name);
?>
');$('#custom_views').hide()"><?php
echo $selected . Util::htmlentities($dname);
?>
</a></li>
<?php
}
?>
</ul>
</div>
<?php
}
示例9: _
<div class='fbutton'><input type="button" value="<?php
echo _("Clean");
?>
" class="small" id="clean_button" onclick="document.location.href='index.php?engine_id=<?php
echo $engine_id;
?>
'"/></div>
<?php
}
?>
</form>
</td>
<?php
if (Session::is_pro() && count($available_engines = $directive_editor->get_available_engines()) > 1) {
?>
<td>
<table align="right" class="transparent">
<tr>
<td style="font-size:12px"><?php
echo _("Select Engine");
?>
:</td>
<td class="center nobborder" style="padding-left:5px">
<select name="engine_param" onchange="document.location.href='index.php?engine_id='+this.value" style="font-size:12px">
<?php
foreach ($available_engines as $e_id => $e_name) {
?>
<option value="<?php
echo $e_id;
示例10: _
<td colspan="3"></td>
</tr>
<tr>
<td colspan="3" align="center"><input type="button" value="<?php
echo _('Close');
?>
" onclick="parent.GB_close()"/></td>
</tr>
</table>
</body>
</html>
<?php
$directive_editor = new Directive_editor($engine_id);
$conf = $GLOBALS["CONF"];
if (Session::is_pro() && $conf->get_conf("alienvault_mssp", false) == "1" && count($available_engines = $directive_editor->get_available_engines()) > 1) {
$engines = $available_engines;
} else {
$engines = array(_MAIN_PATH . "/{$engine_id}" => "Default");
}
$errors = array();
foreach ($engines as $engine_dir => $engine_name) {
$engine_id = preg_replace("/.*\\/([a-f0-9\\-]+)/", "\\1", $engine_dir);
if (count($engines) > 1) {
echo "<script type='text/javascript'>\$('#msg').html('{$engine_name}');</script>";
}
$_errors = $directive_editor->test($engine_id);
foreach ($_errors as $error) {
$errors[] = $error;
}
}
示例11: calc_days_to_expire
/**
* Returns remaining days to trial expiration or FALSE
*
* @return bool|int
*/
function calc_days_to_expire()
{
$trial_days = FALSE;
if (Session::is_pro()) {
$days_to_expire = Session::trial_days_to_expire();
if ($days_to_expire <= 30) {
$trial_days = intval($days_to_expire) <= 0 ? 0 : intval($days_to_expire);
}
}
return $trial_days;
}
示例12: Exception
/*** This file is includen in step_loader.php hence the wizard object is defined in $wizard ***/
/*** database connection is stored in $conn ***/
/************************************************************************************************/
/************************************************************************************************/
if (!$wizard instanceof Welcome_wizard) {
throw new Exception("There was an error, the Welcome_wizard object doesn't exist");
}
$interfaces = array();
try {
$interfaces = Welcome_wizard::get_interfaces();
} catch (Exception $e) {
$config_nt = array('content' => $e->getMessage(), 'options' => array('type' => 'nf_error', 'cancel_button' => true), 'style' => 'margin:10px auto;width:50%;text-align:center;padding:0 10px;z-index:999');
$nt = new Notification('nt_notif', $config_nt);
$nt->show();
}
$v_short = Session::is_pro() ? "USM" : "OSSIM";
$text_descr = _("The network interfaces in AlienVault %s can be configured to run Network Monitoring or as Log Collection & Scanning. Once you've configured the interfaces you'll need to ensure that the networking is configured appropriately for each interface so that AlienVault %s is either receiving data passively or has the ability to reach out to the desired network.");
$text_descr = sprintf($text_descr, $v_short, $v_short);
?>
<script type='text/javascript'>
var __nic ,__n_role ,__n_ip, __n_mask = null;
var __nic_state = false;
function load_js_step()
{
load_handler_step_interfaces();
<?php
if (count($interfaces) > 0) {
示例13: sprintf
}
// Reset main indicator if no more policy reload need
if (!Web_indicator::is_on('Reload_policies') && !Web_indicator::is_on('Reload_sensors') && !Web_indicator::is_on('Reload_plugins') && !Web_indicator::is_on('Reload_directives') && !Web_indicator::is_on('Reload_servers')) {
Web_indicator::set_off('ReloadPolicy');
}
$error = sprintf(_("Unable to connect to %s server. Please, wait until it's available again or check if it's running at %s"), Session::is_pro() ? "USM" : "OSSIM", "{$address}:{$port}");
echo ossim_error($error);
exit;
}
if ($what != 'tasks') {
$in = 'reload-' . $what . ' id="2"' . "\n";
$out = '';
@socket_write($socket, $in, strlen($in));
$out = @socket_read($socket, 2048);
if (strncmp($out, 'ok id="2"', 9) != 0) {
$error = sprintf(_("Bad response from %s server. Please, wait until it's available again or check if it's running at %s"), Session::is_pro() ? "USM" : "OSSIM", "{$address}:{$port}");
echo ossim_error($error);
exit;
}
@socket_close($socket);
}
// Switch off web indicator
if ($what == 'all') {
Web_indicator::set_off('Reload_policies');
Web_indicator::set_off('Reload_sensors');
Web_indicator::set_off('Reload_plugins');
Web_indicator::set_off('Reload_directives');
Web_indicator::set_off('Reload_servers');
} else {
Web_indicator::set_off('Reload_' . $what);
}
示例14: _
if (!Session::am_i_admin()) {
echo _('You do not have permissions to see this section');
die;
}
/************************************************************************************************/
/************************************************************************************************/
/*** This file is includen in step_loader.php hence the wizard object is defined in $wizard ***/
/*** database connection is stored in $conn ***/
/************************************************************************************************/
/************************************************************************************************/
if (!$wizard instanceof Welcome_wizard) {
throw new Exception('There was an unexpected error');
}
$config = new Config();
$otx_key = $config->get_conf("open_threat_exchange_key");
$v_tag = Session::is_pro() ? "USM" : "OSSIM";
?>
<script type='text/javascript'>
function load_js_step()
{
load_handler_step_otx();
}
</script>
<div id='step_6' class='step_container'>
示例15: function
{
if($(this).val() != '')
{
$('#w_otx_next').prop('disabled', false);
}
else
{
$('#w_otx_next').prop('disabled', true);
}
});
$('#b_get_otx_token').on('click', function()
{
var url = "https://www.alienvault.com/my-account/customer/signup-or-thanks/?ctype=<?php
echo Session::is_pro() ? 'usm' : 'ossim';
?>
";
av_window_open(url,
{
width: 800,
height: 750,
title: 'otxwindow'
})
});
$('#otx_data_link').on('click', function()
{
LB_show("<?php
echo _('Open Threat Exchange Sample Data');