From 9b94eb64153a7dc6555d6b9a30a35296ce592f82 Mon Sep 17 00:00:00 2001 From: alecpl Date: Sat, 6 Feb 2010 18:12:49 +0000 Subject: - Fix setting task name according to auth state. So, any action before user is authenticated is assigned to 'login' task instead of 'mail'. Now binding plugins to 'login' task is possible and realy usefull. It's also possible to bind to all tasks excluding 'login'. --- plugins/archive/archive.php | 3 --- plugins/autologon/autologon.php | 3 ++- plugins/help/help.php | 6 +++--- plugins/http_authentication/http_authentication.php | 3 ++- plugins/markasjunk/markasjunk.php | 3 --- plugins/new_user_identity/new_user_identity.php | 2 ++ plugins/squirrelmail_usercopy/squirrelmail_usercopy.php | 2 ++ 7 files changed, 11 insertions(+), 11 deletions(-) (limited to 'plugins') diff --git a/plugins/archive/archive.php b/plugins/archive/archive.php index d2269baba..939faf8ba 100644 --- a/plugins/archive/archive.php +++ b/plugins/archive/archive.php @@ -17,9 +17,6 @@ class archive extends rcube_plugin { $rcmail = rcmail::get_instance(); - if (!$rcmail->user->ID) - return; - $this->register_action('plugin.archive', array($this, 'request_action')); // There is no "Archived flags" diff --git a/plugins/autologon/autologon.php b/plugins/autologon/autologon.php index c40f2d4eb..bc3d2ee76 100644 --- a/plugins/autologon/autologon.php +++ b/plugins/autologon/autologon.php @@ -6,6 +6,7 @@ */ class autologon extends rcube_plugin { + public $task = 'login'; function init() { @@ -18,7 +19,7 @@ class autologon extends rcube_plugin $rcmail = rcmail::get_instance(); // change action to login - if ($args['task'] == 'mail' && empty($args['action']) && empty($_SESSION['user_id']) && !empty($_GET['_autologin']) && $this->is_localhost()) + if (empty($_SESSION['user_id']) && !empty($_GET['_autologin']) && $this->is_localhost()) $args['action'] = 'login'; return $args; diff --git a/plugins/help/help.php b/plugins/help/help.php index 94d06542c..a7b3d5793 100644 --- a/plugins/help/help.php +++ b/plugins/help/help.php @@ -12,13 +12,13 @@ class help extends rcube_plugin { + // all task excluding 'login' and 'logout' + public $task = '?(?!login|logout).*'; + function init() { $rcmail = rcmail::get_instance(); - if (!$rcmail->user->ID) - return; - $this->add_texts('localization/', false); // register actions diff --git a/plugins/http_authentication/http_authentication.php b/plugins/http_authentication/http_authentication.php index 57422a74d..7c2296614 100644 --- a/plugins/http_authentication/http_authentication.php +++ b/plugins/http_authentication/http_authentication.php @@ -10,6 +10,7 @@ */ class http_authentication extends rcube_plugin { + public $task = 'login'; function init() { @@ -20,7 +21,7 @@ class http_authentication extends rcube_plugin function startup($args) { // change action to login - if ($args['task'] == 'mail' && empty($args['action']) && empty($_SESSION['user_id']) + if (empty($args['action']) && empty($_SESSION['user_id']) && !empty($_SERVER['PHP_AUTH_USER']) && !empty($_SERVER['PHP_AUTH_PW'])) $args['action'] = 'login'; diff --git a/plugins/markasjunk/markasjunk.php b/plugins/markasjunk/markasjunk.php index 9f75590c8..046645872 100644 --- a/plugins/markasjunk/markasjunk.php +++ b/plugins/markasjunk/markasjunk.php @@ -17,9 +17,6 @@ class markasjunk extends rcube_plugin { $rcmail = rcmail::get_instance(); - if (!$rcmail->user->ID) - return; - $this->register_action('plugin.markasjunk', array($this, 'request_action')); if ($rcmail->action == '' || $rcmail->action == 'show') { diff --git a/plugins/new_user_identity/new_user_identity.php b/plugins/new_user_identity/new_user_identity.php index 78c99522d..43eeae9dd 100644 --- a/plugins/new_user_identity/new_user_identity.php +++ b/plugins/new_user_identity/new_user_identity.php @@ -22,6 +22,8 @@ */ class new_user_identity extends rcube_plugin { + public $task = 'login'; + function init() { $this->add_hook('create_user', array($this, 'lookup_user_name')); diff --git a/plugins/squirrelmail_usercopy/squirrelmail_usercopy.php b/plugins/squirrelmail_usercopy/squirrelmail_usercopy.php index 4a14ff2c9..aff2f494f 100644 --- a/plugins/squirrelmail_usercopy/squirrelmail_usercopy.php +++ b/plugins/squirrelmail_usercopy/squirrelmail_usercopy.php @@ -10,6 +10,8 @@ */ class squirrelmail_usercopy extends rcube_plugin { + public $task = 'login|settings'; + private $prefs = null; private $abook = array(); -- cgit v1.2.3