Modifs dans le classe membre et la section membre d'admin

This commit is contained in:
quenenni 2017-08-15 03:19:52 +02:00
parent a9cd6dc4af
commit 2f830d7e4f
7 changed files with 101 additions and 103 deletions

View File

@ -31,10 +31,8 @@ $fields = array (
); );
getFields($fields); getFields($fields);
if (!$mem->adminpref($admlist)) { if ($mem->adminpref($admlist)) {
$error=$err->errstr(); $msg->raise('Ok', "mem", _("Your administrator preferences has been successfully changed."));
} else {
$error=_("Your administrator preferences has been successfully changed.");
} }
include_once("head.php"); include_once("head.php");
@ -42,8 +40,8 @@ include_once("head.php");
?> ?>
<h3><?php __("Admin preferences"); ?></h3> <h3><?php __("Admin preferences"); ?></h3>
<?php <?php
if (isset($error) && $error) { echo $msg->msg_html_all();
echo "<p class=\"alert alert-danger\">$error</p>"; echo "<p><span class='ina'><a href='mem_param.php'>"._("Click here to continue")."</a></span></p>";
}
include_once("foot.php");
?> ?>
<?php include_once("foot.php"); ?>

View File

@ -34,21 +34,24 @@ $fields = array (
); );
getFields($fields); getFields($fields);
if (!($cle=$mem->ChangeMail1($newmail))) { if ($cle=$mem->ChangeMail1($newmail)) {
$error=$err->errstr(); $msg->raise('Ok', "mem", _("The mail was successfully changed"));
} }
include_once("head.php"); include_once("head.php");
?> ?>
<h3><?php __("Change the email of the account"); ?></h3> <h3><?php __("Change the email of the account"); ?></h3>
<?php <?php
if (isset($error) && $error) { echo $msg->msg_html_all();
echo "<p class=\"alert alert-danger\">$error</p>"; if ($msg->has_msgs('Error')) {
echo "<p><span class='ina'><a href='mem_param.php'>"._("Click here to continue")."</a></span></p>";
include_once("foot.php"); include_once("foot.php");
exit(); exit();
} }
printf(_("help_mem_chgmail %s"),$newmail); printf(_("help_mem_chgmail %s"),$newmail);
?> ?>
<p class="code"><?php echo $cle; ?></p> <p class="code"><?php echo $cle; ?></p>
<p><span class="ina"><a href="mem_param.php"><?php __("Click here to continue"); ?></a></span></p>
<?php include_once("foot.php"); ?> <?php include_once("foot.php"); ?>

View File

@ -41,8 +41,9 @@ getFields($fields);
?> ?>
<h3><?php __("Change the email of the account"); ?></h3> <h3><?php __("Change the email of the account"); ?></h3>
<?php <?php
if (isset($error) && $error) { echo $msg->msg_html_all();
echo "<p class=\"alert alert-danger\">$error</p>"; if ($msg->has_msgs('Error')) {
echo "<p><span class='ina'><a href='mem_param.php'>"._("Click here to continue")."</a></span></p>";
include_once("foot.php"); include_once("foot.php");
exit(); exit();
} }

View File

@ -37,8 +37,8 @@ $fields = array (
); );
getFields($fields); getFields($fields);
if (!$mem->ChangeMail2($cookie,$cle,$usr)) { if ($mem->ChangeMail2($cookie,$cle,$usr)) {
$error=$err->errstr(); $msg->raise('Ok', "mem", _("The mailbox has been successfully changed."));
} }
include_once("head.php"); include_once("head.php");
@ -46,14 +46,9 @@ include_once("head.php");
?> ?>
<h3><?php __("Change the email of the account"); ?></h3> <h3><?php __("Change the email of the account"); ?></h3>
<?php <?php
if (isset($error) && $error) { echo $msg->msg_html_all();
echo "<p class=\"alert alert-danger\">$error</p>";
include_once("foot.php");
exit();
}
__("The mailbox has been successfully changed."); echo "<p><span class='ina'><a href='mem_param.php'>"._("Click here to continue")."</a></span></p>";
include_once("foot.php"); include_once("foot.php");
?> ?>

