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 '
Ajout effectué.
';
#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)) {