本文整理汇总了PHP中Sessions::getSessionUser方法的典型用法代码示例。如果您正苦于以下问题:PHP Sessions::getSessionUser方法的具体用法?PHP Sessions::getSessionUser怎么用?PHP Sessions::getSessionUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sessions
的用法示例。
在下文中一共展示了Sessions::getSessionUser方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: elseif
function __isAuthenticated()
{
return true;
if (array_key_exists('HTTP_AUTH_KEY', $_SERVER)) {
$authKey = $_SERVER['HTTP_AUTH_KEY'];
} elseif (array_key_exists('auth_key', $_GET)) {
$authKey = $_GET['auth_key'];
} else {
throw new RestException(401, 'Authentication Required');
}
$sessions = new Sessions();
$session = $sessions->verifySession($authKey);
if (is_array($session)) {
$sesInfo = $sessions->getSessionUser($authKey);
self::$userId = $sesInfo['USR_UID'];
self::$authKey = $authKey;
return true;
}
throw new RestException(401, 'Wrong Credentials!');
}
示例2: claimCase
function claimCase($params)
{
$vsResult = isValidSession($params->sessionId);
if ($vsResult->status_code !== 0) {
return $vsResult;
}
if (ifPermission($params->sessionId, 'PM_CASES') == 0) {
$result = new wsResponse(2, G::LoadTranslation('ID_NOT_PRIVILEGES'));
return $result;
}
G::LoadClass('sessions');
$oSessions = new Sessions();
$session = $oSessions->getSessionUser($params->sessionId);
$ws = new wsBase();
$res = $ws->claimCase($session['USR_UID'], $params->guid, $params->delIndex);
return $res;
}
示例3: ifPermission
function ifPermission($sessionId, $permission)
{
global $RBAC;
$RBAC->initRBAC();
G::LoadClass('sessions');
$oSession = new Sessions();
$user = $oSession->getSessionUser($sessionId);
$oRBAC = RBAC::getSingleton();
$oRBAC->loadUserRolePermission($oRBAC->sSystem, $user['USR_UID']);
$aPermissions = $oRBAC->aUserInfo[$oRBAC->sSystem]['PERMISSIONS'];
$sw = 0;
foreach ($aPermissions as $aPermission) {
if ($aPermission['PER_CODE'] == $permission) {
$sw = 1;
}
}
return $sw;
}