Permalink
Browse files

Merge pull request #42 from adamfranco/CAS-logout

Log out of the CAS server when logging out of Kurogo.
  • Loading branch information...
2 parents 5e55534 + e2bb86e commit 60a572addd456c5c786a3729c28a06e436c21262 @akinspe akinspe committed Nov 29, 2011
Showing with 15 additions and 0 deletions.
  1. +15 −0 lib/Authentication/CASAuthentication.php
@@ -186,6 +186,21 @@ protected function validUserLogins()
{
return array('LINK', 'NONE');
}
+
+ /***
+ * Resets the authority and returns it to a fresh state.
+ * Called by the logout method to clean up any authority specific data (caches etc). Not all authorities will need this
+ * @param bool $hard if true a hard reset is done
+ */
+ protected function reset($hard=false)
+ {
+ // Log out from the CAS server
+ if (phpCAS::isAuthenticated()) {
+ $service = "http".(IS_SECURE ? 's' : '')."://".SERVER_HOST.$_SERVER['REQUEST_URI'];
+ phpCAS::logoutWithRedirectServiceAndUrl($service, $service);
+ }
+ return true;
+ }
}
/**

0 comments on commit 60a572a

Please sign in to comment.