dolibarr 21.0.0-beta
web.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <https://www.gnu.org/licenses/>.
17 */
18
24// Load Dolibarr environment
25require '../../main.inc.php';
26require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
27require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
28
37$langs->load("admin");
38
39if (!$user->admin) {
41}
42
43
44/*
45 * Action
46 */
47
48// None
49
50
51/*
52 * View
53 */
54
55llxHeader('', $langs->trans("InfoWebServer"), '', '', 0, 0, '', '', '', 'mod-admin page-system_web');
56
57print load_fiche_titre($langs->trans("InfoWebServer"), '', 'title_setup');
58
59print '<div class="div-table-responsive-no-min">';
60print '<table class="noborder centpercent">';
61print '<tr class="liste_titre"><td>'.$langs->trans("Parameter")."</td><td></td></tr>\n";
62print '<tr class="oddeven"><td>'.$langs->trans("Version")."</td><td>".$_SERVER["SERVER_SOFTWARE"]."</td></tr>\n";
63print '<tr class="oddeven"><td>'.$langs->trans("VirtualServerName")."</td><td>".$_SERVER["SERVER_NAME"]."</td></tr>\n";
64print '<tr class="oddeven"><td>'.$langs->trans("IP")."</td><td>".$_SERVER["SERVER_ADDR"]."</td></tr>\n";
65print '<tr><td>'.$langs->trans("Port")."</td><td>".$_SERVER["SERVER_PORT"]."</td></tr>\n";
66print '<tr><td>'.$langs->trans("DocumentRootServer")."</td><td>".$_SERVER["DOCUMENT_ROOT"]."</td></tr>\n";
67print '<tr><td>'.$langs->trans("DataRootServer")."</td><td>".DOL_DATA_ROOT."</td></tr>\n";
68// Web user group by default
69$labeluser = dol_getwebuser('user');
70$labelgroup = dol_getwebuser('group');
71if ($labeluser && $labelgroup) {
72 print '<tr><td>'.$langs->trans("WebUserGroup")." (env vars)</td><td>".$labeluser.':'.$labelgroup;
73 if (function_exists('posix_geteuid') && function_exists('posix_getpwuid')) {
74 $arrayofinfoofuser = posix_getpwuid(posix_geteuid());
75 print ' <span class="opacitymedium">(POSIX '.$arrayofinfoofuser['name'].':'.$arrayofinfoofuser['gecos'].':'.$arrayofinfoofuser['dir'].':'.$arrayofinfoofuser['shell'].')</span>';
76 }
77 print "</td></tr>\n";
78}
79// Web user group real (detected by 'id' external command)
80if (function_exists('exec')) {
81 $arrayout = array();
82 $varout = 0;
83 exec('id', $arrayout, $varout);
84 print '<tr><td>'.$langs->trans("WebUserGroup")." (real, 'id' command)</td><td>";
85 if (empty($varout)) { // Test command is ok. Work only on Linux OS.
86 print implode(',', $arrayout);
87 } else {
88 $langs->load("errors");
89 print '<span class="opacitymedium">'.$langs->trans("ErrorExecIdFailed").'</span>';
90 }
91 print "</td></tr>\n";
92}
93print '</table>';
94print '</div>';
95
96llxFooter();
97
98$db->close();
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Definition wrapper.php:71
llxFooter()
Footer empty.
Definition document.php:107
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.