Code

Fixed missing images problem in group headpage
[gosa.git] / plugins / admin / users / class_userManagement.inc
index 5b77b007519e4c4f6e0cd1454497c962f9f8d68f..a8454b530bbba572d0059960147d7a701c29e570 100644 (file)
@@ -457,15 +457,26 @@ class userManagement extends plugin
 
     /* Generate template list */
     if (($s_action=="new")||($s_action=="create_user_from_tpl")){
+
       $this->templates= array();
+
       $ldap= $this->config->get_ldap_link();
+
+      /* Create list of tempaltes */
       foreach ($this->config->departments as $key => $value){
+    
+        /* Get acls from different ou's */
         $acl= get_permissions (get_people_ou().$value, $this->ui->subtreeACL);
         $acl= get_module_permission($acl, "user", get_people_ou().$value);
+  
+        /* If creation of a new user is allowed, append this template */
         if (chkacl($acl, "create") == ""){
+          
+          /* Search all templates from the current dn */
           $ldap->cd (get_people_ou().$value);
           $ldap->search ("(objectClass=gosaUserTemplate)", array("uid"));
 
+          /* Append */
           if ($ldap->count() != 0){
             while ($attrs= $ldap->fetch()){
               $this->templates[$ldap->getDN()]=
@@ -475,6 +486,8 @@ class userManagement extends plugin
           }
         }
       }
+
+      /* Sort templates */
       natcasesort ($this->templates);
       reset ($this->templates);
     }
@@ -494,6 +507,7 @@ class userManagement extends plugin
       $this->usertab= new usertabs($this->config,
           $this->config->data['TABS']['USERTABS'], $this->dn);
       $this->usertab->set_acl(array(':all'));
+      $this->usertab->by_object['user']->base= $userfilter['depselect'];
 
       /* Take care about templates */
       if ($s_action=="new_tpl"){
@@ -511,7 +525,7 @@ class userManagement extends plugin
         if ($s_action=="create_user_from_tpl"){
           $smarty->assign("template", $this->dn= $this->list[trim($s_entry)]['dn']);
         } else {
-          $smarty->assign("template", "");
+          $smarty->assign("template", "none");
         }
         $smarty->assign("edit_uid", "");
         return($smarty->fetch(get_template_path('template.tpl', TRUE)));
@@ -709,7 +723,7 @@ class userManagement extends plugin
                     name='user_edit_%KEY%-user' title='"._("Edit generic properties")."'>";
     $posiximg = "<input type='image' src='images/select_user.png' alt='"._("Posix")."'  
                     name='user_edit_%KEY%-posixAccount' title='"._("Edit UNIX properties")."'>";
-    $eviroimg = "<input type='image' src='images/network.png' alt='"._("Environment")."'  
+    $eviroimg = "<input type='image' src='images/smallenv.png' alt='"._("Environment")."'  
                     name='user_edit_%KEY%-environment' title='"._("Edit environment properties")."'>";
     $mailimg  = "<input type='image' src='images/mailto.png' alt='"._("Mail")."'     
                     name='user_edit_%KEY%-mailAccount' title='"._("Edit mail properties")."'>";
@@ -751,7 +765,7 @@ class userManagement extends plugin
       /* 
         If you want to disable the status pictures, just comment out the next line
       */
-      $r_con= @mysql_connect($a_SETUP['SERVER'],$a_SETUP['LOGIN'],$a_SETUP['PASSWORD']);
+      $r_con= @mysql_pconnect($a_SETUP['SERVER'],$a_SETUP['LOGIN'],$a_SETUP['PASSWORD']);
       // Check if we are  connected correctly
       if($r_con){
         $r_db  =  @mysql_select_db($a_SETUP['DB'],$r_con);
@@ -793,6 +807,8 @@ class userManagement extends plugin
         $fonac=$empty;
       }
 
+    
+
       // Specify Pics for Extensions  
       if(in_array("posixAccount"    ,$val['objectClass'])){ 
         $posix = preg_replace("/%KEY%/", "$key", $posiximg);
@@ -894,6 +910,7 @@ class userManagement extends plugin
     $smarty->assign("alphabet", generate_alphabet());
     $smarty->assign("hint", print_sizelimit_warning());
 
+    @mysql_close($r_con);
     return ($smarty->fetch(get_template_path('headpage.tpl', TRUE)));
   }