From 40deaef708b94c7cffacadcb5e3696d71fa8ee51 Mon Sep 17 00:00:00 2001 From: Victor LABORIE Date: Fri, 15 Dec 2017 15:36:22 +0100 Subject: [PATCH] Fix setting of active domain on create --- htdocs/domaine.php | 5 +++-- htdocs/lib/class.ldapserver.php | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/domaine.php b/htdocs/domaine.php index 134a4ec..7f07c75 100644 --- a/htdocs/domaine.php +++ b/htdocs/domaine.php @@ -24,9 +24,10 @@ if (!empty($_POST['domain'])) { print "
"; print "
Ajout en cours du domaine ".$domain." ...
"; - + try { - $server->addDomain(Html::clean($_POST['domain'], Html::clean($_POST['is_active']))); + $active = (!empty($_POST['isactive'])) ? true : false; + $server->addDomain(Html::clean($_POST['domain']), $active); domain_add($domain); print ''; #EvoLog::log("Add domain ".$domain); diff --git a/htdocs/lib/class.ldapserver.php b/htdocs/lib/class.ldapserver.php index 871e004..3239f25 100644 --- a/htdocs/lib/class.ldapserver.php +++ b/htdocs/lib/class.ldapserver.php @@ -67,13 +67,13 @@ class LdapServer { return $this->domains; } - public function addDomain($name,$active='FALSE') { + public function addDomain($name,$active=false) { global $conf; $info["cn"]=$name; $info["objectclass"][0] = ($conf['evoadmin']['version'] == 1) ? 'ldapDomain' : 'postfixDomain'; $info["objectclass"][1] = "posixGroup"; $info["postfixTransport"] = "virtual:"; - $info["isActive"] = $active; + $info["isActive"] = ($active) ? 'TRUE' : 'FALSE'; $info["gidNumber"]= getfreegid(); if (!@ldap_add($this->conn, "cn=".$name.",".LDAP_BASE, $info)) {