diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php index ab832bbf4f8..dfc4772c583 100644 --- a/htdocs/admin/security_other.php +++ b/htdocs/admin/security_other.php @@ -51,6 +51,18 @@ if ($_GET["action"] == 'set_main_upload_doc') } } +if ($_GET["action"] == 'activate_captcha') +{ + dolibarr_set_const($db, "MAIN_SECURITY_ENABLECAPTCHA", '1'); + Header("Location: security_other.php"); + exit; +} +else if ($_GET["action"] == 'disable_captcha') +{ + dolibarr_del_const($db, "MAIN_SECURITY_ENABLECAPTCHA"); + Header("Location: security_other.php"); + exit; +} /* @@ -111,7 +123,47 @@ print ''; print ''; print ''; -//print ''; +print '
'; + +// Autre Options + +$var=true; + +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; + +// Disable clear password in database +if (function_exists("imagecreatefrompng")) +{ + $var=!$var; + print ""; + print ''; + print ''; + print '"; + + print ""; + print ''; +} + +print '
'.$langs->trans("Parameters").''.$langs->trans("Activated").''.$langs->trans("Action").'
'.$langs->trans("UseCaptchaCode").''; + if($conf->global->MAIN_SECURITY_ENABLECAPTCHA == 1) + { + print img_tick(); + } + print ''; + if ($conf->global->MAIN_SECURITY_ENABLECAPTCHA == 0) + { + print ''.$langs->trans("Activate").''; + } + if($conf->global->MAIN_SECURITY_ENABLECAPTCHA == 1) + { + print ''.$langs->trans("Disable").''; + } + print "
'; print ''; diff --git a/htdocs/user/passwordforgotten.php b/htdocs/user/passwordforgotten.php index 837182e24c7..96bd8d9ebf5 100644 --- a/htdocs/user/passwordforgotten.php +++ b/htdocs/user/passwordforgotten.php @@ -232,7 +232,7 @@ print '>'; print ''."\n"; -if (function_exists("imagecreatefrompng") && ! $disabled) +if ($conf->global->MAIN_SECURITY_ENABLECAPTCHA && ! $disabled) { //print "Info session: ".session_name().session_id();print_r($_SESSION); $cryptinstall = DOL_URL_ROOT.'/includes/cryptographp';