diff --git a/ChangeLog b/ChangeLog index d40521e4833..974e864518f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -87,7 +87,7 @@ For developers: - If module numberwords is installed, code can use langs->getLabelFromNumber to get value of an amount in text. - A module can add subsitution keys in makesubsitutions() functions. - +- Add $conf->browser->phone defined to optimise code for smartphone browsers. ***** Changelog for 2.6 compared to 2.5 ***** diff --git a/htdocs/lib/security.lib.php b/htdocs/lib/security.lib.php index 95c2e0a4ef9..a8abc1b4536 100644 --- a/htdocs/lib/security.lib.php +++ b/htdocs/lib/security.lib.php @@ -163,7 +163,6 @@ function dol_loginfunction($langs,$conf,$mysoc) print '" tabindex="1" />'; // Show logo (search in order: small company logo, large company logo, theme logo, common logo) - $title=''; $width=0; $urllogo=DOL_URL_ROOT.'/theme/login_logo.png'; if (! empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) @@ -179,9 +178,14 @@ function dol_loginfunction($langs,$conf,$mysoc) { $urllogo=DOL_URL_ROOT.'/theme/dolibarr_logo.png'; } - print 'Logo'; + print ''; + if (empty($conf->browser->phone)) + { + print 'Logo'; + } + print ''; print ''."\n"; // Password field diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 24b0a7515b1..21979ce5077 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -894,6 +894,9 @@ function top_menu($head, $title='', $target='') $htmltext.='
'.$langs->trans("AuthenticationMode").': '.$_SESSION["dol_authmode"]; $htmltext.='
'.$langs->trans("CurrentTheme").': '.$conf->theme; $htmltext.='
'.$langs->trans("CurrentUserLanguage").': '.$langs->getDefaultLang(); + $htmltext.='
'.$langs->trans("Browser").': '.$conf->browser->name.' ('.$_SERVER['HTTP_USER_AGENT'].')'; + if (! empty($conf->browser->phone)) $htmltext.='
'.$langs->trans("Phone").': '.$conf->browser->phone; + if (! empty($_SESSION["disablemodules"])) $htmltext.='
'.$langs->trans("DisabledModules").':
'.join('
',split(',',$_SESSION["disablemodules"])); // print 'browser->name='firefox'; elseif (eregi('iceweasel',$_SERVER["HTTP_USER_AGENT"])) $conf->browser->name='iceweasel'; elseif (eregi('safari',$_SERVER["HTTP_USER_AGENT"])) $conf->browser->name='safari'; @@ -178,6 +179,16 @@ if (isset($_SERVER["HTTP_USER_AGENT"])) elseif (eregi('opera',$_SERVER["HTTP_USER_AGENT"])) $conf->browser->name='opera'; elseif (eregi('msie',$_SERVER["HTTP_USER_AGENT"])) $conf->browser->name='ie'; else $conf->browser->name='unknown'; + // If phone/smartphone, we set osname. + if (eregi('android',$_SERVER["HTTP_USER_AGENT"])) $conf->browser->phone='android'; + elseif (eregi('blackberry',$_SERVER["HTTP_USER_AGENT"])) $conf->browser->phone='blackberry'; + elseif (eregi('iphone',$_SERVER["HTTP_USER_AGENT"])) $conf->browser->phone='iphone'; + elseif (eregi('palm',$_SERVER["HTTP_USER_AGENT"])) $conf->browser->phone='palm'; + elseif (eregi('symbian',$_SERVER["HTTP_USER_AGENT"])) $conf->browser->phone='symbian'; + elseif (eregi('webos',$_SERVER["HTTP_USER_AGENT"])) $conf->browser->phone='webos'; + elseif (eregi('iemobile',$_SERVER["HTTP_USER_AGENT"])) $conf->browser->phone='windowsmobile'; + elseif (eregi('windows ce',$_SERVER["HTTP_USER_AGENT"])) $conf->browser->phone='windowsmobile'; + // Other if (in_array($conf->browser->name,array('firefox','iceweasel'))) $conf->browser->firefox=1; }