diff --git a/gosa-core/plugins/admin/groups/class_groupGeneric.inc b/gosa-core/plugins/admin/groups/class_groupGeneric.inc
index 0cf314a07203b693983543b205635f2de7bd62c1..82fed9121cd643897cd8e792d3c03b617c865e1d 100644 (file)
} else {
/* Get object base */
- $this->base =preg_replace ("/^[^,]+,".preg_quote(get_groups_ou(), '/')."/","",$this->dn);
+ $this->base =preg_replace ("/^[^,]+,".preg_quote(get_groups_ou(), '/')."/i","",$this->dn);
}
$this->orig_base = $this->base;
$acl->save();
}
- /* Remove ACL dependencies too,
- */
- $tmp = new acl($this->config,$this->parent,$this->dn);
- $tmp->remove_acl();
+ /* Remove ACL dependencies, too */
+ acl::remove_acl_for($this->dn);
/* Send signal to the world that we've done */
$this->handle_post_events("remove");
}
}
add_lock ("gidnumber", "gosa");
- $this->gidNumber= $this->get_next_id("gidNumber", $this->dn);
+ $this->gidNumber= get_next_id("gidNumber", $this->dn);
}
}
return ($message);
}
- function get_next_id($attrib, $dn)
- {
- $ids= array();
- $ldap= $this->config->get_ldap_link();
-
- $ldap->cd ($this->config->current['BASE']);
- if (preg_match('/gidNumber/i', $attrib)){
- $oc= "posixGroup";
- $att= "gidNumberBase";
- } else {
- $oc= "posixAccount";
- $att= "uidNumberBase";
- }
- $ldap->search ("(&(objectClass=$oc)($attrib=*))", array("$attrib"));
-
- /* Get list of ids */
- while ($attrs= $ldap->fetch()){
- $ids[]= (int)$attrs["$attrib"][0];
- }
-
- /* Find out next free id near to UID_BASE */
- if ($this->config->get_cfg_value("baseIdHook") == ""){
- $base= $this->config->get_cfg_value($att);
- } else {
- /* Call base hook */
- $base= get_base_from_hook($dn, $attrib);
- }
- for ($id= $base; $id++; $id < pow(2,32)){
- if (!in_array($id, $ids)){
- return ($id);
- }
- }
-
- /* Check if id reached maximum */
- if ($id >= pow(2,32)){
- msg_dialog::display(_("Error"), _("Cannot allocate a free ID!"), ERROR_DIALOG);
- exit;
- }
- }
function getCopyDialog()
{