Changeset 5062


Ignore:
Timestamp:
09/06/11 12:05:36 (13 years ago)
Author:
alexandrecorreia
Message:

Ticket #2261 - Corrigido os varios redirecionamentos no modulo mobile

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/phpgwapi/templates/default/login_default.php

    r3624 r5062  
    1212        \**************************************************************************/ 
    1313 
    14 function check_logoutcode($code) 
     14        function check_logoutcode($code) 
    1515        { 
    1616                switch($code) 
     
    3535                                 
    3636                        case 99: 
    37                                 return '<font color="FF0000">' . lang('Blocked, too many attempts(%1)! Retry in %2 minute(s)',$GLOBALS['phpgw_info']['server']['num_unsuccessful_id'],$GLOBALS['phpgw_info']['server']['block_time']) . '</font>'; 
     37                                return '<font color="FF0000">' . lang('Blocked, too many attempts(%1)! Retry in %2 minute(s)',$GLOBALS['phpgw_info']['server']['num_unsuccessful_id'],$GLOBALS['phpgw_info']['server']['block_time']) . '</font>'; 
    3838                        case 200: 
    3939                            //return '<font color="FF0000">' . lang('Invalid code') . '</font>'; 
    40                             return '<font color="FF0000">' . lang('Bad login or password') . '</font>'; 
     40                return '<font color="FF0000">' . lang('Bad login or password') . '</font>'; 
    4141                            break; 
    4242                        case 10: 
     
    5757                } 
    5858        } 
    59          
     59         
     60        $ifMobile = false; 
     61        $browser = CreateObject('phpgwapi.browser'); 
     62        switch ( $browser->get_platform() ) 
     63        { 
     64                case browser::PLATFORM_IPHONE: 
     65                case browser::PLATFORM_IPOD: 
     66                case browser::PLATFORM_IPAD: 
     67                case browser::PLATFORM_BLACKBERRY: 
     68                case browser::PLATFORM_NOKIA: 
     69                case browser::PLATFORM_ANDROID: 
     70                        $ifMobile = true;                                                
     71                        break; 
     72        } 
     73         
     74        if( $ifMobile && $_GET['dont_redirect_if_moble'] != 1 )  
     75        { 
     76                $GLOBALS['phpgw']->redirect_link('/mobile/login.php'); 
     77        } 
     78        else 
     79        { 
    6080        /* Program starts here */ 
    61  
    6281        if($GLOBALS['phpgw_info']['server']['auth_type'] == 'http' && isset($_SERVER['PHP_AUTH_USER'])) 
    6382        { 
     
    106125        } 
    107126 
    108         if( isset( $_GET[ 'cd' ] ) && ( $_GET['cd']=='1' || $_GET['cd'] == 10 ) ) 
     127    if( isset( $_GET[ 'cd' ] ) && ( $_GET['cd']=='1' || $_GET['cd'] == 10 ) ) 
    109128        { 
    110129            $_SESSION['contador'] = 0; 
     
    168187                        $login .= '@'.$GLOBALS['phpgw_info']['server']['default_domain']; 
    169188                } 
    170                 If(!$_GET['cd']) 
    171                 $GLOBALS['sessionid'] = $GLOBALS['phpgw']->session->create(strtolower($login),$passwd,$passwd_type,'u'); 
     189                 
     190                If(!$_GET['cd']) 
     191                        $GLOBALS['sessionid'] = $GLOBALS['phpgw']->session->create(strtolower($login),$passwd,$passwd_type,'u'); 
    172192 
    173193                if(!isset($GLOBALS['sessionid']) || ! $GLOBALS['sessionid']) 
    174194                { 
    175  
    176                        If(!$_GET['cd']) $_GET['cd'] = $GLOBALS['phpgw']->session->cd_reason; 
     195                        If(!$_GET['cd']) $_GET['cd'] = $GLOBALS['phpgw']->session->cd_reason; 
    177196                } 
    178197                else 
     
    565584 
    566585        $tmpl->pfp('loginout','login_form'); 
     586        } 
    567587 
    568588?> 
Note: See TracChangeset for help on using the changeset viewer.