X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=plugins%2Fadmin%2Fogroups%2Fclass_ogroup.inc;h=6d51281be825dd86dd73c3b1f3c93f870af80187;hb=0eebfd3829749fcdcc5d9995ca9675d99f81888a;hp=5867d460da27d4dd3545ac1e60a9be17a6596288;hpb=8bc427075722dbf4a29020ba64cb4d4effb5dd99;p=gosa.git diff --git a/plugins/admin/ogroups/class_ogroup.inc b/plugins/admin/ogroups/class_ogroup.inc index 5867d460d..6d51281be 100644 --- a/plugins/admin/ogroups/class_ogroup.inc +++ b/plugins/admin/ogroups/class_ogroup.inc @@ -175,19 +175,34 @@ class ogroup extends plugin $smarty->assign($name."ACL",$this->getacl($name)); } + /* Create base acls */ + $baseACL = $this->getacl("base",(!is_object($this->parent) && !isset($_SESSION['edit']))); + if(!$this->acl_is_moveable()) { + $baseACL = preg_replace("/w/","",$baseACL); + } + $smarty->assign("baseACL", $baseACL); + + + /* Get bases */ + $ui = get_userinfo(); + $check = $ui->get_module_departments("ogroups"); + $bases = array(); + foreach($check as $dn_allowed){ + $bases[$dn_allowed] = $this->config->idepartments[$dn_allowed]; + } /* Base select dialog */ $once = true; foreach($_POST as $name => $value){ - if(preg_match("/^chooseBase/",$name) && $once){ + if(preg_match("/^chooseBase/",$name) && $once && $this->acl_is_moveable()){ $once = false; - $this->dialog = new baseSelectDialog($this->config,$this); + $this->dialog = new baseSelectDialog($this->config,$this,$bases); $this->dialog->setCurrentBase($this->base); } } /* Dialog handling */ - if(is_object($this->dialog)){ + if(is_object($this->dialog) && $this->acl_is_moveable()){ /* Must be called before save_object */ $this->dialog->save_object(); @@ -267,8 +282,7 @@ class ogroup extends plugin } /* Bases / Departments */ - - if (isset($_POST['base'])){ + if ((isset($_POST['base'])) && ($this->acl_is_moveable())){ $this->base= $_POST['base']; } @@ -301,7 +315,7 @@ class ogroup extends plugin } /* Assign variables */ - $smarty->assign("bases", $this->config->idepartments); + $smarty->assign("bases", $bases); $smarty->assign("base_select", $this->base); $smarty->assign("department", $this->department); $smarty->assign("members", $this->convert_list($this->memberList)); @@ -324,6 +338,7 @@ class ogroup extends plugin /* Save additional values for possible next step */ if (isset($_POST['ogroupedit'])){ plugin::save_object(); + } } @@ -638,7 +653,7 @@ class ogroup extends plugin $message[]= _("There is already an object with this cn."); } - if ($this->orig_dn == "new" && $this->acl_is_createable()){ + if ($this->orig_dn == "new" && !$this->acl_is_createable()){ $message[]= _("You have no permissions to create a group on this 'Base'."); } @@ -664,7 +679,7 @@ class ogroup extends plugin /* Move members to target array */ $this->attrs['member'] =array(); foreach ($this->member as $key => $desc){ - $this->attrs['member'][]= $key; + $this->attrs['member'][]= @LDAP::fix($key); } $ldap= $this->config->get_ldap_link();