Code

Fixed base selection
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 6 Sep 2006 04:23:27 +0000 (04:23 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 6 Sep 2006 04:23:27 +0000 (04:23 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4599 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/ogroups/class_ogroup.inc
plugins/admin/ogroups/class_termgroup.inc

index 5c1f9f3243948a6649409688ff2460d057d67495..e9a99886130d398a6409b694957840f34710777d 100644 (file)
@@ -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();
+  
     }
   }
 
@@ -746,7 +761,6 @@ class ogroup extends plugin
                                                       "objectClass"  => "gosaGroupOfNames")),
           "plProvidedAcls"=> array(
             "cn"                => _("Name"),
-            "base"              => _("Base"),
             "description"       => _("Description"),
             "member"            => _("Member"))
           ));
index 2d3d5e94217b6958006577bbf2ad962b33eb835a..855bfadeab90473bc5d25ac673abbaf76abfead2 100644 (file)
@@ -104,7 +104,7 @@ class termgroup extends plugin
      /* Call common method to give check the hook */
     $message= plugin::check();
 
-    if ($this->acl_is_createable()){
+    if ($this->acl_is_createable() && $this->dn == "new"){
       $message[]= _("You have no permissions to create a workstation on this 'Base'.");
     }