dolibarr 20.0.2
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
24require '../../main.inc.php';
25require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
26require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
27
28$langs->load("admin");
29
30if (!$user->admin) {
32}
33
34
35/*
36 * Action
37 */
38
39// None
40
41
42/*
43 * View
44 */
45
46llxHeader('', $langs->trans("InfoWebServer"), '', '', 0, 0, '', '', '', 'mod-admin page-system_web');
47
48print load_fiche_titre($langs->trans("InfoWebServer"), '', 'title_setup');
49
50print '<div class="div-table-responsive-no-min">';
51print '<table class="noborder centpercent">';
52print '<tr class="liste_titre"><td>'.$langs->trans("Parameter")."</td><td>".$langs->trans("Value")."</td></tr>\n";
53print '<tr class="oddeven"><td>'.$langs->trans("Version")."</td><td>".$_SERVER["SERVER_SOFTWARE"]."</td></tr>\n";
54print '<tr class="oddeven"><td>'.$langs->trans("VirtualServerName")."</td><td>".$_SERVER["SERVER_NAME"]."</td></tr>\n";
55print '<tr class="oddeven"><td>'.$langs->trans("IP")."</td><td>".$_SERVER["SERVER_ADDR"]."</td></tr>\n";
56print '<tr><td>'.$langs->trans("Port")."</td><td>".$_SERVER["SERVER_PORT"]."</td></tr>\n";
57print '<tr><td>'.$langs->trans("DocumentRootServer")."</td><td>".$_SERVER["DOCUMENT_ROOT"]."</td></tr>\n";
58print '<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');
62if ($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)
71if (function_exists('exec')) {
72 $arrayout = array();
73 $varout = 0;
74 exec('id', $arrayout, $varout);
75 print '<tr><td>'.$langs->trans("WebUserGroup")." (real, 'id' command)</td><td>";
76 if (empty($varout)) { // Test command is ok. Work only on Linux OS.
77 print implode(',', $arrayout);
78 } else {
79 $langs->load("errors");
80 print '<span class="opacitymedium">'.$langs->trans("ErrorExecIdFailed").'</span>';
81 }
82 print "</td></tr>\n";
83}
84print '</table>';
85print '</div>';
86
87llxFooter();
88
89$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:55
llxFooter()
Empty footer.
Definition wrapper.php:69
load_fiche_titre($title, $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.