Add missing support of alias/redirection edit in account update

This commit is contained in:
Victor LABORIE 2019-01-09 17:09:17 +01:00
parent 57d697b6c4
commit 6705fba644
2 changed files with 5 additions and 1 deletions

View file

@ -192,6 +192,8 @@ class FormController {
,self::$form['courieractive'] ,self::$form['courieractive']
,self::$form['webmailactive'] ,self::$form['webmailactive']
,self::$form['authsmtpactive'] ,self::$form['authsmtpactive']
,self::$form['mailaccept']
,self::$form['maildrop']
); );
PageController::$alerts[] = array('type' => 0, 'message' => "Modification effectué."); PageController::$alerts[] = array('type' => 0, 'message' => "Modification effectué.");
} catch (Exception $e) { } catch (Exception $e) {

View file

@ -37,7 +37,7 @@ class LdapAccount extends LdapDomain {
} }
} }
public function update($name=NULL,$password=NULL,$active=NULL,$admin=NULL,$accountactive=NULL,$courieractive=NULL,$webmailactive=NULL,$authsmtpactive=NULL,$amavisBypassSpamChecks=NULL) { public function update($name=NULL,$password=NULL,$active=NULL,$admin=NULL,$accountactive=NULL,$courieractive=NULL,$webmailactive=NULL,$authsmtpactive=NULL,$mailaccept=array(),$maildrop=array()) {
$info["cn"] = (!empty($name)) ? $name : $this->name; $info["cn"] = (!empty($name)) ? $name : $this->name;
if (!empty($password)) { if (!empty($password)) {
$info["userPassword"] = LdapServer::hashPassword($password); $info["userPassword"] = LdapServer::hashPassword($password);
@ -49,6 +49,8 @@ class LdapAccount extends LdapDomain {
$info["webmailActive"] = ($webmailactive) ? 'TRUE' : 'FALSE'; $info["webmailActive"] = ($webmailactive) ? 'TRUE' : 'FALSE';
$info["authsmtpActive"] = ($authsmtpactive) ? 'TRUE' : 'FALSE'; $info["authsmtpActive"] = ($authsmtpactive) ? 'TRUE' : 'FALSE';
#$info["amavisBypassSpamChecks"] = ($amavisBypassSpamChecks) ? 'TRUE' : 'FALSE'; #$info["amavisBypassSpamChecks"] = ($amavisBypassSpamChecks) ? 'TRUE' : 'FALSE';
$info["mailacceptinggeneralid"] = array_filter($mailaccept, function($value) { return $value != ""; });
$info["maildrop"] = array_filter($maildrop, function($value) { return $value != ""; });
if (!ldap_mod_replace($this->conn, self::getBaseDN($this), $info)) { if (!ldap_mod_replace($this->conn, self::getBaseDN($this), $info)) {
$error = ldap_error($this->conn); $error = ldap_error($this->conn);
throw new Exception("Erreur pendant la modification du compte : $error"); throw new Exception("Erreur pendant la modification du compte : $error");