phpCAS::hasAttribute PHP Method

hasAttribute() public static method

Answer true if an attribute exists for the authenticated user.
public static hasAttribute ( string $key ) : boolean
$key string attribute name
return boolean
    public static function hasAttribute($key)
    {
        phpCAS::_validateClientExists();
        try {
            return self::$_PHPCAS_CLIENT->hasAttribute($key);
        } catch (Exception $e) {
            phpCAS::error(get_class($e) . ': ' . $e->getMessage());
        }
    }

Usage Example

Exemplo n.º 1
0
 private function setName()
 {
     if ($this->config->get('cas-name-attribute-key') !== null && phpCAS::hasAttribute($this->config->get('cas-name-attribute-key'))) {
         $_SESSION[':cas']['name'] = phpCAS::getAttribute($this->config->get('cas-name-attribute-key'));
     } else {
         $_SESSION[':cas']['name'] = $this->getUser();
     }
 }
All Usage Examples Of phpCAS::hasAttribute