本文整理汇总了PHP中BaseUser::hasRole方法的典型用法代码示例。如果您正苦于以下问题:PHP BaseUser::hasRole方法的具体用法?PHP BaseUser::hasRole怎么用?PHP BaseUser::hasRole使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseUser
的用法示例。
在下文中一共展示了BaseUser::hasRole方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ImportHTTPVar
include_once "{$BASE_path}/base_qry_common.php";
set_time_limit(300);
if (GET('sensor') != "") {
ossim_valid(GET('sensor'), OSS_DIGIT, 'illegal:' . _("sensor"));
}
// Geoip
include "geoip.inc";
$gi = geoip_open("/usr/share/geoip/GeoIP.dat", GEOIP_STANDARD);
//$addr_type = ImportHTTPVar("addr_type", VAR_DIGIT);
$addr_type = 1;
$submit = ImportHTTPVar("submit", VAR_ALPHA | VAR_SPACE, array(gettext("Delete Selected"), gettext("Delete ALL on Screen"), _ENTIREQUERY));
$dst_ip = NULL;
// Check role out and redirect if needed -- Kevin
$roleneeded = 10000;
$BUser = new BaseUser();
if ($BUser->hasRole($roleneeded) == 0 && $Use_Auth_System == 1) {
base_header("Location: " . $BASE_urlpath . "/index.php");
}
$et = new EventTiming($debug_time_mode);
// The below three lines were moved from line 87 because of the odd errors some users were having
/* Connect to the Alert database */
$db = NewBASEDBConnection($DBlib_path, $DBtype);
$db->baseDBConnect($db_connect_method, $alert_dbname, $alert_host, $alert_port, $alert_user, $alert_password);
$cs = new CriteriaState("base_stat_country.php", "&addr_type=1");
$cs->ReadState();
/* Dump some debugging information on the shared state */
if ($debug_mode > 0) {
PrintCriteriaState();
}
$qs = new QueryState();
$qs->AddCannedQuery("most_frequent", $freq_num_uaddr, gettext("Most Frequent IP addresses"), "occur_d");
示例2: DBLink
}
if (isset($tmp_signatures)) {
$_SESSION["acid_sig_names"] = $tmp_signatures;
}
if (isset($tmp_sig_refs)) {
$_SESSION["acid_sig_refs"] = $tmp_sig_refs;
}*/
InitArray($_SESSION['back_list'], 1, 3, "");
$_SESSION['back_list_cnt'] = 0;
PushHistory();
// Check role out and redirect if needed -- Kevin
$roleneeded = 10000;
$BUser = new BaseUser();
//if (($Use_Auth_System == 1) && ($BUser->hasRole($roleneeded) == 0))
if ($Use_Auth_System == 1) {
if ($BUser->hasRole($roleneeded) == 0) {
base_header("Location: {$BASE_urlpath}/index.php");
}
}
// Set cookie to use the correct db.
if (isset($_GET['archive'])) {
"no" == $_GET['archive'] ? $value = 0 : ($value = 1);
setcookie('archive', $value);
base_header("Location: {$BASE_urlpath}/base_main.php");
}
function DBLink()
{
// generate the link to select the other database....
global $archive_exists;
if (isset($_COOKIE['archive']) && $_COOKIE['archive'] == 1 || isset($_GET['archive']) && $_GET['archive'] == 1) {
echo '<a href="base_main.php?archive=no">' . gettext("Use Event Database") . '</a>';