X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-core%2Fplugins%2Fadmin%2Fgroups%2Fclass_groupGeneric.inc;h=82fed9121cd643897cd8e792d3c03b617c865e1d;hb=ed78890a0b417c288d33f20487d35b57223451ff;hp=0cf314a07203b693983543b205635f2de7bd62c1;hpb=13a04c3a96a2d60c318be2e1712a363501db0e73;p=gosa.git diff --git a/gosa-core/plugins/admin/groups/class_groupGeneric.inc b/gosa-core/plugins/admin/groups/class_groupGeneric.inc index 0cf314a07..82fed9121 100644 --- a/gosa-core/plugins/admin/groups/class_groupGeneric.inc +++ b/gosa-core/plugins/admin/groups/class_groupGeneric.inc @@ -192,7 +192,7 @@ class group extends plugin } 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; @@ -804,10 +804,8 @@ class group extends plugin $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"); @@ -913,7 +911,7 @@ class group extends plugin } } add_lock ("gidnumber", "gosa"); - $this->gidNumber= $this->get_next_id("gidNumber", $this->dn); + $this->gidNumber= get_next_id("gidNumber", $this->dn); } } @@ -1203,45 +1201,6 @@ class group extends plugin 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() {