Skip to content

Commit

Permalink
FIX use $conf->browser object + clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
hregis committed Mar 26, 2024
1 parent 1b98d99 commit 916484b
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions htdocs/admin/system/browser.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2005-2023 Laurent Destailleur <[email protected]>
* Copyright (C) 2007 Rodolphe Quiedeville <[email protected]>
* Copyright (C) 2007-2012 Regis Houssin <[email protected]>
* Copyright (C) 2007-2024 Regis Houssin <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -24,13 +24,11 @@

// Load Dolibarr environment
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';

// Load translation files required by the page
$langs->loadLangs(array("install", "other", "admin"));

if (!$user->admin) {
if (empty($user->admin)) {
accessforbidden();
}

Expand All @@ -39,23 +37,19 @@
* View
*/

$form = new Form($db);

llxHeader();

print load_fiche_titre($langs->trans("InfoBrowser"), '', 'title_setup');

$tmp = getBrowserInfo($_SERVER["HTTP_USER_AGENT"]);

// Browser
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td colspan="2">'.$langs->trans("Value").'</td></tr>'."\n";
print '<tr class="oddeven"><td width="300">'.$langs->trans("UserAgent").'</td><td colspan="2">'.dol_escape_htmltag($_SERVER['HTTP_USER_AGENT']).'</td></tr>'."\n";
print '<tr class="oddeven"><td width="300">'.$langs->trans("BrowserName").'</td><td colspan="2">'.$tmp['browsername'].'</td></tr>'."\n";
print '<tr class="oddeven"><td width="300">'.$langs->trans("BrowserOS").'</td><td colspan="2">'.$tmp['browseros'].'</td></tr>'."\n";
print '<tr class="oddeven"><td width="300">'.$langs->trans("Version").'</td><td colspan="2">'.$tmp['browserversion'].'</td></tr>'."\n";
print '<tr class="oddeven"><td width="300">'.$langs->trans("Layout").' (phone/tablet/classic)</td><td colspan="2">'.$tmp['layout'].'</td></tr>'."\n";
print '<tr class="oddeven"><td width="300">'.$langs->trans("UserAgent").'</td><td colspan="2">'.dol_escape_htmltag($conf->browser->ua).'</td></tr>'."\n";
print '<tr class="oddeven"><td width="300">'.$langs->trans("BrowserName").'</td><td colspan="2">'.$conf->browser->name.'</td></tr>'."\n";
print '<tr class="oddeven"><td width="300">'.$langs->trans("BrowserOS").'</td><td colspan="2">'.$conf->browser->os.'</td></tr>'."\n";
print '<tr class="oddeven"><td width="300">'.$langs->trans("Version").'</td><td colspan="2">'.$conf->browser->version.'</td></tr>'."\n";
print '<tr class="oddeven"><td width="300">'.$langs->trans("Layout").' (phone/tablet/classic)</td><td colspan="2">'.$conf->browser->layout.'</td></tr>'."\n";
print '<tr class="oddeven"><td width="300">'.$langs->trans("IPAddress").'</td><td colspan="2">'.dol_escape_htmltag($_SERVER['REMOTE_ADDR']);
if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
print ' (HTTP_CLIENT_IP='.dol_escape_htmltag($_SERVER['HTTP_CLIENT_IP']).')';
Expand Down

0 comments on commit 916484b

Please sign in to comment.