function AddUserToGroup($ldap,$userdn,$groupdn) {
$userInfo["groupMembership"]=$groupdn;
$userInfo["securityEquals"]=$groupdn;
if(ldap_mod_add($ldap,$userdn,$userInfo)===TRUE) {
$groupInfo["member"]=$userdn;
$groupInfo["equivalentToMe"]=$userdn;
return ldap_mod_add($ldap,$groupdn,$groupInfo);
}
return FALSE;
}
function RemoveUserFromGroup($ldap,$userdn,$groupdn) {
$groupInfo["member"]=$userdn;
$groupInfo["equivalentToMe"]=$userdn;
if(ldap_mod_del($ldap,$groupdn,$groupInfo)===TRUE) {
$userInfo["groupMembership"]=$groupdn;
return ldap_mod_del($ldap,$userdn,$userInfo);
}
return FALSE;
}
$userInfo["groupMembership"]=$groupdn;
$userInfo["securityEquals"]=$groupdn;
if(ldap_mod_add($ldap,$userdn,$userInfo)===TRUE) {
$groupInfo["member"]=$userdn;
$groupInfo["equivalentToMe"]=$userdn;
return ldap_mod_add($ldap,$groupdn,$groupInfo);
}
return FALSE;
}
function RemoveUserFromGroup($ldap,$userdn,$groupdn) {
$groupInfo["member"]=$userdn;
$groupInfo["equivalentToMe"]=$userdn;
if(ldap_mod_del($ldap,$groupdn,$groupInfo)===TRUE) {
$userInfo["groupMembership"]=$groupdn;
return ldap_mod_del($ldap,$userdn,$userInfo);
}
return FALSE;
}