From a80f0afd46fb4f5c65cad9dd7a55715b1817ac3e Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 2 Oct 2007 15:33:13 +0000 Subject: [PATCH] =?UTF-8?q?ajout=20de=20l'option=20captcha=20dans=20l'ongl?= =?UTF-8?q?et=20"divers"=20de=20la=20s=E9curit=E9=20avec=20v=E9ification?= =?UTF-8?q?=20si=20php=5Fgd=20est=20actif?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/admin/security_other.php | 54 ++++++++++++++++++++++++++++++- htdocs/user/passwordforgotten.php | 2 +- 2 files changed, 54 insertions(+), 2 deletions(-) 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';