From a18a2d4844203f26c29a61f7c93eb88bf5ae73b1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 15 Sep 2007 01:26:58 +0000 Subject: [PATCH] Fix: Si fonction GD non active, affichage code graphique desactive. --- htdocs/user.class.php | 2 +- htdocs/user/passwordforgotten.php | 28 +++++++++++++++------------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/htdocs/user.class.php b/htdocs/user.class.php index 8e8c31cd07d..db7a2593b8e 100644 --- a/htdocs/user.class.php +++ b/htdocs/user.class.php @@ -1248,7 +1248,7 @@ class User } else { - $this->error=$langs->trans("ErrorFailedToSendPassword"); + $this->error=$langs->trans("ErrorFailedToSendPassword").' '.$mailfile->error; //print nl2br($mesg); return -1; } diff --git a/htdocs/user/passwordforgotten.php b/htdocs/user/passwordforgotten.php index 7aa90d7cfb6..837182e24c7 100644 --- a/htdocs/user/passwordforgotten.php +++ b/htdocs/user/passwordforgotten.php @@ -78,7 +78,7 @@ if ($_GET["action"] == 'validatenewpassword' && $_GET["username"] && $_GET["pass if ($_POST["action"] == 'buildnewpassword' && $_POST["username"]) { // Verifie code - if (! chk_crypt($_POST['code'])) + if (function_exists("imagecreatefrompng") && ! chk_crypt($_POST['code'])) { $message = '
'.$langs->trans("ErrorBadValueForCode").'
'; } @@ -195,15 +195,17 @@ else print ''."\n"; print '
'."\n"; +// Send password button enabled ? +$disabled='disabled'; +if ($mode == 'dolibarr' || $mode == 'dolibarr_mdb2') $disabled=''; +if ($conf->global->MAIN_SECURITY_ENABLE_SENDPASSWORD) $disabled=''; // To force button enabled + // Table 2 print ''."\n"; print ''."\n"; print ''; -$disabled='disabled'; -if ($mode == 'dolibarr' || $mode == 'dolibarr_mdb2') $disabled=''; - print ''; $title=''; @@ -230,16 +232,16 @@ print '>'; print ''."\n"; -if ($conf->global->MAIN_SECURITY_ENABLECAPTCHA && !$disabled) +if (function_exists("imagecreatefrompng") && ! $disabled) { //print "Info session: ".session_name().session_id();print_r($_SESSION); - $cryptinstall = DOL_URL_ROOT.'/includes/cryptographp'; - print ''; - print ''; - print ''; - print ''; + $cryptinstall = DOL_URL_ROOT.'/includes/cryptographp'; + print ''; + print ''; + print ''; + print ''; } print "".''."\n"; @@ -249,7 +251,7 @@ print ""."\n"; print '
'."\n"; print '
 
  '.$langs->trans("Login").'  
  '.$langs->trans("SecurityCode").''; - dsp_crypt('dolibarr.cfg.php',1); - print '
  '.$langs->trans("SecurityCode").''; + dsp_crypt('dolibarr.cfg.php',1); + print '
'; -if (($mode == 'dolibarr' || $mode == 'dolibarr_mdb2')) +if (($mode == 'dolibarr' || $mode == 'dolibarr_mdb2') || (! $disabled)) { print ''.$langs->trans("SendNewPasswordDesc").''."\n"; }