From 3a2b270c9d1f531c2e2d1c422a4756afd639ef47 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Mon, 15 Jun 2009 03:01:36 -0400
Subject: [PATCH] - always call logout action as task (#1485919)

---
 index.php                          |    2 +-
 program/include/rcube_template.php |    2 +-
 program/js/app.js                  |    8 +-------
 3 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/index.php b/index.php
index 5d37a93..e8111b1 100644
--- a/index.php
+++ b/index.php
@@ -121,7 +121,7 @@
 }
 
 // end session
-else if (($RCMAIL->task=='logout' || $RCMAIL->action=='logout') && isset($_SESSION['user_id'])) {
+else if ($RCMAIL->task=='logout' && isset($_SESSION['user_id'])) {
   $OUTPUT->show_message('loggedout');
   $RCMAIL->logout_actions();
   $RCMAIL->kill_session();
diff --git a/program/include/rcube_template.php b/program/include/rcube_template.php
index 3d0e739..455bbcf 100755
--- a/program/include/rcube_template.php
+++ b/program/include/rcube_template.php
@@ -969,7 +969,7 @@
         
         // save original url
         $url = get_input_value('_url', RCUBE_INPUT_POST);
-        if (empty($url) && !preg_match('/_action=logout/', $_SERVER['QUERY_STRING']))
+        if (empty($url) && !preg_match('/_(task|action)=logout/', $_SERVER['QUERY_STRING']))
             $url = $_SERVER['QUERY_STRING'];
 
         $input_user   = new html_inputfield(array('name' => '_user', 'id' => 'rcmloginuser', 'size' => 30) + $attrib);
diff --git a/program/js/app.js b/program/js/app.js
index 218351c..216bebc 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -367,9 +367,6 @@
         break;
       }
 
-    // enable basic commands
-    this.enable_command('logout', true);
-
     // flag object as complete
     this.loaded = true;
 
@@ -551,14 +548,11 @@
           this.gui_objects.loginform.submit();
         break;
 
-      case 'logout':
-        this.goto_url('logout', '', true);
-        break;
-
       // commands to switch task
       case 'mail':
       case 'addressbook':
       case 'settings':
+      case 'logout':
         this.switch_task(command);
         break;
 

--
Gitblit v1.9.1