2
0
forked from Wavyzz/dolibarr

Modif mineures

This commit is contained in:
Laurent Destailleur
2007-02-27 22:00:59 +00:00
parent 478a9eb5dc
commit d297e9ad9a
2 changed files with 60 additions and 60 deletions

View File

@@ -194,7 +194,7 @@ if ($_REQUEST["action"] == 'update' && ! $_POST["cancel"])
{ {
if (isset($_POST["password"]) && $_POST["password"] !='') 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) if ($ret < 0)
{ {
$message.='<div class="error">'.$edituser->error.'</div>'; $message.='<div class="error">'.$edituser->error.'</div>';
@@ -333,7 +333,7 @@ if ($_POST["action"] == 'add')
{ {
if (isset($_POST['password']) && trim($_POST['password'])) 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) if ($cotisation > 0)
@@ -1023,7 +1023,7 @@ if ($rowid && $action != 'edit')
} }
// Envoi fiche par mail // Envoi fiche par mail
if ($adh->statut >= 1) if ($adh->statut >= 1 && $adh->email)
{ {
print "<a class=\"butAction\" href=\"fiche.php?rowid=$adh->id&action=sendinfo\">".$langs->trans("SendCardByMail")."</a>\n"; print "<a class=\"butAction\" href=\"fiche.php?rowid=$adh->id&action=sendinfo\">".$langs->trans("SendCardByMail")."</a>\n";
} }

View File

@@ -165,65 +165,65 @@ function sanitize_string($str)
*/ */
function dolibarr_syslog($message, $level=LOG_INFO) function dolibarr_syslog($message, $level=LOG_INFO)
{ {
global $conf,$user,$langs; global $conf,$user,$langs;
if ($conf->syslog->enabled) if ($conf->syslog->enabled)
{ {
if ($level > SYSLOG_LEVEL) return; if ($level > SYSLOG_LEVEL) return;
// Ajout user a la log // Ajout user a la log
$login='???'; $login='???';
if (is_object($user) && $user->id) $login=$user->login; if (is_object($user) && $user->id) $login=$user->login;
$message=sprintf("%-8s",$login)." ".$message; $message=sprintf("%-8s",$login)." ".$message;
if (defined("SYSLOG_FILE") && SYSLOG_FILE) if (defined("SYSLOG_FILE") && SYSLOG_FILE)
{ {
if (defined("SYSLOG_FILE_NO_ERROR")) $file=@fopen(SYSLOG_FILE,"a+"); if (defined("SYSLOG_FILE_NO_ERROR")) $file=@fopen(SYSLOG_FILE,"a+");
else $file=fopen(SYSLOG_FILE,"a+"); else $file=fopen(SYSLOG_FILE,"a+");
if ($file) if ($file)
{ {
fwrite($file,strftime("%Y-%m-%d %H:%M:%S",time())." ".$level." ".$message."\n"); fwrite($file,strftime("%Y-%m-%d %H:%M:%S",time())." ".$level." ".$message."\n");
fclose($file); fclose($file);
} }
elseif (! defined("SYSLOG_FILE_NO_ERROR")) elseif (! defined("SYSLOG_FILE_NO_ERROR"))
{ {
$langs->load("main"); $langs->load("main");
print $langs->trans("ErrorFailedToOpenFile",SYSLOG_FILE); print $langs->trans("ErrorFailedToOpenFile",SYSLOG_FILE);
} }
} }
else else
{ {
//define_syslog_variables(); d<>j<EFBFBD> d<>finit dans master.inc.php //define_syslog_variables(); d<>j<EFBFBD> d<>finit dans master.inc.php
if (defined("MAIN_SYSLOG_FACILITY") && MAIN_SYSLOG_FACILITY)
if (defined("MAIN_SYSLOG_FACILITY") && MAIN_SYSLOG_FACILITY) {
{ $facility = MAIN_SYSLOG_FACILITY;
$facility = MAIN_SYSLOG_FACILITY; }
} elseif (defined("SYSLOG_FACILITY") && SYSLOG_FACILITY && defined(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.
// Exemple: SYSLOG_FACILITY vaut LOG_USER qui vaut 8. On a besoin de 8 dans $facility. $facility = constant(SYSLOG_FACILITY);
$facility = constant(SYSLOG_FACILITY); }
} else
else {
{ $facility = LOG_USER;
$facility = LOG_USER; }
}
openlog("dolibarr", LOG_PID | LOG_PERROR, $facility);
openlog("dolibarr", LOG_PID | LOG_PERROR, $facility);
if (! $level)
if (! $level) {
{ syslog(LOG_ERR, $message);
syslog(LOG_ERR, $message); }
} else
else {
{ syslog($level, $message);
syslog($level, $message); }
}
closelog();
closelog(); }
} }
}
} }
/** /**
\brief Affiche le header d'une fiche \brief Affiche le header d'une fiche
\param links Tableau de titre d'onglets \param links Tableau de titre d'onglets