Index: branches/2.2/login.php
===================================================================
--- branches/2.2/login.php (revision 4200)
+++ branches/2.2/login.php (revision 5061)
@@ -28,40 +28,21 @@
$GLOBALS['sessionid'] = @$_GET['sessionid'] ? $_GET['sessionid'] : @$_COOKIE['sessionid'];
if(isset($GLOBALS['sessionid']) && $_GET['cd'] != 10)
- $GLOBALS['phpgw']->redirect_link('/home.php');
+ {
+ if( $_GET['cd'] != '66' )
+ {
+ $GLOBALS['phpgw']->redirect_link('/home.php');
+ }
+ }
+
if ($GLOBALS['phpgw_info']['server']['use_https'] > 0)
{
if ($_SERVER['HTTPS'] != 'on')
{
- Header('Location: https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
+ Header('Location: https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
exit;
}
}
- if(function_exists('CreateObject'))
- {
- if($_GET['dont_redirect_if_moble'] != 1) {
- //detect if the user has a compatible browser, if don't have send him to expresso mini
- $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:
- $GLOBALS['phpgw']->redirect_link('/mobile/');
- break;
- default:
- break;
- }
- }
- $GLOBALS['phpgw']->session = CreateObject('phpgwapi.sessions');
- }
- else
- {
- Header('Location: setup/index.php');
- exit;
- }
+ $GLOBALS['phpgw']->session = CreateObject('phpgwapi.sessions');
}
else
@@ -70,55 +51,78 @@
exit;
}
+
+ //detect if the user has a compatible browser, if don't have send him to expresso mini
+ $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;
+ }
- $GLOBALS['phpgw_info']['server']['template_dir'] = PHPGW_SERVER_ROOT . '/phpgwapi/templates/' . $GLOBALS['phpgw_info']['login_template_set'];
- $tmpl = CreateObject('phpgwapi.Template', $GLOBALS['phpgw_info']['server']['template_dir']);
-
- // read the images from the login-template-set, not the (maybe not even set) users template-set
- $GLOBALS['phpgw_info']['user']['preferences']['common']['template_set'] = $GLOBALS['phpgw_info']['login_template_set'];
-
- // This is used for system downtime, to prevent new logins.
- if($GLOBALS['phpgw_info']['server']['deny_all_logins'])
+ if( $ifMobile && $_GET['dont_redirect_if_moble'] != 1 )
{
- $deny_msg=lang('Oops! You caught us in the middle of system maintainance.
- Please, check back with us shortly.');
-
- $tmpl->set_file(array
- (
- 'login_form' => 'login_denylogin.tpl'
- ));
-
- $tmpl->set_var('template_set','default');
- $tmpl->set_var('deny_msg',$deny_msg);
- $tmpl->pfp('loginout','login_form');
- exit;
+ $GLOBALS['phpgw_info']['user']['preferences']['common']['lang'] = preg_replace("/\,.*/","",$GLOBALS['_SERVER']['HTTP_ACCEPT_LANGUAGE']);
+ if( $_GET['cd'] == '66' )
+ $GLOBALS['phpgw']->redirect_link('/mobile/login.php?cd=66');
+ else
+ $GLOBALS['phpgw']->redirect_link('/mobile/login.php');
}
- $tmpl->set_file(array('login_form' => 'login.tpl'));
-
- $tmpl->set_var('template',$GLOBALS['phpgw_info']['login_template_set']);
- $tmpl->set_var('lang',$_GET['lang']?$_GET['lang']:preg_replace("/\,.*/","",$GLOBALS['_SERVER']['HTTP_ACCEPT_LANGUAGE']));
-
- if (count($GLOBALS['phpgw_info']['server']['login_logo_file']) > 0)
- $tmpl->set_var('logo_config',$GLOBALS['phpgw_info']['server']['login_logo_file']);
else
- $tmpl->set_var('logo_config','
-