From 85825a01045a1dfc3c4b009d4b2c5712b17119ed Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 14 Oct 2020 00:57:39 +0200 Subject: [PATCH] Init page for security info --- htdocs/admin/system/perf.php | 2 +- htdocs/admin/system/security.php | 143 +++++++++++++++++++++++++++++++ 2 files changed, 144 insertions(+), 1 deletion(-) create mode 100644 htdocs/admin/system/security.php diff --git a/htdocs/admin/system/perf.php b/htdocs/admin/system/perf.php index ec6dc9d4a88..7857773924f 100644 --- a/htdocs/admin/system/perf.php +++ b/htdocs/admin/system/perf.php @@ -49,7 +49,7 @@ llxHeader(); print load_fiche_titre($langs->trans("PerfDolibarr"), '', 'title_setup'); -print $langs->trans("YouMayFindPerfAdviceHere", 'https://wiki.dolibarr.org/index.php/FAQ_Increase_Performance').' ('.$langs->trans("Reload").')
'; +print ''.$langs->trans("YouMayFindPerfAdviceHere", 'https://wiki.dolibarr.org/index.php/FAQ_Increase_Performance').' ('.$langs->trans("Reload").')
'; // Recupere la version de PHP $phpversion = version_php(); diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php new file mode 100644 index 00000000000..0cf70f2bbaa --- /dev/null +++ b/htdocs/admin/system/security.php @@ -0,0 +1,143 @@ + + * + * 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/admin/system/security.php + * \brief Page to show Security information + */ + +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; + +// Load translation files required by the page +$langs->loadLangs(array("install", "other", "admin")); + +if (!$user->admin) + accessforbidden(); + +if (GETPOST('action', 'aZ09') == 'donothing') +{ + exit; +} + + +/* + * View + */ + +$form = new Form($db); +$nowstring = dol_print_date(dol_now(), 'dayhourlog'); + +llxHeader(); + +print load_fiche_titre($langs->trans("Security"), '', 'title_setup'); + +print ''.$langs->trans("YouMayFindSecurityAdviceHere", 'hhttps://wiki.dolibarr.org/index.php/Security_information').' ('.$langs->trans("Reload").')
'; + +// Recupere la version de PHP +$phpversion = version_php(); +print "
PHP - ".$langs->trans("Version").": ".$phpversion."
\n"; + +// Recupere la version du serveur web +print "
Web server - ".$langs->trans("Version").": ".$_SERVER["SERVER_SOFTWARE"]."
\n"; +print '
'; + + +print load_fiche_titre($langs->trans("ConfigFile"), '', ''); + +print ''.$langs->trans("dolibarr_main_prod").': '.$dolibarr_main_prod; +// dolibarr_main_prod + + +print '
'; +print '
'; + +print load_fiche_titre($langs->trans("PermissionsOnFiles"), '', ''); + +print ''.$langs->trans("PermissionOnFileInWebRoot").': '; +// TODO + + +print '
'; +print '
'; + + +print load_fiche_titre($langs->trans("Modules"), '', ''); + +// XDebug +print ''.$langs->trans("XDebug").': '; +$test = !function_exists('xdebug_is_enabled'); +if ($test) print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled"); +else { + print img_picto('', 'warning').' '.$langs->trans("ModuleActivatedMayExposeInformation", $langs->transnoentities("XDebug")); + print ' - '.$langs->trans("MoreInformation").' XDebug admin page'; +} +print '
'; + +// Module log +print '
'; +print ''.$langs->trans("Syslog").': '; +$test = empty($conf->syslog->enabled); +if ($test) print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled"); +else { + print img_picto('', 'warning').' '.$langs->trans("ModuleActivatedMayExposeInformation", $langs->transnoentities("Syslog")); + //print ' '.$langs->trans("MoreInformation").' XDebug admin page'; +} +print '
'; + +// Module debugbar +print '
'; +print ''.$langs->trans("DebugBar").': '; +$test = empty($conf->debugbar->enabled); +if ($test) print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled"); +else { + print img_picto('', 'error').' '.$langs->trans("ModuleActivatedDoNotUseInProduction", $langs->transnoentities("DebugBar")); + //print ' '.$langs->trans("MoreInformation").' XDebug admin page'; +} +print '
'; +print '
'; + +print load_fiche_titre($langs->trans("SecuritySetup"), '', ''); + +//print ''.$langs->trans("PasswordEncryption").': '; +print 'MAIN_SECURITY_HASH_ALGO = '.$conf->global->MAIN_SECURITY_HASH_ALGO."   (Recommanded value: 'password_hash')
"; +print 'MAIN_SECURITY_SALT = '.$conf->global->MAIN_SECURITY_SALT.'
'; +print '
'; +// TODO + +print ''.$langs->trans("AntivirusEnabledOnUpload").': '; +// TODO +print '
'; + +print ''.$langs->trans("SecurityAudit").': '; +// TODO Disabled or enabled ? +print '
'; + + + + + + + + + +// End of page +llxFooter(); +$db->close();