Skip to content
Browse files

add support for logout without redirect

  • Loading branch information...
1 parent 81d47a2 commit a0d92af200653c5a15b1e7bd75cce585b5a7af55 @romaninsh romaninsh committed Jun 15, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/BasicAuth.php
View
4 lib/BasicAuth.php
@@ -285,7 +285,7 @@ function loginRedirect(){
if($this->api->isAjaxOutput())$this->ajax()->redirect($this->api->getIndexPage())->execute();
$this->api->redirect($this->api->getIndexPage());
}
- function logout(){
+ function logout($redirect=true){
// Forces logout. This also cleans cookies
$this->forget('info');
setcookie($this->name."_username",null);
@@ -294,7 +294,7 @@ function logout(){
session_destroy();
$this->info=false;
- $this->api->redirect($this->api->getIndexPage());
+ if($redirect)$this->api->redirect($this->api->getIndexPage());
}
function createForm($frame,$login_tag='Content'){
$form=$frame->add('Form',null,$login_tag);

0 comments on commit a0d92af

Please sign in to comment.
Something went wrong with that request. Please try again.