/** * 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; } }
public function getUsername() { if ($this->isAuthenticated()) { return parent::getUsername(); } return 'Anonymous@' . $_SERVER['REMOTE_ADDR']; }
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; }
/** * 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(); } } }
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; }
public function signOut() { $this->_isEditMode = null; return parent::signOut(); }
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); }
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); }
public function getReferer($default) { if ($default) { return $default; } return parent::getReferer($default); }
/** * 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'); }
public function signOut() { $this->getAttributeHolder()->removeNamespace('admin_module'); $this->getAttributeHolder()->removeNamespace('charts'); parent::signOut(); }
public function hasCredential($credential, $useAnd = true) { return parent::hasCredential($credential, $useAnd) || parent::hasPermission($credential); }
public function signOut() { $this->setLoginRole(null); parent::signOut(); }
public function getFirstname() { return parent::getFirstname(); }
public function signIn($user, $remember = false, $con = null) { parent::signIn($user, $remember, $con); $this->loadUserSettings(); }
public function signIn($user, $remember = false, $con = null) { parent::signIn($user, $remember, $con); $this->addCredentials($user->getGroups()); }
public function signIn($user, $remember = false, $con = null) { parent::signIn($user, $remember, $con); $this->loadPreferences(); }
public function signOut() { $this->getAttributeHolder()->removeNamespace(self::$NS); parent::signOut(); }