This commit is contained in:
Alan Garcia 2012-08-22 08:55:44 +00:00
parent a2557c0440
commit 463164fc40
2 changed files with 6 additions and 5 deletions

View File

@ -50,7 +50,7 @@ $fields = array (
"nmail" => array ("request", "string", ""),
"type" => array ("request", "string", ""),
"duration" => array ("request", "integer", 0),
"reset_quotas" => array ("request", "boolean", false),
"reset_quotas" => array ("request", "string", false),
);
getFields($fields);
@ -70,7 +70,7 @@ if ($uid==$mem->user["uid"]) {
$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();
include("adm_edit.php");
} else {

View File

@ -458,10 +458,12 @@ EOF;
* @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 $cuid, $quota;
$notes=addslashes($notes);
$err->log("admin","update_mem",$uid);
if (!$this->enabled) {
$err->raise("admin",1);
@ -478,8 +480,7 @@ EOF;
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';"))){
if($_POST['reset_quotas'] == "on")
$quota->addquotas();
if($reset_quotas == "on") $quota->addquotas();
$this->renew_update($uid, $duration);
return true;
}