Permalink
Browse files

Better fix for login redirect, don't force mail task

  • Loading branch information...
1 parent 8ec1b91 commit 32234d71d3e7817607ba97f76b7d22b1999a0982 @thomascube thomascube committed Jan 19, 2011
Showing with 7 additions and 2 deletions.
  1. +7 −2 index.php
View
@@ -105,11 +105,16 @@
// restore original request parameters
$query = array();
- if ($url = get_input_value('_url', RCUBE_INPUT_POST))
+ if ($url = get_input_value('_url', RCUBE_INPUT_POST)) {
parse_str($url, $query);
+
+ // prevent endless looping on login page
+ if ($query['_task'] == 'login')
+ unset($query['_task']);
+ }
// allow plugins to control the redirect url after login success
- $redir = $RCMAIL->plugins->exec_hook('login_after', array('_task' => 'mail') + $query);
+ $redir = $RCMAIL->plugins->exec_hook('login_after', $query + array('_task' => 'mail'));
unset($redir['abort']);
// send redirect

0 comments on commit 32234d7

Please sign in to comment.