Fix account creation (send mail) and disable domainnotify (temporary)

This commit is contained in:
Victor LABORIE 2017-12-17 21:54:44 +01:00
parent b5254b8c5f
commit 791d0169ac
3 changed files with 5 additions and 9 deletions

View file

@ -27,14 +27,10 @@ if (!empty($_POST['domain'])) {
try {
$active = (!empty($_POST['isactive'])) ? true : false;
$server->addDomain($domain), $active);
domain_add($domain);
$server->addDomain($domain, $active);
print '<div class="alert alert-success" role="alert">Ajout effectu&eacute;.</div>';
#EvoLog::log("Add domain ".$domain);
domainnotify($domain);
} catch (Exception $e_ad) {
print '<div class="alert alert-danger" role="alert">'.$e_ad->getMessage().'</div>';
#EvoLog::log("Add $domain failed");
}
print "</div>";

View file

@ -92,13 +92,12 @@ class LdapDomain extends LdapServer {
#$info["amavisBypassSpamChecks"] = ($amavisBypassSpamChecks) ? 'TRUE' : 'FALSE';
$info["userPassword"] = LdapServer::hashPassword($password);
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 {
if (!@ldap_add($this->conn, LdapAccount::getBaseDN($this, $mail), $info)) {
$error = ldap_error($this->conn);
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()) {

View file

@ -108,6 +108,7 @@ class LdapServer {
$error = ldap_error($this->conn);
throw new Exception("Erreur dans l'ajout du domaine : $error");
}
//domainnotify($name);
}
public function delDomain($name) {