View File

@ -40,17 +40,21 @@ getFields($fields);
if (!empty($help_setting)) { if (!empty($help_setting)) {
$mem->set_help_param($showhelp); $mem->set_help_param($showhelp);
$error=_("Your help setting has been updated."); $msg->raise('Ok', "mem", _("Your help setting has been updated."));
} }
?> ?>
<div align="center"><h3><?php __("Settings of your account"); ?></h3></div> <div align="center"><h3><?php __("Settings of your account"); ?></h3></div>
<?php <?php
if (isset($error) && $error) { if ($msg->has_msgs('Error')) {
echo "<font color=red>$error</font>"; include_once("mem_param.php");
include_once("foot.php");
exit(); exit();
} }
$c=$admin->listPasswordPolicies();
$passwd_classcount = $c['mem']['classcount'];
echo $msg->msg_html_all();
?> ?>
<div id="tabsmem"> <div id="tabsmem">
@ -86,7 +90,7 @@ echo "<p>";
<table border="1" cellspacing="0" cellpadding="4" class="tedit" > <table border="1" cellspacing="0" cellpadding="4" class="tedit" >
<tr><th><?php __("Old password"); ?></th><td><input type="password" class="int" name="oldpass" value="<?php isset($oldpass) ? : $oldpass=""; ehe($oldpass); ?>" size="20" maxlength="128" /></td></tr> <tr><th><?php __("Old password"); ?></th><td><input type="password" class="int" name="oldpass" value="<?php isset($oldpass) ? : $oldpass=""; ehe($oldpass); ?>" size="20" maxlength="128" /></td></tr>
<tr><th><?php __("New password"); ?> (1)</th><td><input type="password" class="int" autocomplete="off" id="newpass" name="newpass" value="<?php isset($newpass) ? : $newpass=""; ehe($newpass); ?>" size="20" maxlength="60" /><?php display_div_generate_password(DEFAULT_PASS_SIZE,"#newpass","#newpass2"); ?></td></tr> <tr><th><?php __("New password"); ?> (1)</th><td><input type="password" class="int" autocomplete="off" id="newpass" name="newpass" value="<?php isset($newpass) ? : $newpass=""; ehe($newpass); ?>" size="20" maxlength="60" /><?php display_div_generate_password(DEFAULT_PASS_SIZE,"#newpass","#newpass2",$passwd_classcount); ?></td></tr>
<tr><th><?php __("New password"); ?> (2)</th><td><input type="password" class="int" autocomplete="off" id="newpass2" name="newpass2" value="<?php isset($newpass2) ? : $newpass2=""; ehe($newpass2);?>" size="20" maxlength="61" /></td></tr> <tr><th><?php __("New password"); ?> (2)</th><td><input type="password" class="int" autocomplete="off" id="newpass2" name="newpass2" value="<?php isset($newpass2) ? : $newpass2=""; ehe($newpass2);?>" size="20" maxlength="61" /></td></tr>
<tr class="trbtn"><td colspan="3"><input type="submit" class="inb ok" name="submit" value="<?php __("Change my password"); ?>" /></td></tr> <tr class="trbtn"><td colspan="3"><input type="submit" class="inb ok" name="submit" value="<?php __("Change my password"); ?>" /></td></tr>
</table> </table>

View File

@ -38,10 +38,8 @@ getFields($fields);
if (!$mem->passwd($oldpass,$newpass,$newpass2)) { if ($mem->passwd($oldpass,$newpass,$newpass2)) {
$error=$err->errstr(); $msg->raise('Ok', "mem", _("Your password has been successfully changed."));
} else {
$error=_("Your password has been successfully changed.");
} }
include_once("head.php"); include_once("head.php");
@ -49,10 +47,7 @@ include_once("head.php");
?> ?>
<div align="center"><h3><?php __("Password change"); ?></h3></div> <div align="center"><h3><?php __("Password change"); ?></h3></div>
<?php <?php
if (isset($error) && $error) { echo $msg->msg_html_all();
echo "<font color=red>$error</font>"; echo "<p><span class='ina'><a href='mem_param.php'>"._("Click here to continue")."</a></span></p>";
include("foot.php"); include_once("foot.php");
exit();
}
?> ?>
<?php include_once("foot.php"); ?>

