public function testGetRightDisconnect()
 {
     jAuth::logout();
     jAcl::clearCache();
     $this->assertEqual(jAcl::getRight('super.cms'), array());
     $this->assertEqual(jAcl::getRight('admin.access'), array());
     jAcl::clearCache();
 }
Example #2
0
 /**
  * logout a user and delete the user in the php session
  */
 public static function logout()
 {
     $config = self::_getConfig();
     jEvent::notify('AuthLogout', array('login' => $_SESSION[$config['session_name']]->login));
     $_SESSION[$config['session_name']] = new jAuthDummyUser();
     try {
         jAcl::clearCache();
     } catch (Exception $e) {
     }
     try {
         jAcl2::clearCache();
     } catch (Exception $e) {
     }
     if (isset($config['persistant_enable']) && $config['persistant_enable']) {
         if (!isset($config['persistant_cookie_name'])) {
             throw new jException('jelix~auth.error.persistant.incorrectconfig', 'persistant_cookie_name, persistant_crypt_key');
         }
         setcookie($config['persistant_cookie_name'] . '[auth]', '', time() - 3600, $config['persistant_cookie_path']);
     }
 }
 /**
  * Delete the given subject
  * @param string  $subject the key of the subject
  */
 public static function removeSubject($subject)
 {
     // supprime dans jacl_rights
     // supprime dans jacl_subject
     $p = jAclDb::getProfile();
     $daoright = jDao::get('jelix~jaclrights', $p);
     $daoright->deleteBySubject($subject);
     $daosbj = jDao::get('jelix~jaclsubject', $p);
     $daosbj->delete($subject);
     jAcl::clearCache();
 }
Example #4
0
 /**
  * Delete the given subject
  * @param string  $subject the key of the subject
  */
 public static function removeSubject($subject)
 {
     // delete into jacl_rights
     $daoright = jDao::get('jacldb~jaclrights', 'jacl_profile');
     $daoright->deleteBySubject($subject);
     // delete into jacl_subject
     $daosbj = jDao::get('jacldb~jaclsubject', 'jacl_profile');
     $daosbj->delete($subject);
     jAcl::clearCache();
 }