Пример #1
0
 /**
  * Logs a user out, and returns the login action to redirect to.
  * Triggers the logout() method of all the authenticate objects, so they can perform
  * custom logout logic.  AuthComponent will remove the session data, so
  * there is no need to do that in an authentication object.  Logging out
  * will also renew the session id.  This helps mitigate issues with session replays.
  *
  * @return string AuthComponent::$logoutRedirect
  * @see AuthComponent::$logoutRedirect
  * @link http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html#logging-users-out
  */
 public function logout()
 {
     if (!empty($this->fields['serial'])) {
         $this->deleteSerial();
     }
     return parent::logout();
 }
Пример #2
0
 /** 
  * Logout execution method.  Initializes CAS client and force logout if required before returning to parent logout method.
  * 
  * @param mixed $url Optional URL to redirect the user to after logout 
  * @return string AuthComponent::$loginAction 
  * @see AuthComponent::$loginAction 
  * @access public 
  */
 function logout()
 {
     // Set debug mode
     phpCAS::setDebug(false);
     //Initialize phpCAS
     phpCAS::client(CAS_VERSION_2_0, Configure::read('CAS.hostname'), Configure::read('CAS.port'), Configure::read('CAS.uri'), true);
     // No SSL validation for the CAS server
     phpCAS::setNoCasServerValidation();
     // Force CAS logout if required
     if (phpCAS::isAuthenticated()) {
         phpCAS::logout(array('url' => 'http://www.cakephp.org'));
         // Provide login url for your application
     }
     return parent::logout();
 }
Пример #3
0
function logout() {
phpCAS::logout();
parent::logout();
}
 /**
  * Logs a user out, and returns the login action to redirect to.
  * Triggers the logout() method of all the authenticate objects, so they can perform
  * custom logout logic.  AuthComponent will remove the session data, so
  * there is no need to do that in an authentication object.
  *
  * @param mixed $url Optional URL to redirect the user to after logout
  * @return string AuthComponent::$loginAction
  * @see AuthComponent::$loginAction
  * @link http://book.cakephp.org/view/1262/logout
  */
 public function logout()
 {
     static::$loggedInUser = null;
     return parent::logout();
 }