View File

@ -94,30 +94,30 @@ class m_mem {
* @return boolean TRUE if the user has been successfully connected, or FALSE if an error occured. * @return boolean TRUE if the user has been successfully connected, or FALSE if an error occured.
*/ */
function login($username, $password, $restrictip = 0, $authip_token = false) { function login($username, $password, $restrictip = 0, $authip_token = false) {
global $db, $err, $cuid, $authip; global $db, $msg, $cuid, $authip;
$err->log("mem", "login", $username); $msg->log("mem", "login", $username);
// $username=addslashes($username); // $username=addslashes($username);
// $password=addslashes($password); // $password=addslashes($password);
$db->query("select * from membres where login= ? ;", array($username)); $db->query("select * from membres where login= ? ;", array($username));
if ($db->num_rows() == 0) { if ($db->num_rows() == 0) {
$err->raise("mem", _("User or password incorrect")); $msg->raise('Error', "mem", _("User or password incorrect"));
return false; return false;
} }
$db->next_record(); $db->next_record();
if (_md5cr($password, $db->f("pass")) != $db->f("pass")) { if (_md5cr($password, $db->f("pass")) != $db->f("pass")) {
$db->query("UPDATE membres SET lastfail=lastfail+1 WHERE uid= ? ;", array($db->f("uid"))); $db->query("UPDATE membres SET lastfail=lastfail+1 WHERE uid= ? ;", array($db->f("uid")));
$err->raise("mem", _("User or password incorrect")); $msg->raise('Error', "mem", _("User or password incorrect"));
return false; return false;
} }
if (!$db->f("enabled")) { if (!$db->f("enabled")) {
$err->raise("mem", _("This account is locked, contact the administrator.")); $msg->raise('Error', "mem", _("This account is locked, contact the administrator."));
return false; return false;
} }
$this->user = $db->Record; $this->user = $db->Record;
$cuid = $db->f("uid"); $cuid = $db->f("uid");
if (panel_islocked() && $cuid != 2000) { if (panel_islocked() && $cuid != 2000) {
$err->raise("mem", _("This website is currently under maintenance, login is currently disabled.")); $msg->raise('Alert', "mem", _("This website is currently under maintenance, login is currently disabled."));
return false; return false;
} }
@ -136,7 +136,7 @@ class m_mem {
// Error if there is rules, the IP is not allowed and it's not in the whitelisted IP // Error if there is rules, the IP is not allowed and it's not in the whitelisted IP
if (sizeof($aga) > 1 && !$allowed_ip && !$authip->is_wl(get_remote_ip())) { if (sizeof($aga) > 1 && !$allowed_ip && !$authip->is_wl(get_remote_ip())) {
$err->raise("mem", _("Your IP isn't allowed to connect")); $msg->raise('Error', "mem", _("Your IP isn't allowed to connect"));
return false; return false;
} }
// End AuthIP // End AuthIP
@ -157,7 +157,7 @@ class m_mem {
$_REQUEST["session"] = $sess; $_REQUEST["session"] = $sess;
$db->query("insert into sessions (sid,ip,uid) values (?, ?, ?);", array($sess, $ip, $cuid)); $db->query("insert into sessions (sid,ip,uid) values (?, ?, ?);", array($sess, $ip, $cuid));
setcookie("session", $sess, 0, "/"); setcookie("session", $sess, 0, "/");
$err->error = 0; $msg->error = 0;
/* Fill in $local */ /* Fill in $local */
$db->query("SELECT * FROM local WHERE uid= ? ;", array($cuid)); $db->query("SELECT * FROM local WHERE uid= ? ;", array($cuid));
if ($db->num_rows()) { if ($db->num_rows()) {
@ -179,11 +179,11 @@ class m_mem {
* @return boolean TRUE if the user has been successfully connected, FALSE else. * @return boolean TRUE if the user has been successfully connected, FALSE else.
*/ */
function setid($id) { function setid($id) {
global $db, $err, $cuid, $mysql, $quota; global $db, $msg, $cuid, $mysql, $quota;
$err->log("mem", "setid", $id); $msg->log("mem", "setid", $id);
$db->query("select * from membres where uid= ? ;", array($id)); $db->query("select * from membres where uid= ? ;", array($id));
if ($db->num_rows() == 0) { if ($db->num_rows() == 0) {
$err->raise("mem", _("User or password incorrect")); $msg->raise('Error', "mem", _("User or password incorrect"));
return false; return false;
} }
$db->next_record(); $db->next_record();
@ -197,7 +197,7 @@ class m_mem {
$_REQUEST["session"] = $sess; $_REQUEST["session"] = $sess;
$db->query("insert into sessions (sid,ip,uid) values (?, ?, ?);", array($sess, $ip, $cuid)); $db->query("insert into sessions (sid,ip,uid) values (?, ?, ?);", array($sess, $ip, $cuid));
setcookie("session", $sess, 0, "/"); setcookie("session", $sess, 0, "/");
$err->error = 0; $msg->error = 0;
/* Fill in $local */ /* Fill in $local */
$db->query("SELECT * FROM local WHERE uid= ? ;", array($cuid)); $db->query("SELECT * FROM local WHERE uid= ? ;", array($cuid));
if ($db->num_rows()) { if ($db->num_rows()) {
@ -262,11 +262,11 @@ class m_mem {
* @global string $username/password le login/pass de l'utilisateur * @global string $username/password le login/pass de l'utilisateur
* @return boolean TRUE si la session est correcte, FALSE sinon. * @return boolean TRUE si la session est correcte, FALSE sinon.
*/ */
function checkid() { function checkid($show_msg = true) {
global $db, $err, $cuid; global $db, $msg, $cuid;
if (isset($_REQUEST["username"])) { if (isset($_REQUEST["username"])) {
if (empty($_REQUEST['password'])) { if (empty($_REQUEST['password'])) {
$err->raise("mem", _("Missing password")); $msg->raise('Error', "mem", _("Missing password"));
return false; return false;
} }
if ($_REQUEST["username"] && $_REQUEST["password"]) { if ($_REQUEST["username"] && $_REQUEST["password"]) {
@ -275,27 +275,29 @@ class m_mem {
} // end isset } // end isset
$_COOKIE["session"] = isset($_COOKIE["session"]) ? $_COOKIE["session"] : ""; $_COOKIE["session"] = isset($_COOKIE["session"]) ? $_COOKIE["session"] : "";
if (strlen($_COOKIE["session"]) != 32) { if (strlen($_COOKIE["session"]) != 32) {
$err->raise("mem", _("Identity lost or unknown, please login")); if ($show_msg)
$msg->raise('Error', "mem", _("Identity lost or unknown, please login"));
return false; return false;
} }
$ip = get_remote_ip(); $ip = get_remote_ip();
$db->query("select uid, ? as me,ip from sessions where sid= ?;", array($ip, $_COOKIE["session"])); $db->query("select uid, ? as me,ip from sessions where sid= ?;", array($ip, $_COOKIE["session"]));
if ($db->num_rows() == 0) { if ($db->num_rows() == 0) {
$err->raise("mem", _("Session unknown, contact the administrator")); if ($show_msg)
$msg->raise('Error', "mem", _("Identity lost or unknown, please login"));
return false; return false;
} }
$db->next_record(); $db->next_record();
$cuid = $db->f("uid"); $cuid = $db->f("uid");
if (panel_islocked() && $cuid != 2000) { if (panel_islocked() && $cuid != 2000) {
$err->raise("mem", _("This website is currently under maintenance, login is currently disabled.")); $msg->raise('Alert', "mem", _("This website is currently under maintenance, login is currently disabled."));
return false; return false;
} }
$db->query("select * from membres where uid= ? ;", array($cuid)); $db->query("select * from membres where uid= ? ;", array($cuid));
$db->next_record(); $db->next_record();
$this->user = $db->Record; $this->user = $db->Record;
$err->error = 0; $msg->error = 0;
/* Remplissage de $local */ /* Remplissage de $local */
$db->query("SELECT * FROM local WHERE uid= ? ;", array($cuid)); $db->query("SELECT * FROM local WHERE uid= ? ;", array($cuid));
if ($db->num_rows()) { if ($db->num_rows()) {
@ -312,13 +314,13 @@ class m_mem {
* @return TRUE si la session est correcte, FALSE sinon. * @return TRUE si la session est correcte, FALSE sinon.
*/ */
function su($uid) { function su($uid) {
global $cuid, $db, $err, $mysql; global $cuid, $db, $msg, $mysql;
if (!$this->olduid) { if (!$this->olduid) {
$this->olduid = $cuid; $this->olduid = $cuid;
} }
$db->query("select * from membres where uid= ? ;", array($uid)); $db->query("select * from membres where uid= ? ;", array($uid));
if ($db->num_rows() == 0) { if ($db->num_rows() == 0) {
$err->raise("mem", _("User or password incorrect")); $msg->raise('Error', "mem", _("User or password incorrect"));
return false; return false;
} }
$db->next_record(); $db->next_record();
@ -353,32 +355,32 @@ class m_mem {
* @return boolean TRUE si la session a bien ete detruite, FALSE sinon. * @return boolean TRUE si la session a bien ete detruite, FALSE sinon.
*/ */
function del_session() { function del_session() {
global $db, $user, $err, $cuid, $hooks; global $db, $user, $msg, $cuid, $hooks;
$_COOKIE["session"] = isset($_COOKIE["session"]) ? $_COOKIE["session"] : ''; $_COOKIE["session"] = isset($_COOKIE["session"]) ? $_COOKIE["session"] : '';
setcookie("session", "", 0, "/"); setcookie("session", "", 0, "/");
setcookie("oldid", "", 0, "/"); setcookie("oldid", "", 0, "/");
if ($_COOKIE["session"] == "") { if ($_COOKIE["session"] == "") {
$err->error = 0; $msg->error = 0;
return true; return true;
} }
if (strlen($_COOKIE["session"]) != 32) { if (strlen($_COOKIE["session"]) != 32) {
$err->raise("mem", _("Cookie incorrect, please accept the session cookie")); $msg->raise('Error', "mem", _("Cookie incorrect, please accept the session cookie"));
return false; return false;
} }
$ip = get_remote_ip(); $ip = get_remote_ip();
$db->query("select uid, ? as me,ip from sessions where sid= ? ;", array($ip, $_COOKIE["session"])); $db->query("select uid, ? as me,ip from sessions where sid= ? ;", array($ip, $_COOKIE["session"]));
if ($db->num_rows() == 0) { if ($db->num_rows() == 0) {
$err->raise("mem", _("Session unknown, contact the administrator")); $msg->raise('Error', "mem", _("Session unknown, contact the administrator"));
return false; return false;
} }
$db->next_record(); $db->next_record();
if ($db->f("me") != $db->f("ip")) { if ($db->f("me") != $db->f("ip")) {
$err->raise("mem", _("IP address incorrect, please contact the administrator")); $msg->raise('Error', "mem", _("IP address incorrect, please contact the administrator"));
return false; return false;
} }
$cuid = $db->f("uid"); $cuid = $db->f("uid");
$db->query("delete from sessions where sid= ? ;", array($_COOKIE["session"])); $db->query("delete from sessions where sid= ? ;", array($_COOKIE["session"]));
$err->error = 0; $msg->error = 0;
# Invoker le logout dans toutes les autres classes # Invoker le logout dans toutes les autres classes
/* /*
@ -404,18 +406,18 @@ class m_mem {
* @return boolean TRUE si le mot de passe a ete change, FALSE sinon. * @return boolean TRUE si le mot de passe a ete change, FALSE sinon.
*/ */
function passwd($oldpass, $newpass, $newpass2) { function passwd($oldpass, $newpass, $newpass2) {
global $db, $err, $cuid, $admin; global $db, $msg, $cuid, $admin;
$err->log("mem", "passwd"); $msg->log("mem", "passwd");
if (!$this->user["canpass"]) { if (!$this->user["canpass"]) {
$err->raise("mem", _("You are not allowed to change your password.")); $msg->raise('Error', "mem", _("You are not allowed to change your password."));
return false; return false;
} }
if ($this->user["pass"] != _md5cr($oldpass, $this->user["pass"])) { if ($this->user["pass"] != _md5cr($oldpass, $this->user["pass"])) {
$err->raise("mem", _("The old password is incorrect")); $msg->raise('Error', "mem", _("The old password is incorrect"));
return false; return false;
} }
if ($newpass != $newpass2) { if ($newpass != $newpass2) {
$err->raise("mem", _("The new passwords are differents, please retry")); $msg->raise('Error', "mem", _("The new passwords are differents, please retry"));
return false; return false;
} }
$db->query("SELECT login FROM membres WHERE uid= ? ;", array($cuid)); $db->query("SELECT login FROM membres WHERE uid= ? ;", array($cuid));
@ -426,7 +428,7 @@ class m_mem {
} }
$newpass = _md5cr($newpass); $newpass = _md5cr($newpass);
$db->query("UPDATE membres SET pass= ? WHERE uid= ?;", array($newpass, $cuid)); $db->query("UPDATE membres SET pass= ? WHERE uid= ?;", array($newpass, $cuid));
$err->error = 0; $msg->error = 0;
return true; return true;
} }
@ -437,14 +439,14 @@ class m_mem {
* @return boolean TRUE si les preferences ont ete changees, FALSE sinon. * @return boolean TRUE si les preferences ont ete changees, FALSE sinon.
*/ */
function adminpref($admlist) { function adminpref($admlist) {
global $db, $err, $cuid; global $db, $msg, $cuid;
$err->log("mem", "admlist"); $msg->log("mem", "admlist");
if (!$this->user["su"]) { if (!$this->user["su"]) {
$err->raise("mem", _("You must be a system administrator to do this.")); $msg->raise('Error', "mem", _("You must be a system administrator to do this."));
return false; return false;
} }
$db->query("UPDATE membres SET admlist= ? WHERE uid= ?;", array($admlist, $cuid)); $db->query("UPDATE membres SET admlist= ? WHERE uid= ?;", array($admlist, $cuid));
$err->error = 0; $msg->error = 0;
return true; return true;
} }
@ -457,16 +459,16 @@ class m_mem {
* @return boolean TRUE si le mot de passe a ete envoye avec succes, FALSE sinon. * @return boolean TRUE si le mot de passe a ete envoye avec succes, FALSE sinon.
*/ */
function send_pass($login) { function send_pass($login) {
global $err, $db, $L_HOSTING, $L_FQDN; global $msg, $db, $L_HOSTING, $L_FQDN;
$err->log("mem", "send_pass"); $msg->log("mem", "send_pass");
$db->query("SELECT * FROM membres WHERE login= ? ;", array($login)); $db->query("SELECT * FROM membres WHERE login= ? ;", array($login));
if (!$db->num_rows()) { if (!$db->num_rows()) {
$err->raise("mem", _("This account is locked, contact the administrator.")); $msg->raise('Error', "mem", _("This account is locked, contact the administrator."));
return false; return false;
} }
$db->next_record(); $db->next_record();
if (time() - $db->f("lastaskpass") < 86400) { if (time() - $db->f("lastaskpass") < 86400) {
$err->raise("mem", _("The new passwords are differents, please retry")); $msg->raise('Error', "mem", _("The new passwords are differents, please retry"));
return false; return false;
} }
$txt = sprintf(_("Hello, $txt = sprintf(_("Hello,
@ -501,11 +503,11 @@ Cordially.
* @return string le cookie si le mail a bien ete envoye, FALSE sinon * @return string le cookie si le mail a bien ete envoye, FALSE sinon
*/ */
function ChangeMail1($newmail) { function ChangeMail1($newmail) {
global $err, $db, $L_HOSTING, $L_FQDN, $cuid; global $msg, $db, $L_HOSTING, $L_FQDN, $cuid;
$err->log("mem", "changemail1", $newmail); $msg->log("mem", "changemail1", $newmail);
$db->query("SELECT * FROM membres WHERE uid= ? ;", array($cuid)); $db->query("SELECT * FROM membres WHERE uid= ? ;", array($cuid));
if (!$db->num_rows()) { if (!$db->num_rows()) {
$err->raise("mem", _("This account is locked, contact the administrator.")); $msg->raise('Error', "mem", _("This account is locked, contact the administrator."));
return false; return false;
} }
$db->next_record(); $db->next_record();
@ -514,7 +516,7 @@ Cordially.
$COOKIE = substr(md5(mt_rand().mt_rand()), 0, 20); $COOKIE = substr(md5(mt_rand().mt_rand()), 0, 20);
// et de 6 pour la cl<63> <20> entrer. ca me semble suffisant... // et de 6 pour la cl<63> <20> entrer. ca me semble suffisant...
$KEY = substr(md5(mt_rand().mt_rand()), 0, 6); $KEY = substr(md5(mt_rand().mt_rand()), 0, 6);
$link = "https://$L_FQDN/mem_cm.php?usr=$cuid&cookie=$COOKIE"; $link = "https://$L_FQDN/mem_cm.php?usr=$cuid&cookie=$COOKIE&cle=$KEY";
$txt = sprintf(_("Hello, $txt = sprintf(_("Hello,
Someone (maybe you) requested an email's address modification of the account Someone (maybe you) requested an email's address modification of the account
@ -553,11 +555,11 @@ Cordially.
* @return boolean TRUE si le mail a bien ete modifie, FALSE sinon * @return boolean TRUE si le mail a bien ete modifie, FALSE sinon
*/ */
function ChangeMail2($COOKIE, $KEY, $uid) { function ChangeMail2($COOKIE, $KEY, $uid) {
global $err, $db; global $msg, $db;
$err->log("mem", "changemail2", $uid); $msg->log("mem", "changemail2", $uid);
$db->query("SELECT * FROM chgmail WHERE cookie= ? and ckey= ? and uid= ?;", array($COOKIE, $KEY, $uid)); $db->query("SELECT * FROM chgmail WHERE cookie= ? and ckey= ? and uid= ?;", array($COOKIE, $KEY, $uid));
if (!$db->num_rows()) { if (!$db->num_rows()) {
$err->raise("mem", _("The information you entered is incorrect.")); $msg->raise('Error', "mem", _("The information you entered is incorrect."));
return false; return false;
} }
$db->next_record(); $db->next_record();
@ -578,8 +580,8 @@ Cordially.
* @param integer $show Faut-il (1) ou non (0) afficher l'aide en ligne * @param integer $show Faut-il (1) ou non (0) afficher l'aide en ligne
*/ */
function set_help_param($show) { function set_help_param($show) {
global $db, $err, $cuid; global $db, $msg, $cuid;
$err->log("mem", "set_help_param", $show); $msg->log("mem", "set_help_param", $show);
$db->query("UPDATE membres SET show_help= ? WHERE uid= ? ;", array($show, $cuid)); $db->query("UPDATE membres SET show_help= ? WHERE uid= ? ;", array($show, $cuid));
} }
@ -617,8 +619,8 @@ Cordially.
* @param integer $uid * @param integer $uid
*/ */
function get_creator_by_uid($uid) { function get_creator_by_uid($uid) {
global $db, $err; global $db, $msg;
$err->log("dom", "get_creator_by_uid"); $msg->log("dom", "get_creator_by_uid");
$db->query("select creator from membres where uid = ? ;", array($uid)); $db->query("select creator from membres where uid = ? ;", array($uid));
if (!$db->next_record()) { if (!$db->next_record()) {
return false; return false;
@ -633,8 +635,8 @@ Cordially.
* @access private * @access private
*/ */
function alternc_export_conf() { function alternc_export_conf() {
global $db, $err; global $db, $msg;
$err->log("mem", "export"); $msg->log("mem", "export");
$str = " <member>\n"; $str = " <member>\n";
$users = $this->user; $users = $this->user;
$str.=" <uid>" . $users["uid"] . "</uid>\n"; $str.=" <uid>" . $users["uid"] . "</uid>\n";