dolibarr  16.0.5
web.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <https://www.gnu.org/licenses/>.
16  */
17 
23 require '../../main.inc.php';
24 require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
25 require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
26 
27 $langs->load("admin");
28 
29 if (!$user->admin) {
31 }
32 
33 
34 /*
35  * Action
36  */
37 
38 // None
39 
40 
41 /*
42  * View
43  */
44 
45 llxHeader('', $langs->trans("InfoWebServer"));
46 
47 print load_fiche_titre($langs->trans("InfoWebServer"), '', 'title_setup');
48 
49 print '<div class="div-table-responsive-no-min">';
50 print '<table class="noborder centpercent">';
51 print '<tr class="liste_titre"><td>'.$langs->trans("Parameter")."</td><td>".$langs->trans("Value")."</td></tr>\n";
52 print '<tr class="oddeven"><td>'.$langs->trans("Version")."</td><td>".$_SERVER["SERVER_SOFTWARE"]."</td></tr>\n";
53 print '<tr class="oddeven"><td>'.$langs->trans("VirtualServerName")."</td><td>".$_SERVER["SERVER_NAME"]."</td></tr>\n";
54 print '<tr class="oddeven"><td>'.$langs->trans("IP")."</td><td>".$_SERVER["SERVER_ADDR"]."</td></tr>\n";
55 print '<tr><td>'.$langs->trans("Port")."</td><td>".$_SERVER["SERVER_PORT"]."</td></tr>\n";
56 print '<tr><td>'.$langs->trans("DocumentRootServer")."</td><td>".$_SERVER["DOCUMENT_ROOT"]."</td></tr>\n";
57 print '<tr><td>'.$langs->trans("DataRootServer")."</td><td>".DOL_DATA_ROOT."</td></tr>\n";
58 // Web user group by default
59 $labeluser = dol_getwebuser('user');
60 $labelgroup = dol_getwebuser('group');
61 if ($labeluser && $labelgroup) {
62  print '<tr><td>'.$langs->trans("WebUserGroup")." (env vars)</td><td>".$labeluser.':'.$labelgroup;
63  if (function_exists('posix_geteuid') && function_exists('posix_getpwuid')) {
64  $arrayofinfoofuser = posix_getpwuid(posix_geteuid());
65  print ' <span class="opacitymedium">(POSIX '.$arrayofinfoofuser['name'].':'.$arrayofinfoofuser['gecos'].':'.$arrayofinfoofuser['dir'].':'.$arrayofinfoofuser['shell'].')</span>';
66  }
67  print "</td></tr>\n";
68 }
69 // Web user group real (detected by 'id' external command)
70 if (function_exists('exec')) {
71  $arrayout = array(); $varout = 0;
72  exec('id', $arrayout, $varout);
73  print '<tr><td>'.$langs->trans("WebUserGroup")." (real, 'id' command)</td><td>";
74  if (empty($varout)) { // Test command is ok. Work only on Linux OS.
75  print join(',', $arrayout);
76  } else {
77  $langs->load("errors");
78  print '<span class="opacitymedium">'.$langs->trans("ErrorExecIdFailed").'</span>';
79  }
80  print "</td></tr>\n";
81 }
82 print '</table>';
83 print '</div>';
84 
85 llxFooter();
86 
87 $db->close();
llxFooter
llxFooter()
Empty footer.
Definition: wrapper.php:73
load_fiche_titre
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
Definition: functions.lib.php:5204
accessforbidden
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
Definition: security.lib.php:933
dol_getwebuser
dol_getwebuser($mode)
Return user/group account of web server.
Definition: security2.lib.php:35
llxHeader
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Definition: wrapper.php:59