CAS_Client::getUser PHP Method

getUser() public method

This method returns the CAS user's login name.
public getUser ( ) : string
return string the login name of the authenticated user
    public function getUser()
    {
        // Sequence validation
        $this->ensureAuthenticationCallSuccessful();
        return $this->_getUser();
    }

Usage Example

示例#1
0
文件: CAS.php 项目: DCUnit711/Demeter
 /**
  * This method returns the CAS user's login name.
  *
  * @return string the login name of the authenticated user
  * @warning should only be called after phpCAS::forceAuthentication()
  * or phpCAS::checkAuthentication().
  * */
 public static function getUser()
 {
     phpCAS::_validateClientExists();
     try {
         return self::$_PHPCAS_CLIENT->getUser();
     } catch (Exception $e) {
         phpCAS::error(get_class($e) . ': ' . $e->getMessage());
     }
 }
CAS_Client