Code

Removed old menu parsing
[gosa.git] / plugins / admin / users / class_userManagement.inc
index 623d7f3bb90ec66bcea75c9efc871b4c3c6ef9ad..fbc3ab56b9cf4df74d5b90d7de1b40ffb2cf73f6 100644 (file)
@@ -521,7 +521,8 @@ class userManagement extends plugin
       }
 
       /* Use template if there are any of them */
-      if ((count($this->templates) && !isset($_POST['new_template']))||($s_action=="create_user_from_tpl")){
+  
+      if ((count($this->templates) && ($s_action!='new_tpl'))||($s_action=="create_user_from_tpl")){
         foreach(array("sn", "givenName", "uid", "got_uid", "templates") as $attr){
           $smarty->assign("$attr", $this->$attr);
         }
@@ -666,15 +667,15 @@ class userManagement extends plugin
 
     /* NEW LIST MANAGMENT */
     $listhead = "<div style='background:#F0F0F9;padding:5px;'>".
-      " <input type='image' align='middle' src='images/list_back.png' title='"._("Go up one department")."' alt='"._("Up")."' name='dep_back'>&nbsp;".
-      " <input type='image' src='images/list_root.png' align='middle' title='"._("Go to root department")."' name='dep_root' alt='"._("Root")."'>&nbsp;".
-      " <input type='image' align='middle' src='images/list_home.png' title='"._("Go to users department")."' alt='"._("Home")."' name='dep_home'>&nbsp;".
-      " <img src='images/list_seperator.png' align='middle' alt='' height='16' width='1'>&nbsp;".
-      " <input type='image' align='middle' src='images/list_new_user.png' title='"._("Create new user")."' alt='"._("New user")."' name='user_new'>&nbsp;".
-      " <input type='image' align='middle' src='images/list_new.png' title='"._("Create new template")."' alt='"._("New template")."' name='user_tplnew'>&nbsp;".
-      " <img src='images/list_seperator.png' align='middle' alt='' height='16' width='1'>&nbsp;".
+      " <input class='center' type='image' align='middle' src='images/list_back.png' title='"._("Go up one department")."' alt='"._("Up")."' name='dep_back'>&nbsp;".
+      " <input class='center' type='image' src='images/list_root.png' align='middle' title='"._("Go to root department")."' name='dep_root' alt='"._("Root")."'>&nbsp;".
+      " <input class='center' type='image' align='middle' src='images/list_home.png' title='"._("Go to users department")."' alt='"._("Home")."' name='dep_home'>&nbsp;".
+      " <img   class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'>&nbsp;".
+      " <input class='center' type='image' align='middle' src='images/list_new_user.png' title='"._("Create new user")."' alt='"._("New user")."' name='user_new'>&nbsp;".
+      " <input class='center' type='image' align='middle' src='images/list_new.png' title='"._("Create new template")."' alt='"._("New template")."' name='user_tplnew'>&nbsp;".
+      " <img   class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'>&nbsp;".
       _("Current base")."&nbsp;<select name='depselect' onChange='mainform.submit()'>$options</select>".
-      " <input type='image' src='images/list_submit.png' align='middle' title='"._("Submit department")."' name='submit_department' alt='"._("Submit")."'>&nbsp;".
+      " <input class='center' type='image' src='images/list_submit.png' align='middle' title='"._("Submit department")."' name='submit_department' alt='"._("Submit")."'>&nbsp;".
       "</div>";
 
     $action= "<input type='image' src='images/edit.png' alt='"._("edit")."'     name='user_edit_%KEY%' title='"._("Edit user")."'>";
@@ -988,23 +989,31 @@ class userManagement extends plugin
      * We also need to search for the departments
      * So we are able to navigate like in konquerer 
      */
+
+    /* Create base to search in */
     $base2 = preg_replace("/ou=people,/i","",$base);
 
+    /* Get all departments within this subtree */
     $res3 =  get_list2($this->ui->subtreeACL, "(&(|(ou=$regex)(description=$regex))(objectClass=gosaDepartment))",
         TRUE, $base2, array("ou", "description"), TRUE);
 
     $this->departments= array();
 
+    /* Create array with results */
     $tmp = array();
     foreach ($res3 as $value){
       $tmp[strtolower($value['dn']).$value['dn']]=$value;
     }
+
+    /* Sort array */
     ksort($tmp);
+
+    /* Create result array */
     foreach($tmp as $value){
-      if($value["description"][0]!=".."){
+      if(isset($value['description'][0])){
         $this->departments[$value['dn']]=convert_department_dn2($value['dn'])." - [".$value["description"][0]."]";
       }else{
-        $this->departments[$value['dn']]=$value["description"][0];
+        $this->departments[$value['dn']]=convert_department_dn2($value['dn']);
       }
     }
     /* END NEW LIST MANAGMENT