public function shutdown() { if (sfConfig::get('app_sf_object_guard_plugin_persistent_credentials', true)) { $this->storage->write(self::CREDENTIAL_TABLES_NAMESPACE, $this->credentialsLoadedFor); } parent::shutdown(); }
// admin and (user or subscriber) $t->is($user->hasCredential(array(array('admin', array('user', 'subscriber')))), true); $user->addCredentials(array('superadmin1', 'subscriber1')); $t->is($user->hasCredential('subscriber1'), true); $t->is($user->hasCredential('superadmin1'), true); // admin and (user or subscriber) and (superadmin1 or subscriber1) $t->is($user->hasCredential(array(array('admin', array('user', 'subscriber'), array('superadmin1', 'subscriber1')))), true); // numerical credentials $user->clearCredentials(); $user->addCredentials(array('1', 2)); $t->is($user->hasCredential(1), true, '->hasCrendential() supports numerical credentials'); $t->is($user->hasCredential('2'), true, '->hasCrendential() supports numerical credentials'); $t->is($user->hasCredential(array('1', 2)), true, '->hasCrendential() supports numerical credentials'); $t->is($user->hasCredential(array(1, '2')), true, '->hasCrendential() supports numerical credentials'); // ->removeCredential() $t->diag('->removeCredential()'); $user->removeCredential('user'); $t->is($user->hasCredential('user'), false); // ->clearCredentials() $t->diag('->clearCredentials()'); $user->clearCredentials(); $t->is($user->hasCredential('subscriber'), false); $t->is($user->hasCredential('superadmin'), false); // timeout $user->setAuthenticated(true); $user->shutdown(); $user = new sfBasicSecurityUser($dispatcher, $storage, array('timeout' => 0)); $t->is($user->isTimedOut(), true, '->initialize() times out the user if no request made for a long time'); $user = new sfBasicSecurityUser($dispatcher, $storage, array('timeout' => false)); $t->is($user->isTimedOut(), false, '->initialize() takes a timeout parameter which can be false to disable session timeout'); sfToolkit::clearDirectory($sessionPath);
public function shutdown() { $this->storage->write(self::SITE_IDENTIFIER_NAMESPACE, $this->generateSiteIdentifier()); parent::shutdown(); }
public function shutdown() { $this->storage->write(self::SUPER_ADMIN_NAMESPACE, $this->isSuperAdmin); parent::shutdown(); }
/** * Cette fonction est appelée lorsque la requête a été traitée * On serialise a ce moment là le profil afin de le stocker dans la session * * @see sfBasicSecurityUser.shutdown() */ public function shutdown() { if ($this->profile !== null) { $this->setAttribute('profile', serialize($this->profile), self::SESSION_NAMESPACE); } parent::shutdown(); }