Look and feel v22

This commit is contained in:
ldestailleur
2025-04-01 21:32:56 +02:00
parent f7d034a71c
commit a9568c448c
6 changed files with 61 additions and 9 deletions

View File

@@ -148,7 +148,7 @@ print "</form>\n";
$s = $langs->trans("SeeReportPage", '{s1}'.$langs->transnoentities("Home").' - '.$langs->transnoentities("AdminTools").' - '.$langs->transnoentities("Audit").'{s2}');
print str_replace('{s2}', '</a>', str_replace('{s1}', '<a href="'.DOL_URL_ROOT.'/admin/tools/listevents.php" target="_blank">', $s));
print str_replace('{s2}', '</a>', str_replace('{s1}', '<a href="'.DOL_URL_ROOT.'/admin/tools/listevents.php" target="_blank">'.img_picto('', 'url', 'class="pictofixedwidth"'), $s));

View File

@@ -135,7 +135,7 @@ print dol_get_fiche_head($head, 'captcha', '', -1);
print '<br>';
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 '<br>';
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 '<a href="'.$_SERVER['PHP_SELF'].'?action=set_MAIN_SECURITY_ENABLECAPTCHA_THIRDPARTY&token='.newToken().'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
} else {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_MAIN_SECURITY_ENABLECAPTCHA_THIRDPARTY&token='.newToken().'">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
}
}
}
if (isModEnabled('ticket')) {
print '<br>';
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 '<br>';
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 '<a href="'.$_SERVER['PHP_SELF'].'?action=set_MAIN_SECURITY_ENABLECAPTCHA_MEMBER&token='.newToken().'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
} else {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_MAIN_SECURITY_ENABLECAPTCHA_MEMBER&token='.newToken().'">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
}
}
}
// 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');

View File

@@ -429,12 +429,29 @@ print load_fiche_titre($langs->trans("Menu").' '.$langs->trans("SecuritySetup"),
print '<div class="divsection wordbreak">';
print '<strong>'.$langs->trans("UseCaptchaCode").'</strong>: ';
print '<strong>'.$langs->trans("UseCaptchaCode").' - Login</strong>: ';
print !getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA') ? '' : img_picto('', 'tick').' ';
print yn(!getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA') ? 0 : 1);
print '<br>';
print '<br>';
print '<strong>'.$langs->trans("UseCaptchaCode").' - Ticket</strong>: ';
print !getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA_TICKET') ? '' : img_picto('', 'tick').' ';
print yn(!getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA_TICKET') ? 0 : 1);
print '<br>';
print '<br>';
print '<strong>'.$langs->trans("UseCaptchaCode").' - Thirdparty public contact form</strong>: ';
print !getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA_THIRPARTY') ? '' : img_picto('', 'tick').' ';
print yn(!getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA_THIRPARTY') ? 0 : 1);
print '<br>';
print '<br>';
print '<strong>'.$langs->trans("UseCaptchaCode").' - Membership subscription</strong>: ';
print !getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA_MEMBER') ? '' : img_picto('', 'tick').' ';
print yn(!getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA_MEMBER') ? 0 : 1);
print '<br>';
print '<br>';
$sessiontimeout = ini_get("session.gc_maxlifetime");
if (!getDolGlobalString('MAIN_SESSION_TIMEOUT')) {

View File

@@ -111,7 +111,7 @@ NextValueForReplacements=Next value (replacements)
MustBeLowerThanPHPLimit=Note: your PHP configuration currently limits the maximum filesize for upload to <b>%s</b> %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<br>Example for ClamWin (very very slow): c:\\Progra~1\\ClamWin\\bin\\clamscan.exe
AntiVirusParam= More parameters on command line

View File

@@ -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 '<tr><td class="titlefield"><label for="email"><span class="fieldrequired">' . $langs->trans("SecurityCode") . '</span></label></td><td>';
print '<span class="span-icon-security inline-block">';

View File

@@ -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 '<tr><td class="titlefield"><label><span class="fieldrequired">'.$langs->trans("SecurityCode").'</span></label></td><td>';
print '<span class="span-icon-security inline-block">';