本文整理汇总了PHP中AuthUser::is_logged_in方法的典型用法代码示例。如果您正苦于以下问题:PHP AuthUser::is_logged_in方法的具体用法?PHP AuthUser::is_logged_in怎么用?PHP AuthUser::is_logged_in使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AuthUser
的用法示例。
在下文中一共展示了AuthUser::is_logged_in方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setInfos
/**
* Sets the various bits of information pertaining to a user when logged in.
*
* @param Record $user User object instance.
*/
private static final function setInfos(Record $user)
{
$_SESSION[self::SESSION_KEY] = array('username' => $user->username);
self::$record = $user;
self::$is_logged_in = true;
self::$roles = $user->roles();
self::$is_admin = self::hasPermission('administrator');
}
示例2: setInfos
public static function setInfos(Record $user)
{
$_SESSION[self::SESSION_KEY] = array('username' => $user->username);
self::$record = $user;
self::$is_logged_in = true;
self::$permissions = $user->getPermissions();
self::$is_admin = self::hasPermission('administrator');
}
示例3: setInfos
public static function setInfos(User $user)
{
//此处改为 SESSION
$_SESSION[self::SESSION_KEY]['username'] = $user->username;
$_SESSION[self::SESSION_KEY]['record'] = $user;
self::$record = $user;
self::$is_logged_in = true;
//$this->permissions = $user->getPermissions();
//$this->is_admin = $this->hasPermission('administrtor');
}