Debug v18

This commit is contained in:
Laurent Destailleur
2023-07-02 16:51:18 +02:00
parent b4a5a326d9
commit af1b15eba5
5 changed files with 12 additions and 6 deletions

View File

@@ -44,7 +44,7 @@ class Conf
//! To store properties found into database
public $global;
//! To store browser info
//! To store browser info (->name, ->os, ->version, ->ua, ->layout, ...)
public $browser;
//! To store some setup of generic modules

View File

@@ -473,9 +473,10 @@ function getBrowserInfo($user_agent)
'browsername' => $name,
'browserversion' => $version,
'browseros' => $os,
'layout' => $layout,
'phone' => $phone,
'tablet' => $tablet
'browserua' => $user_agent,
'layout' => $layout, // tablet, phone, classic
'phone' => $phone, // deprecated
'tablet' => $tablet // deprecated
);
}

View File

@@ -86,7 +86,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
'position' => 10,
'id' => $id,
'idsel' => 'home',
'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "home") ? 'class="tmenusel"' : 'class="tmenu"',
'classname' => $classname = (empty($_SESSION["mainmenu"]) || $_SESSION["mainmenu"] == "home") ? 'class="tmenusel"' : 'class="tmenu"',
'prefix' => '<span class="fa fa-home fa-fw paddingright"></span>',
'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "home") ? 0 : 1),
'loadLangs' => array(),
@@ -722,6 +722,10 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
$mainmenu = ($forcemainmenu ? $forcemainmenu : $_SESSION["mainmenu"]);
$leftmenu = ($forceleftmenu ? '' : (empty($_SESSION["leftmenu"]) ? 'none' : $_SESSION["leftmenu"]));
if (is_null($mainmenu)) {
$mainmenu = 'home';
}
global $usemenuhider;
$usemenuhider = 0;

View File

@@ -352,7 +352,7 @@ if (isset($conf->file->main_authentication) && preg_match('/openid/', $conf->fil
print '</div>';
}
if (isset($conf->file->main_authentication) && preg_match('/google/', $conf->file->main_authentication)) {
if (isset($conf->file->main_authentication) && preg_match('/google/', $conf->file->main_authentication) && strpos($conf->browser->ua, 'DoliDroid') === false) {
$langs->load("users");
echo '<div class="center" style="margin-top: 20px; margin-bottom: 10px">';

View File

@@ -410,6 +410,7 @@ if (isset($_SERVER["HTTP_USER_AGENT"])) {
$conf->browser->name = $tmp['browsername'];
$conf->browser->os = $tmp['browseros'];
$conf->browser->version = $tmp['browserversion'];
$conf->browser->ua = $tmp['browserua'];
$conf->browser->layout = $tmp['layout']; // 'classic', 'phone', 'tablet'
//var_dump($conf->browser);