dolibarr  17.0.4
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 // Load Dolibarr environment
24 require '../../main.inc.php';
25 require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
26 require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
27 
28 $langs->load("admin");
29 
30 if (!$user->admin) {
32 }
33 
34 
35 /*
36  * Action
37  */
38 
39 // None
40 
41 
42 /*
43  * View
44  */
45 
46 llxHeader('', $langs->trans("InfoWebServer"));
47 
48 print load_fiche_titre($langs->trans("InfoWebServer"), '', 'title_setup');
49 
50 print '<div class="div-table-responsive-no-min">';
51 print '<table class="noborder centpercent">';
52 print '<tr class="liste_titre"><td>'.$langs->trans("Parameter")."</td><td>".$langs->trans("Value")."</td></tr>\n";
53 print '<tr class="oddeven"><td>'.$langs->trans("Version")."</td><td>".$_SERVER["SERVER_SOFTWARE"]."</td></tr>\n";
54 print '<tr class="oddeven"><td>'.$langs->trans("VirtualServerName")."</td><td>".$_SERVER["SERVER_NAME"]."</td></tr>\n";
55 print '<tr class="oddeven"><td>'.$langs->trans("IP")."</td><td>".$_SERVER["SERVER_ADDR"]."</td></tr>\n";
56 print '<tr><td>'.$langs->trans("Port")."</td><td>".$_SERVER["SERVER_PORT"]."</td></tr>\n";
57 print '<tr><td>'.$langs->trans("DocumentRootServer")."</td><td>".$_SERVER["DOCUMENT_ROOT"]."</td></tr>\n";
58 print '<tr><td>'.$langs->trans("DataRootServer")."</td><td>".DOL_DATA_ROOT."</td></tr>\n";
59 // Web user group by default
60 $labeluser = dol_getwebuser('user');
61 $labelgroup = dol_getwebuser('group');
62 if ($labeluser && $labelgroup) {
63  print '<tr><td>'.$langs->trans("WebUserGroup")." (env vars)</td><td>".$labeluser.':'.$labelgroup;
64  if (function_exists('posix_geteuid') && function_exists('posix_getpwuid')) {
65  $arrayofinfoofuser = posix_getpwuid(posix_geteuid());
66  print ' <span class="opacitymedium">(POSIX '.$arrayofinfoofuser['name'].':'.$arrayofinfoofuser['gecos'].':'.$arrayofinfoofuser['dir'].':'.$arrayofinfoofuser['shell'].')</span>';
67  }
68  print "</td></tr>\n";
69 }
70 // Web user group real (detected by 'id' external command)
71 if (function_exists('exec')) {
72  $arrayout = array(); $varout = 0;
73  exec('id', $arrayout, $varout);
74  print '<tr><td>'.$langs->trans("WebUserGroup")." (real, 'id' command)</td><td>";
75  if (empty($varout)) { // Test command is ok. Work only on Linux OS.
76  print join(',', $arrayout);
77  } else {
78  $langs->load("errors");
79  print '<span class="opacitymedium">'.$langs->trans("ErrorExecIdFailed").'</span>';
80  }
81  print "</td></tr>\n";
82 }
83 print '</table>';
84 print '</div>';
85 
86 llxFooter();
87 
88 $db->close();
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Definition: wrapper.php:56
llxFooter()
Empty footer.
Definition: wrapper.php:70
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
dol_getwebuser($mode)
Return user/group account of web server.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.