Changeset 2372 in subversion


Ignore:
Timestamp:
Apr 2, 2009 12:53:59 PM (4 years ago)
Author:
thomasb
Message:

Remember original request at login and redirect after (#1485377, #1485764)

Location:
branches/devel-api
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/devel-api/index.php

    r2371 r2372  
    108108        $_SERVER['REMOTE_ADDR'])); 
    109109    } 
     110     
     111    // restore original request parameters 
     112    $query = array(); 
     113    if ($url = get_input_value('_url', RCUBE_INPUT_POST)) 
     114      parse_str($url, $query); 
    110115 
    111116    // allow plugins to control the redirect url after login success 
    112     $redir = $RCMAIL->plugins->exec_hook('login_after', array('task' => $RCMAIL->task)); 
     117    $redir = $RCMAIL->plugins->exec_hook('login_after', $query + array('task' => $RCMAIL->task)); 
    113118    unset($redir['abort']); 
    114119 
  • branches/devel-api/program/include/rcmail.php

    r2371 r2372  
    929929    if (!is_array($p)) 
    930930      $p = array('_action' => @func_get_arg(0)); 
    931  
    932     if (!$p['task'] || !in_array($p['task'], rcmail::$main_tasks)) 
    933       $p['task'] = $this->task; 
    934  
    935     $p['_task'] = $p['task']; 
     931       
     932    $task = $p['_task'] ? $p['_task'] : $p['task']; 
     933    if (!$task || !in_array($task, rcmail::$main_tasks)) 
     934      $task = $this->task; 
     935 
     936    $p['_task'] = $task; 
    936937    unset($p['task']); 
    937938 
  • branches/devel-api/program/include/rcube_template.php

    r2304 r2372  
    933933 
    934934        $_SESSION['temp'] = true; 
     935         
     936        // save original url 
     937        $url = get_input_value('_url', RCUBE_INPUT_POST); 
     938        if (empty($url) && !preg_match('/_action=logout/', $_SERVER['QUERY_STRING'])) 
     939            $url = $_SERVER['QUERY_STRING']; 
    935940 
    936941        $input_user   = new html_inputfield(array('name' => '_user', 'id' => 'rcmloginuser', 'size' => 30) + $attrib); 
     
    938943        $input_action = new html_hiddenfield(array('name' => '_action', 'value' => 'login')); 
    939944        $input_tzone  = new html_hiddenfield(array('name' => '_timezone', 'id' => 'rcmlogintz', 'value' => '_default_')); 
     945        $input_url    = new html_hiddenfield(array('name' => '_url', 'id' => 'rcmloginurl', 'value' => $url)); 
    940946        $input_host   = null; 
    941947 
     
    977983        $out = $input_action->show(); 
    978984        $out .= $input_tzone->show(); 
     985        $out .= $input_url->show(); 
    979986        $out .= $table->show(); 
    980987 
Note: See TracChangeset for help on using the changeset viewer.