From 791d0169acbf5253aa1438d9256d0af0f1705d8d Mon Sep 17 00:00:00 2001 From: Victor LABORIE Date: Sun, 17 Dec 2017 21:54:44 +0100 Subject: [PATCH] Fix account creation (send mail) and disable domainnotify (temporary) --- htdocs/domaine.php | 6 +----- htdocs/lib/class.ldapdomain.php | 7 +++---- htdocs/lib/class.ldapserver.php | 1 + 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/htdocs/domaine.php b/htdocs/domaine.php index 62b171a..48587d2 100644 --- a/htdocs/domaine.php +++ b/htdocs/domaine.php @@ -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 ''; - #EvoLog::log("Add domain ".$domain); - domainnotify($domain); } catch (Exception $e_ad) { print ''; - #EvoLog::log("Add $domain failed"); } print ""; diff --git a/htdocs/lib/class.ldapdomain.php b/htdocs/lib/class.ldapdomain.php index 2561c48..47902d2 100644 --- a/htdocs/lib/class.ldapdomain.php +++ b/htdocs/lib/class.ldapdomain.php @@ -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()) { diff --git a/htdocs/lib/class.ldapserver.php b/htdocs/lib/class.ldapserver.php index b725482..f557fb2 100644 --- a/htdocs/lib/class.ldapserver.php +++ b/htdocs/lib/class.ldapserver.php @@ -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) {