Пример #1
0
 /**
  * Returns the user object for the given username
  * 
  * @access public
  * @param string $username
  * @return false|\Zepi\Web\AccessControl\Entity\User
  */
 public function getUserForUsername($username)
 {
     if (!$this->accessControlManager->hasAccessEntityForName(self::ACCESS_ENTITY_TYPE, $username)) {
         return false;
     }
     // Get the access entity
     $accessEntity = $this->accessControlManager->getAccessEntityForName(self::ACCESS_ENTITY_TYPE, $username);
     if ($accessEntity === false) {
         return false;
     }
     return $accessEntity;
 }
Пример #2
0
 /**
  * Returns the token object for the given public key
  * 
  * @access public
  * @param string $publicKey
  * @return boolean
  */
 public function getTokenForPublicKey($publicKey)
 {
     if (!$this->accessControlManager->hasAccessEntityForName(self::ACCESS_ENTITY_TYPE, $publicKey)) {
         return false;
     }
     // Get the access entity
     $accessEntity = $this->accessControlManager->getAccessEntityForName(self::ACCESS_ENTITY_TYPE, $publicKey);
     if ($accessEntity === false) {
         return false;
     }
     return $accessEntity;
 }