From 3c49a2b49a8bbdbe46877fe20796572cb3568931 Mon Sep 17 00:00:00 2001 From: Givriz Date: Wed, 21 Apr 2021 18:59:25 +0200 Subject: [PATCH] Compatibility phpv8 --- htdocs/admin/delais.php | 10 +++++----- htdocs/admin/security.php | 16 ++++++++-------- htdocs/admin/system/dolibarr.php | 4 ++-- htdocs/admin/system/modules.php | 14 +++++++------- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index 00f05152a86..0aeeb912c49 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -354,21 +354,21 @@ if (empty($conf->global->MAIN_DISABLE_METEO) || $conf->global->MAIN_DISABLE_METE print ''; - print '
global->MAIN_USE_METEO_WITH_PERCENTAGE) ? 'style="display:none;"' : '').'>'; + print '
'; print '
'; print '
'; print img_weather($text, 0, $options); - print ' <=  %'; + print ' <=  %'; print '
'; print img_weather($text, 1, $options); - print ' <=  %'; + print ' <=  %'; print '
'; print img_weather($text, 2, $options); - print ' <=  %'; + print ' <=  %'; print '
'; print img_weather($text, 3, $options); - print ' <=  %'; + print ' <=  %'; print '
'; print '
'; diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index 9ce22b7c08e..de6f0b3ff4b 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -394,18 +394,18 @@ print ''; print ''; print ''.$langs->trans("DoNotStoreClearPassword").''; print ''; -if (!empty($conf->global->DATABASE_PWD_ENCRYPTED)) { +if (getDolGlobalString('DATABASE_PWD_ENCRYPTED')) { print img_picto($langs->trans("Active"), 'tick'); } print ''; -if (!$conf->global->DATABASE_PWD_ENCRYPTED) { +if (!getDolGlobalString('DATABASE_PWD_ENCRYPTED')) { print ''; print ''.$langs->trans("Activate").''; print ""; } // Database conf file encryption -if (!empty($conf->global->DATABASE_PWD_ENCRYPTED)) { +if (getDolGlobalString('DATABASE_PWD_ENCRYPTED')) { print ''; if ($allow_disable_encryption) { //On n'autorise pas l'annulation de l'encryption car les mots de passe ne peuvent pas etre decodes @@ -453,16 +453,16 @@ print ''; print ''; print ''.$langs->trans("DisableForgetPasswordLinkOnLogonPage").''; print ''; -if (!empty($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK)) { +if (getDolGlobalString('MAIN_SECURITY_DISABLEFORGETPASSLINK')) { print img_picto($langs->trans("Active"), 'tick'); } print ''; -if (empty($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK)) { +if (!getDolGlobalString('MAIN_SECURITY_DISABLEFORGETPASSLINK')) { print ''; print ''.$langs->trans("Activate").''; print ""; } -if (!empty($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK)) { +if (getDolGlobalString('MAIN_SECURITY_DISABLEFORGETPASSLINK')) { print ''; print ''.$langs->trans("Disable").''; print ""; @@ -481,8 +481,8 @@ if (GETPOST('info', 'int') > 0) { } else { print $langs->trans("Note: The function password_hash does not exists on your PHP")."
\n"; } - print 'MAIN_SECURITY_HASH_ALGO = '.$conf->global->MAIN_SECURITY_HASH_ALGO."
\n"; - print 'MAIN_SECURITY_SALT = '.$conf->global->MAIN_SECURITY_SALT."
\n"; + print 'MAIN_SECURITY_HASH_ALGO = '.getDolGlobalString('MAIN_SECURITY_HASH_ALGO')."
\n"; + print 'MAIN_SECURITY_SALT = '.getDolGlobalString('MAIN_SECURITY_SALT')."
\n"; } print '
'; diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index b4131a4bdde..9af09164469 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -139,8 +139,8 @@ if (preg_match('/[a-z]+/i', $version)) { } print ''."\n"; -print ''.$langs->trans("VersionLastUpgrade").' ('.$langs->trans("Database").')'.$conf->global->MAIN_VERSION_LAST_UPGRADE.''."\n"; -print ''.$langs->trans("VersionLastInstall").''.$conf->global->MAIN_VERSION_LAST_INSTALL.''."\n"; +print ''.$langs->trans("VersionLastUpgrade").' ('.$langs->trans("Database").')'.getDolGlobalString('MAIN_VERSION_LAST_UPGRADE').''."\n"; +print ''.$langs->trans("VersionLastInstall").''.getDolGlobalString('MAIN_VERSION_LAST_INSTALL').''."\n"; print ''; print '
'; print '
'; diff --git a/htdocs/admin/system/modules.php b/htdocs/admin/system/modules.php index 51f3b4577cf..f1ec6bf7d69 100644 --- a/htdocs/admin/system/modules.php +++ b/htdocs/admin/system/modules.php @@ -25,7 +25,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -if (!$user->admin) { +if (empty($user->admin)) { accessforbidden(); } @@ -164,17 +164,17 @@ foreach ($modules as $key => $module) { $newModule->permission = $permission; // pre-filter list - if ($search_name && !stristr($newModule->name, $search_name)) { + if (!empty($search_name) && !stristr($newModule->name, $search_name)) { continue; } - if ($search_version && !stristr($newModule->version, $search_version)) { + if (!empty($search_version) && !stristr($newModule->version, $search_version)) { continue; } - if ($search_id && !stristr($newModule->id, $search_id)) { + if (!empty($search_id) && !stristr($newModule->id, $search_id)) { continue; } - if ($search_permission) { + if (!empty($search_permission)) { $found = false; foreach ($newModule->permission as $permission) { @@ -184,7 +184,7 @@ foreach ($modules as $key => $module) { } } - if (!$found) { + if (empty($found)) { continue; } } @@ -211,7 +211,7 @@ print ''; print ''; print ''; -print_barre_liste($langs->trans("AvailableModules"), $page, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, $massactionbutton, -1, '', 'title_setup', 0, '', '', 0, 1, 1); +print_barre_liste($langs->trans("AvailableModules"), empty($page) ? 0 : $page, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', -1, '', 'title_setup', 0, '', '', 0, 1, 1); print ''.$langs->trans("ToActivateModule").''; print '
';