Fix account creation (send mail) and disable domainnotify (temporary)
This commit is contained in:
parent
b5254b8c5f
commit
791d0169ac
|
@ -27,14 +27,10 @@ if (!empty($_POST['domain'])) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$active = (!empty($_POST['isactive'])) ? true : false;
|
$active = (!empty($_POST['isactive'])) ? true : false;
|
||||||
$server->addDomain($domain), $active);
|
$server->addDomain($domain, $active);
|
||||||
domain_add($domain);
|
|
||||||
print '<div class="alert alert-success" role="alert">Ajout effectué.</div>';
|
print '<div class="alert alert-success" role="alert">Ajout effectué.</div>';
|
||||||
#EvoLog::log("Add domain ".$domain);
|
|
||||||
domainnotify($domain);
|
|
||||||
} catch (Exception $e_ad) {
|
} catch (Exception $e_ad) {
|
||||||
print '<div class="alert alert-danger" role="alert">'.$e_ad->getMessage().'</div>';
|
print '<div class="alert alert-danger" role="alert">'.$e_ad->getMessage().'</div>';
|
||||||
#EvoLog::log("Add $domain failed");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</div>";
|
print "</div>";
|
||||||
|
|
|
@ -92,13 +92,12 @@ class LdapDomain extends LdapServer {
|
||||||
#$info["amavisBypassSpamChecks"] = ($amavisBypassSpamChecks) ? 'TRUE' : 'FALSE';
|
#$info["amavisBypassSpamChecks"] = ($amavisBypassSpamChecks) ? 'TRUE' : 'FALSE';
|
||||||
$info["userPassword"] = LdapServer::hashPassword($password);
|
$info["userPassword"] = LdapServer::hashPassword($password);
|
||||||
|
|
||||||
if (@ldap_add($this->conn, LdapAccount::getBaseDN($this, $mail), $info)) {
|
if (!@ldap_add($this->conn, LdapAccount::getBaseDN($this, $mail), $info)) {
|
||||||
mail($name, 'Premier message',"Mail d'initialisation du compte.");
|
|
||||||
mailnotify($info,$this->getname(),$password);
|
|
||||||
} else {
|
|
||||||
$error = ldap_error($this->conn);
|
$error = ldap_error($this->conn);
|
||||||
throw new Exception("Erreur dans l'ajout du compte : $error");
|
throw new Exception("Erreur dans l'ajout du compte : $error");
|
||||||
}
|
}
|
||||||
|
mail($mail, 'Premier message',"Mail d'initialisation du compte.");
|
||||||
|
//mailnotify($info,$this->getname(),$password);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addAlias($name,$active=false,$mailaccept=array(),$maildrop=array()) {
|
public function addAlias($name,$active=false,$mailaccept=array(),$maildrop=array()) {
|
||||||
|
|
|
@ -108,6 +108,7 @@ class LdapServer {
|
||||||
$error = ldap_error($this->conn);
|
$error = ldap_error($this->conn);
|
||||||
throw new Exception("Erreur dans l'ajout du domaine : $error");
|
throw new Exception("Erreur dans l'ajout du domaine : $error");
|
||||||
}
|
}
|
||||||
|
//domainnotify($name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function delDomain($name) {
|
public function delDomain($name) {
|
||||||
|
|
Loading…
Reference in a new issue