From a9568c448ce6abf39cc70acd98de4287e28f30d2 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Tue, 1 Apr 2025 21:32:56 +0200 Subject: [PATCH] Look and feel v22 --- htdocs/admin/events.php | 2 +- htdocs/admin/security_captcha.php | 39 +++++++++++++++++++++++++++++-- htdocs/admin/system/security.php | 19 ++++++++++++++- htdocs/langs/en_US/admin.lang | 2 +- htdocs/public/company/new.php | 4 ++-- htdocs/public/members/new.php | 4 ++-- 6 files changed, 61 insertions(+), 9 deletions(-) diff --git a/htdocs/admin/events.php b/htdocs/admin/events.php index 44eb9d6e571..f25571cb52c 100644 --- a/htdocs/admin/events.php +++ b/htdocs/admin/events.php @@ -148,7 +148,7 @@ print "\n"; $s = $langs->trans("SeeReportPage", '{s1}'.$langs->transnoentities("Home").' - '.$langs->transnoentities("AdminTools").' - '.$langs->transnoentities("Audit").'{s2}'); -print str_replace('{s2}', '', str_replace('{s1}', '', $s)); +print str_replace('{s2}', '', str_replace('{s1}', ''.img_picto('', 'url', 'class="pictofixedwidth"'), $s)); diff --git a/htdocs/admin/security_captcha.php b/htdocs/admin/security_captcha.php index 5cf9abc5506..0128605a0eb 100644 --- a/htdocs/admin/security_captcha.php +++ b/htdocs/admin/security_captcha.php @@ -135,7 +135,7 @@ print dol_get_fiche_head($head, 'captcha', '', -1); print '
'; -print $langs->trans("UseCaptchaCode"); +print $langs->trans("UseCaptchaCode").' - Login'; if (!empty($conf->use_javascript_ajax)) { print ajax_constantonoff('MAIN_SECURITY_ENABLECAPTCHA', array(), null, 0, 0, 1); } else { @@ -146,9 +146,23 @@ if (!empty($conf->use_javascript_ajax)) { } } +if (isModEnabled('societe')) { + print '
'; + print $langs->trans("UseCaptchaCode").' - Thirdparty public contact form'; + if (!empty($conf->use_javascript_ajax)) { + print ajax_constantonoff('MAIN_SECURITY_ENABLECAPTCHA_THIRDPARTY', array(), null, 0, 0, 1); + } else { + if (!getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA_THIRDPARTY')) { + print '
'.img_picto($langs->trans("Disabled"), 'off').''; + } else { + print ''.img_picto($langs->trans("Enabled"), 'on').''; + } + } +} + if (isModEnabled('ticket')) { print '
'; - print $langs->trans("TicketUseCaptchaCodeHelp"); + print $langs->trans("UseCaptchaCode").' - Public ticket creation'; if (!empty($conf->use_javascript_ajax)) { print ajax_constantonoff('MAIN_SECURITY_ENABLECAPTCHA_TICKET', array(), null, 0, 0, 1); } else { @@ -160,13 +174,34 @@ if (isModEnabled('ticket')) { } } +if (isModEnabled('member')) { + print '
'; + print $langs->trans("UseCaptchaCode").' - Membership public subcription'; + if (!empty($conf->use_javascript_ajax)) { + print ajax_constantonoff('MAIN_SECURITY_ENABLECAPTCHA_MEMBER', array(), null, 0, 0, 1); + } else { + if (!getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA_MEMBER')) { + print ''.img_picto($langs->trans("Disabled"), 'off').''; + } else { + print ''.img_picto($langs->trans("Enabled"), 'on').''; + } + } +} + +// Set if a captcha is used on at least one place $showavailablecaptcha = 0; if (getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA')) { $showavailablecaptcha = 1; } +if (isModEnabled('societe') && getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA_THIRDPARTY')) { + $showavailablecaptcha = 1; +} if (isModEnabled('ticket') && getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA_TICKET')) { $showavailablecaptcha = 1; } +if (isModEnabled('member') && getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA_MEMBER')) { + $showavailablecaptcha = 1; +} $selectedcaptcha = getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA_HANDLER', 'standard'); diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index 1ab324800bc..0581f79dc72 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -429,12 +429,29 @@ print load_fiche_titre($langs->trans("Menu").' '.$langs->trans("SecuritySetup"), print '
'; -print ''.$langs->trans("UseCaptchaCode").': '; +print ''.$langs->trans("UseCaptchaCode").' - Login: '; print !getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA') ? '' : img_picto('', 'tick').' '; print yn(!getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA') ? 0 : 1); print '
'; print '
'; +print ''.$langs->trans("UseCaptchaCode").' - Ticket: '; +print !getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA_TICKET') ? '' : img_picto('', 'tick').' '; +print yn(!getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA_TICKET') ? 0 : 1); +print '
'; +print '
'; + +print ''.$langs->trans("UseCaptchaCode").' - Thirdparty public contact form: '; +print !getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA_THIRPARTY') ? '' : img_picto('', 'tick').' '; +print yn(!getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA_THIRPARTY') ? 0 : 1); +print '
'; +print '
'; + +print ''.$langs->trans("UseCaptchaCode").' - Membership subscription: '; +print !getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA_MEMBER') ? '' : img_picto('', 'tick').' '; +print yn(!getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA_MEMBER') ? 0 : 1); +print '
'; +print '
'; $sessiontimeout = ini_get("session.gc_maxlifetime"); if (!getDolGlobalString('MAIN_SESSION_TIMEOUT')) { diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index be4e4146655..187b172e56a 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -111,7 +111,7 @@ NextValueForReplacements=Next value (replacements) MustBeLowerThanPHPLimit=Note: your PHP configuration currently limits the maximum filesize for upload to %s %s, irrespective of the value of this parameter NoMaxSizeByPHPLimit=Note: No limit is set in your PHP configuration MaxSizeForUploadedFiles=Maximum size for uploaded files (0 to disallow any upload) -UseCaptchaCode=Use graphical code (CAPTCHA) on login page and some public pages +UseCaptchaCode=Use graphical code (CAPTCHA) AntiVirusCommand=Full path to antivirus command AntiVirusCommandExample=Example for ClamAv Daemon (require clamav-daemon): /usr/bin/clamdscan
Example for ClamWin (very very slow): c:\\Progra~1\\ClamWin\\bin\\clamscan.exe AntiVirusParam= More parameters on command line diff --git a/htdocs/public/company/new.php b/htdocs/public/company/new.php index e52cc805ecd..282f79b52c0 100644 --- a/htdocs/public/company/new.php +++ b/htdocs/public/company/new.php @@ -213,7 +213,7 @@ if (empty($reshook) && $action == 'add') { // Test on permission not required he } // Check Captcha code if is enabled - if (getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA')) { + if (getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA_THIRDPARTY')) { $sessionkey = 'dol_antispam_value'; $ok = (array_key_exists($sessionkey, $_SESSION) && (strtolower($_SESSION[$sessionkey]) == strtolower(GETPOST('code')))); if (!$ok) { @@ -461,7 +461,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; // TODO Move this into generic feature. // Display Captcha code if is enabled -if (getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA')) { +if (getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA_THIRDPARTY')) { require_once DOL_DOCUMENT_ROOT . '/core/lib/security2.lib.php'; print ''; print ''; diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 51c4191195d..96b2f9eced8 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -275,7 +275,7 @@ if (empty($reshook) && $action == 'add') { // Test on permission not required he } // Check Captcha code if is enabled - if (getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA')) { + if (getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA_MEMBER')) { $sessionkey = 'dol_antispam_value'; $ok = (array_key_exists($sessionkey, $_SESSION) && (strtolower($_SESSION[$sessionkey]) == strtolower(GETPOST('code')))); if (!$ok) { @@ -827,7 +827,7 @@ if (getDolGlobalString('MEMBER_SKIP_TABLE') || getDolGlobalString('MEMBER_NEWFOR } // Display Captcha code if is enabled - if (getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA')) { + if (getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA_MEMBER')) { require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; print ''; print '';