diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index 2709d08d4be..97348d59d8f 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -194,7 +194,7 @@ if ($_REQUEST["action"] == 'update' && ! $_POST["cancel"]) { if (isset($_POST["password"]) && $_POST["password"] !='') { - $ret=$edituser->password($user,$password,$conf->password_encrypted,1); + $ret=$edituser->password($user,$password,$conf->password_encrypted,0); if ($ret < 0) { $message.='
'.$edituser->error.'
'; @@ -333,7 +333,7 @@ if ($_POST["action"] == 'add') { if (isset($_POST['password']) && trim($_POST['password'])) { - $adh->password($user,trim($_POST['password']),$conf->password_encrypted); + $adh->password($user,trim($_POST['password']),0); } if ($cotisation > 0) @@ -1023,7 +1023,7 @@ if ($rowid && $action != 'edit') } // Envoi fiche par mail - if ($adh->statut >= 1) + if ($adh->statut >= 1 && $adh->email) { print "id&action=sendinfo\">".$langs->trans("SendCardByMail")."\n"; } diff --git a/htdocs/lib/functions.inc.php b/htdocs/lib/functions.inc.php index f7538d62f09..b437fa67cfd 100644 --- a/htdocs/lib/functions.inc.php +++ b/htdocs/lib/functions.inc.php @@ -165,65 +165,65 @@ function sanitize_string($str) */ function dolibarr_syslog($message, $level=LOG_INFO) { - global $conf,$user,$langs; + global $conf,$user,$langs; - if ($conf->syslog->enabled) - { - if ($level > SYSLOG_LEVEL) return; - - // Ajout user a la log - $login='???'; - if (is_object($user) && $user->id) $login=$user->login; - $message=sprintf("%-8s",$login)." ".$message; - - if (defined("SYSLOG_FILE") && SYSLOG_FILE) - { - if (defined("SYSLOG_FILE_NO_ERROR")) $file=@fopen(SYSLOG_FILE,"a+"); - else $file=fopen(SYSLOG_FILE,"a+"); - if ($file) - { - fwrite($file,strftime("%Y-%m-%d %H:%M:%S",time())." ".$level." ".$message."\n"); - fclose($file); - } - elseif (! defined("SYSLOG_FILE_NO_ERROR")) - { - $langs->load("main"); - print $langs->trans("ErrorFailedToOpenFile",SYSLOG_FILE); - } - } - else - { - //define_syslog_variables(); déjà définit dans master.inc.php - - if (defined("MAIN_SYSLOG_FACILITY") && MAIN_SYSLOG_FACILITY) - { - $facility = MAIN_SYSLOG_FACILITY; - } - elseif (defined("SYSLOG_FACILITY") && SYSLOG_FACILITY && defined(SYSLOG_FACILITY)) - { - // Exemple: SYSLOG_FACILITY vaut LOG_USER qui vaut 8. On a besoin de 8 dans $facility. - $facility = constant(SYSLOG_FACILITY); - } - else - { - $facility = LOG_USER; - } - - openlog("dolibarr", LOG_PID | LOG_PERROR, $facility); - - if (! $level) - { - syslog(LOG_ERR, $message); - } - else - { - syslog($level, $message); - } - - closelog(); - } - } + if ($conf->syslog->enabled) + { + if ($level > SYSLOG_LEVEL) return; + + // Ajout user a la log + $login='???'; + if (is_object($user) && $user->id) $login=$user->login; + $message=sprintf("%-8s",$login)." ".$message; + + if (defined("SYSLOG_FILE") && SYSLOG_FILE) + { + if (defined("SYSLOG_FILE_NO_ERROR")) $file=@fopen(SYSLOG_FILE,"a+"); + else $file=fopen(SYSLOG_FILE,"a+"); + if ($file) + { + fwrite($file,strftime("%Y-%m-%d %H:%M:%S",time())." ".$level." ".$message."\n"); + fclose($file); + } + elseif (! defined("SYSLOG_FILE_NO_ERROR")) + { + $langs->load("main"); + print $langs->trans("ErrorFailedToOpenFile",SYSLOG_FILE); + } + } + else + { + //define_syslog_variables(); déjà définit dans master.inc.php + if (defined("MAIN_SYSLOG_FACILITY") && MAIN_SYSLOG_FACILITY) + { + $facility = MAIN_SYSLOG_FACILITY; + } + elseif (defined("SYSLOG_FACILITY") && SYSLOG_FACILITY && defined(SYSLOG_FACILITY)) + { + // Exemple: SYSLOG_FACILITY vaut LOG_USER qui vaut 8. On a besoin de 8 dans $facility. + $facility = constant(SYSLOG_FACILITY); + } + else + { + $facility = LOG_USER; + } + + openlog("dolibarr", LOG_PID | LOG_PERROR, $facility); + + if (! $level) + { + syslog(LOG_ERR, $message); + } + else + { + syslog($level, $message); + } + + closelog(); + } + } } + /** \brief Affiche le header d'une fiche \param links Tableau de titre d'onglets