Index: branches/2.2/phpgwapi/templates/default/login_default.php
===================================================================
--- branches/2.2/phpgwapi/templates/default/login_default.php (revision 3624)
+++ branches/2.2/phpgwapi/templates/default/login_default.php (revision 5062)
@@ -12,5 +12,5 @@
\**************************************************************************/
-function check_logoutcode($code)
+ function check_logoutcode($code)
{
switch($code)
@@ -35,8 +35,8 @@
case 99:
- return '' . lang('Blocked, too many attempts(%1)! Retry in %2 minute(s)',$GLOBALS['phpgw_info']['server']['num_unsuccessful_id'],$GLOBALS['phpgw_info']['server']['block_time']) . '';
+ return '' . lang('Blocked, too many attempts(%1)! Retry in %2 minute(s)',$GLOBALS['phpgw_info']['server']['num_unsuccessful_id'],$GLOBALS['phpgw_info']['server']['block_time']) . '';
case 200:
//return '' . lang('Invalid code') . '';
- return '' . lang('Bad login or password') . '';
+ return '' . lang('Bad login or password') . '';
break;
case 10:
@@ -57,7 +57,26 @@
}
}
-
+
+ $ifMobile = false;
+ $browser = CreateObject('phpgwapi.browser');
+ switch ( $browser->get_platform() )
+ {
+ case browser::PLATFORM_IPHONE:
+ case browser::PLATFORM_IPOD:
+ case browser::PLATFORM_IPAD:
+ case browser::PLATFORM_BLACKBERRY:
+ case browser::PLATFORM_NOKIA:
+ case browser::PLATFORM_ANDROID:
+ $ifMobile = true;
+ break;
+ }
+
+ if( $ifMobile && $_GET['dont_redirect_if_moble'] != 1 )
+ {
+ $GLOBALS['phpgw']->redirect_link('/mobile/login.php');
+ }
+ else
+ {
/* Program starts here */
-
if($GLOBALS['phpgw_info']['server']['auth_type'] == 'http' && isset($_SERVER['PHP_AUTH_USER']))
{
@@ -106,5 +125,5 @@
}
- if( isset( $_GET[ 'cd' ] ) && ( $_GET['cd']=='1' || $_GET['cd'] == 10 ) )
+ if( isset( $_GET[ 'cd' ] ) && ( $_GET['cd']=='1' || $_GET['cd'] == 10 ) )
{
$_SESSION['contador'] = 0;
@@ -168,11 +187,11 @@
$login .= '@'.$GLOBALS['phpgw_info']['server']['default_domain'];
}
- If(!$_GET['cd'])
- $GLOBALS['sessionid'] = $GLOBALS['phpgw']->session->create(strtolower($login),$passwd,$passwd_type,'u');
+
+ If(!$_GET['cd'])
+ $GLOBALS['sessionid'] = $GLOBALS['phpgw']->session->create(strtolower($login),$passwd,$passwd_type,'u');
if(!isset($GLOBALS['sessionid']) || ! $GLOBALS['sessionid'])
{
-
- If(!$_GET['cd']) $_GET['cd'] = $GLOBALS['phpgw']->session->cd_reason;
+ If(!$_GET['cd']) $_GET['cd'] = $GLOBALS['phpgw']->session->cd_reason;
}
else
@@ -565,4 +584,5 @@
$tmpl->pfp('loginout','login_form');
+ }
?>