Changeset 1024

Show
Ignore:
Timestamp:
07/18/08 23:28:59 (1 month ago)
Author:
laurentj
Message:

ticket #650: jauth~login:form should redirect to after_login if the user is already connected. p=bastnic

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.0.x/lib/jelix-modules/jauth/controllers/login.classic.php

    r717 r1024  
    55* @author      Laurent Jouanneau 
    66* @contributor Antoine Detante 
    7 * @copyright   2005-2007 Laurent Jouanneau, 2007 Antoine Detante 
     7* @contributor Bastien Jaillot 
     8* @copyright   2005-2008 Laurent Jouanneau, 2007 Antoine Detante, 2008 Bastien Jaillot 
    89* @link        http://www.jelix.org 
    910* @licence  http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public Licence, see LICENCE file 
     
    6667    */ 
    6768    function form() { 
     69        if (jAuth::isConnected()) { 
     70            $conf = $GLOBALS['gJCoord']->getPlugin('auth')->config;  
     71 
     72            if ($conf['after_login'] != '') { 
     73                if (!($conf['enable_after_login_override'] && $url_return= $this->param('auth_url_return'))){  
     74                    $url_return =  jUrl::get($conf['after_login']); 
     75                } 
     76                $rep = $this->getResponse('redirectUrl'); 
     77                $rep->url = $url_return; 
     78                return $rep; 
     79            } 
     80        } 
     81 
    6882        $rep = $this->getResponse('html'); 
    6983 
     
    7488    } 
    7589} 
    76 ?> 
  • branches/1.0.x/lib/jelix-modules/jauth/templates/login.form.tpl

    r979 r1024  
    2828   </form> 
    2929{else} 
    30     <p>{$user->surname} {$user->name}</p> 
     30    <p>{$user->login}</p> 
    3131{/if} 
    3232</div> 
  • trunk/lib/jelix-modules/jauth/controllers/login.classic.php

    r717 r1024  
    55* @author      Laurent Jouanneau 
    66* @contributor Antoine Detante 
    7 * @copyright   2005-2007 Laurent Jouanneau, 2007 Antoine Detante 
     7* @contributor Bastien Jaillot 
     8* @copyright   2005-2007 Laurent Jouanneau, 2007 Antoine Detante, 2008 Bastien Jaillot 
    89* @link        http://www.jelix.org 
    910* @licence  http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public Licence, see LICENCE file 
     
    6667    */ 
    6768    function form() { 
     69        if (jAuth::isConnected()) { 
     70            $conf = $GLOBALS['gJCoord']->getPlugin('auth')->config;  
     71 
     72            if ($conf['after_login'] != '') { 
     73                if (!($conf['enable_after_login_override'] && $url_return= $this->param('auth_url_return'))){  
     74                    $url_return =  jUrl::get($conf['after_login']); 
     75                } 
     76                $rep = $this->getResponse('redirectUrl'); 
     77                $rep->url = $url_return; 
     78                return $rep; 
     79            } 
     80        } 
     81 
    6882        $rep = $this->getResponse('html'); 
    6983 
     
    7488    } 
    7589} 
    76 ?> 
  • trunk/lib/jelix-modules/jauth/templates/login.form.tpl

    r980 r1024  
    2828   </form> 
    2929{else} 
    30     <p>{$user->surname} {$user->name}</p> 
     30    <p>{$user->login}</p> 
    3131{/if} 
    3232</div> 
Download in other formats: Unified Diff Zip Archive