Code

Added dynamic acl divs for extended settings. Currently only firefox is supported.
[gosa.git] / plugins / admin / departments / class_departmentManagement.inc
index cdfea0c4728de77c62b377fee1eaf2fcbd8f83bf..99f784c5a7703751a5dafbe97cba54b6ec4d1211 100644 (file)
@@ -67,10 +67,6 @@ class departmentManagement extends plugin
     $_SESSION['LOCK_VARS_TO_USE'] = array("/^act$/","/^id$/","/^dep_edit_.*/","/^dep_del_.*/");
 
     /* Reload departments */
-    $this->config->get_departments();
-    $this->config->make_idepartments();
-    $config= $this->config;
-
     $smarty                                            = get_smarty();
     $display                                   = "";
     $s_action                                  = "";  // Will contain an action, like del or edit
@@ -159,7 +155,7 @@ class departmentManagement extends plugin
         return(gen_locked_message($user, $this->dn));
       } else {
         add_lock ($this->dn, $this->ui->dn);
-        $smarty->assign("info", sprintf(_("You're about to delete the whole LDAP subtree placed under '%s'."), LDAP::fix($this->dn)));
+        $smarty->assign("info", sprintf(_("You're about to delete the whole LDAP subtree placed under '%s'."), @LDAP::fix($this->dn)));
         $display.= $smarty->fetch (get_template_path('remove.tpl', TRUE));
         return ($display);
       }
@@ -307,6 +303,7 @@ class departmentManagement extends plugin
       return ($display);
     }else{
       /* Display dialog with group list */
+      $this->DivListDepartment->parent = $this;
       $this->DivListDepartment->execute();
       $this->reload();
       $this->DivListDepartment->DepartmentsAdded = true;
@@ -347,6 +344,12 @@ class departmentManagement extends plugin
     }
 
     $this->departments= array();
+
+    /* Add current base to the list of available departments, but only if its naming attribute is 'ou' */
+    if(preg_match("/^ou=/",$base)){
+      $this->departments [ convert_department_dn($base) ] = ".";
+    }
+
     foreach ($res as $key => $value){
 
       /* Don't display base as entry on subsearch */
@@ -396,9 +399,14 @@ class departmentManagement extends plugin
 
   function save_object()
   {
+    /* reload department */
+    $this->config->get_departments();
+    $config = $this->config;
+
+    $this->config->make_idepartments();
     $this->DivListDepartment->save_object();
   }
-  
+
 }
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
 ?>