Fix addDomain method
This commit is contained in:
parent
8c91f6ff2a
commit
458685d42f
|
@ -67,7 +67,7 @@ class LdapServer {
|
||||||
return $this->domains;
|
return $this->domains;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addDomain($name,$active=false) {
|
public function addDomain($name,$active='FALSE') {
|
||||||
global $conf;
|
global $conf;
|
||||||
$info["cn"]=$name;
|
$info["cn"]=$name;
|
||||||
$info["objectclass"][0] = ($conf['evoadmin']['version'] == 1) ? 'ldapDomain' : 'postfixDomain';
|
$info["objectclass"][0] = ($conf['evoadmin']['version'] == 1) ? 'ldapDomain' : 'postfixDomain';
|
||||||
|
@ -76,10 +76,9 @@ class LdapServer {
|
||||||
$info["isActive"] = $active;
|
$info["isActive"] = $active;
|
||||||
$info["gidNumber"]= getfreegid();
|
$info["gidNumber"]= getfreegid();
|
||||||
|
|
||||||
if (ldap_add($this->conn, "cn=".$name.",".LDAP_BASE, $info)) {
|
if (!@ldap_add($this->conn, "cn=".$name.",".LDAP_BASE, $info)) {
|
||||||
return true;
|
$error = ldap_error($this->conn);
|
||||||
} else {
|
throw new Exception("Erreur dans l'ajout du domaine : $error");
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue