getPrimaryId() 공개 메소드

Return the primary id of the user accessing the system.
public getPrimaryId ( ) : string
리턴 string The primary id.
예제 #1
0
파일: PassThrough.php 프로젝트: horde/horde
 /**
  * Fetch remote data.
  *
  * @param Horde_Controller_Response  $response The response handler.
  *
  * @return NULL
  */
 public function _passThrough(Horde_Controller_Response $response)
 {
     $url = $this->getUrlWithCredentials($this->_user->getPrimaryId(), $this->_user->getPassword());
     $origin = $this->_client->get($url);
     if ($origin->code !== 200) {
         $url = $this->getUrlWithCredentials($this->_user, 'XXX');
         throw new Horde_Kolab_FreeBusy_Exception_Unauthorized(sprintf('Unable to read free/busy information from %s', $url));
     }
     $response->setHeader('X-Redirect-To', $url);
     $response->setBody($origin->getStream());
 }
예제 #2
0
파일: Log.php 프로젝트: horde/horde
 /**
  * Finds out if a set of login credentials are valid.
  *
  * @return boolean Whether or not the password was correct.
  */
 public function isAuthenticated()
 {
     $result = $this->_user->isAuthenticated();
     $id = $this->_user->getPrimaryId();
     if ($result) {
         $this->_logger->notice(sprintf('Login success for "%s" from "%s" to free/busy.', $id, $this->_remote));
     } else {
         if (!empty($id)) {
             $this->_logger->err(sprintf('Failed login for "%s" from "%s" to free/busy', $id, $this->_remote));
         } else {
             $this->_logger->notice(sprintf('Anonymous access from "%s" to free/busy.', $this->_remote));
         }
     }
     return $result;
 }