Fix #1292
This commit is contained in:
parent
a2557c0440
commit
463164fc40
|
@ -50,7 +50,7 @@ $fields = array (
|
||||||
"nmail" => array ("request", "string", ""),
|
"nmail" => array ("request", "string", ""),
|
||||||
"type" => array ("request", "string", ""),
|
"type" => array ("request", "string", ""),
|
||||||
"duration" => array ("request", "integer", 0),
|
"duration" => array ("request", "integer", 0),
|
||||||
"reset_quotas" => array ("request", "boolean", false),
|
"reset_quotas" => array ("request", "string", false),
|
||||||
);
|
);
|
||||||
getFields($fields);
|
getFields($fields);
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ if ($uid==$mem->user["uid"]) {
|
||||||
$enabled=1;
|
$enabled=1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$admin->update_mem($uid, $nmail, $nom, $prenom, $pass, $enabled, $canpass, $type, $duration, $notes)){
|
if (!$admin->update_mem($uid, $nmail, $nom, $prenom, $pass, $enabled, $canpass, $type, $duration, $notes, $reset_quotas)){
|
||||||
$error=$err->errstr();
|
$error=$err->errstr();
|
||||||
include("adm_edit.php");
|
include("adm_edit.php");
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -458,10 +458,12 @@ EOF;
|
||||||
* @return boolean Retourne FALSE si une erreur s'est produite, TRUE sinon.
|
* @return boolean Retourne FALSE si une erreur s'est produite, TRUE sinon.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function update_mem($uid, $mail, $nom, $prenom, $pass, $enabled, $canpass, $type='default', $duration=0, $notes = "") {
|
function update_mem($uid, $mail, $nom, $prenom, $pass, $enabled, $canpass, $type='default', $duration=0, $notes = "",$reset_quotas=false) {
|
||||||
global $err,$db;
|
global $err,$db;
|
||||||
global $cuid, $quota;
|
global $cuid, $quota;
|
||||||
|
|
||||||
|
$notes=addslashes($notes);
|
||||||
|
|
||||||
$err->log("admin","update_mem",$uid);
|
$err->log("admin","update_mem",$uid);
|
||||||
if (!$this->enabled) {
|
if (!$this->enabled) {
|
||||||
$err->raise("admin",1);
|
$err->raise("admin",1);
|
||||||
|
@ -478,8 +480,7 @@ EOF;
|
||||||
|
|
||||||
if (($db->query("UPDATE local SET nom='$nom', prenom='$prenom' WHERE uid='$uid';"))
|
if (($db->query("UPDATE local SET nom='$nom', prenom='$prenom' WHERE uid='$uid';"))
|
||||||
&&($db->query("UPDATE membres SET mail='$mail', canpass='$canpass', enabled='$enabled', `type`='$type', notes='$notes' $ssq WHERE uid='$uid';"))){
|
&&($db->query("UPDATE membres SET mail='$mail', canpass='$canpass', enabled='$enabled', `type`='$type', notes='$notes' $ssq WHERE uid='$uid';"))){
|
||||||
if($_POST['reset_quotas'] == "on")
|
if($reset_quotas == "on") $quota->addquotas();
|
||||||
$quota->addquotas();
|
|
||||||
$this->renew_update($uid, $duration);
|
$this->renew_update($uid, $duration);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue