Horde_Group_Ldap::_removeUser PHP Method

_removeUser() protected method

Removes a user from a group.
protected _removeUser ( mixed $gid, string $user )
$gid mixed A group ID.
$user string A user name.
    protected function _removeUser($gid, $user)
    {
        if ($this->readOnly()) {
            throw new Horde_Group_Exception('This group backend is read-only.');
        }
        $attr = $this->_params['memberuid'];
        try {
            if (!empty($this->_params['attrisdn'])) {
                $user = $this->_ldap->findUserDN($user);
            }
            $entry = $this->_ldap->getEntry($gid, array($attr));
            $entry->delete(array($attr => $user));
            $this->_rebind(true);
            $entry->update();
            $this->_rebind(false);
        } catch (Horde_Ldap_Exception $e) {
            throw new Horde_Group_Exception($e);
        }
    }