예제 #1
0
 /**
  * Initializes the myUser object.
  *
  * @param sfEventDispatcher $dispatcher The event dispatcher object
  * @param sfStorage $storage The session storage object
  * @param array $options An array of options
  */
 public function initialize(sfEventDispatcher $dispatcher, sfStorage $storage, $options = array())
 {
     parent::initialize($dispatcher, $storage, $options);
     if (!$this->isAuthenticated()) {
         $this->_user_id = null;
     }
 }
예제 #2
0
 public function getUsername()
 {
     if ($this->isAuthenticated()) {
         return parent::getUsername();
     }
     return 'Anonymous@' . $_SERVER['REMOTE_ADDR'];
 }
예제 #3
0
 public function hasPermission($permissions, $useAnd = true)
 {
     if (!is_array($permissions)) {
         return parent::hasPermission($permissions);
     }
     // now we assume that $permissions is an array
     $test = false;
     foreach ($permissions as $permission) {
         // recursively check the permission with a switched AND/OR mode
         $test = self::hasPermission($permission, $useAnd ? false : true);
         if ($useAnd) {
             $test = $test ? false : true;
         }
         if ($test) {
             // either passed one in OR mode or failed one in AND mode
             break;
             // the matter is settled
         }
     }
     if ($useAnd) {
         // in AND mode we succeed if $test is false
         $test = $test ? false : true;
     }
     return $test;
 }
예제 #4
0
 /**
  * Logout the user form the current symfony application and from the
  *  CAS server
  * @param  boolean $onlyLocal   Set it to true, to logout from the application, but stay login in the CAS
  */
 public function logout($url = null, $onlyLocal = false)
 {
     parent::signOut();
     $this->username = null;
     if (!$onlyLocal) {
         sfCAS::initPhpCAS();
         if (!empty($url)) {
             phpCAS::logoutWithUrl($url);
         } else {
             phpCas::logout();
         }
     }
 }
예제 #5
0
 public function signIn($user, $remember = false, $con = null)
 {
     $return = parent::signIn($user, $remember, $con);
     bhLDAP::debug("########  hello bhLDAPAuthSecurityUser.class.php signIn()!");
     // signin
     # This either sets or overrides the parent::signIn function above
     #$this->setAttribute('user_id', $user->getId(), 'sfGuardSecurityUser');
     #$this->setAuthenticated(true);
     #$this->clearCredentials();
     #$this->addCredentials($user->getAllPermissionNames());
     bhLDAP::debug("######## bhLDAPAuthSecurityUser id: " . $user->getID());
     bhLDAP::debug("######## bhLDAPAuthSecurityUser Clearing Credentials...");
     $this->clearCredentials();
     bhLDAP::debug("######## bhLDAPAuthSecurityUser Fetching Credentials...");
     //bhLDAP::debugDump($user, "######## $user");
     $credentials = bhLDAP::getUserCredentials($user);
     bhLDAP::debug("######## bhLDAPAuthSecurityUser Adding Credentials...");
     $this->addCredentials($credentials);
     bhLDAP::debug("######## bhLDAPAuthSecurityUser return...");
     //    die();
     return $return;
 }
예제 #6
0
 public function signOut()
 {
     $this->_isEditMode = null;
     return parent::signOut();
 }
예제 #7
0
 public function signIn($user, $remember = false, $con = null)
 {
     $this->setAttribute('email', $user->getEmail(), 'sfGuardSecurityUser');
     $this->setAttribute('person_id', $user->getProfile()->getId(), 'sfGuardSecurityUser');
     parent::signIn($user, $remember, $con);
 }
 public function signIn($user, $remember = false, $con = null, $facebookAuthenticated = false)
 {
     $this->setFacebookAuthenticated($facebookAuthenticated);
     return parent::signIn($user, $remember, $con);
 }
예제 #9
0
 function clearCredentials()
 {
     parent::clearCredentials();
     $this->getAttributeHolder()->removeNamespace('apostrophe');
 }
 public function initialize(sfEventDispatcher $dispatcher, sfStorage $storage, $options = array())
 {
     // disable timeout
     $options['timeout'] = false;
     parent::initialize($dispatcher, $storage, $options);
 }
예제 #11
0
 public function getReferer($default)
 {
     if ($default) {
         return $default;
     }
     return parent::getReferer($default);
 }
예제 #12
0
 /**
  * Initializes the sfGuardSecurityUser object.
  *
  * @param sfEventDispatcher $dispatcher The event dispatcher object
  * @param sfStorage $storage The session storage object
  * @param array $options An array of options
  */
 public function initialize(sfEventDispatcher $dispatcher, sfStorage $storage, $options = array())
 {
     parent::initialize($dispatcher, $storage, $options);
     $this->setCulture('hu');
 }
예제 #13
0
 public function signOut()
 {
     $this->getAttributeHolder()->removeNamespace('admin_module');
     $this->getAttributeHolder()->removeNamespace('charts');
     parent::signOut();
 }
예제 #14
0
 public function hasCredential($credential, $useAnd = true)
 {
     return parent::hasCredential($credential, $useAnd) || parent::hasPermission($credential);
 }
예제 #15
0
 public function signOut()
 {
     $this->setLoginRole(null);
     parent::signOut();
 }
예제 #16
0
 public function getFirstname() 
 {
   return parent::getFirstname();
 }
예제 #17
0
 public function signIn($user, $remember = false, $con = null)
 {
     parent::signIn($user, $remember, $con);
     $this->loadUserSettings();
 }
예제 #18
0
 public function signIn($user, $remember = false, $con = null)
 {
     parent::signIn($user, $remember, $con);
     $this->addCredentials($user->getGroups());
 }
예제 #19
0
 public function signIn($user, $remember = false, $con = null)
 {
     parent::signIn($user, $remember, $con);
     $this->loadPreferences();
 }
예제 #20
0
 public function signOut()
 {
     $this->getAttributeHolder()->removeNamespace(self::$NS);
     parent::signOut();
 }