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 '