Can't add groups to LDAP?

I am trying to add groups to an LDAP server

I used the below code to add groups:

$ldap = new LDAP();
$connection = $ldap->connect($ldap->ldapserver,$ldap->ldapport);
$ldap->bind($connection,'cn=zentyal,dc=test,dc=org','k8ddfffdIsdefdfsdfsfi9');
$groupAtt['cn'] = $group_name;
$groupAtt['description'] = $group_description;
$groupAtt['objectClass'][0] = "posixGroup";
$groupAtt['objectClass'][1] = "zentyalGroup";
$groupAtt['gidNumber'] = "3000";

$addGroup = "cn=".$group_name.",ou=Groups,dc=test,dc=org";
$ldapcreation = $ldap->addRecord($connection,$addGroup,$groupAtt);

The code in the function addRecord is

function addRecord($connection, $adddn, $record){

    $addProcess = ldap_add($connection, $adddn, $record);

    if($addProcess){
       return true;
    } else {
       return false;
    }
}

      

The group is added, but then the group is removed from LDAP.

What could be the reason for this action?

+3


source to share





All Articles