Code

Fixed foreach error
[gosa.git] / plugins / admin / users / class_userManagement.inc
index fbc3ab56b9cf4df74d5b90d7de1b40ffb2cf73f6..88936bd503a44fca137274790f3a877074bdd5c7 100644 (file)
@@ -350,7 +350,7 @@ class userManagement extends plugin
 
         /* Lock the current entry, so nobody will edit it during deletion */
         add_lock ($this->dn, $this->ui->dn);
-        $smarty->assign("info", sprintf(_("You're about to delete the user %s."), $this->dn));
+        $smarty->assign("info", sprintf(_("You're about to delete the user %s."), LDAP::fix($this->dn)));
         return($smarty->fetch(get_template_path('remove.tpl', TRUE)));
       } else {
 
@@ -674,13 +674,13 @@ class userManagement extends plugin
       " <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>".
+      _("Base")."&nbsp;<select name='depselect' onChange='mainform.submit()' class='center'>$options</select>".
       " <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")."'>";
-    $action.= "<input type='image' src='images/list_password.png' alt='"._("password")."' name='user_chgpw_%KEY%' title='"._("Change password")."'>";
-    $action.= "<input type='image' src='images/edittrash.png' alt='"._("delete")."'   name='user_del_%KEY%' title='"._("Delete user")."'>";
+    $action= "<input class='center' type='image' src='images/edit.png' alt='"._("edit")."'     name='user_edit_%KEY%' title='"._("Edit user")."'>";
+    $action.= "<input class='center' type='image' src='images/list_password.png' alt='"._("password")."' name='user_chgpw_%KEY%' title='"._("Change password")."'>";
+    $action.= "<input class='center' type='image' src='images/edittrash.png' alt='"._("delete")."'   name='user_del_%KEY%' title='"._("Delete user")."'>";
 
 
 
@@ -723,29 +723,29 @@ class userManagement extends plugin
     }
 
     /* Pictures for Extensions */
-    $usrimg   ="<input type='image' src='images/penguin.png' alt='"._("GOsa")."'   
+    $usrimg   ="<input class='center' type='image' src='images/penguin.png' alt='"._("GOsa")."'   
                     name='user_edit_%KEY%-user' title='"._("Edit generic properties")."'>";
-    $posiximg = "<input type='image' src='images/select_user.png' alt='"._("Posix")."'  
+    $posiximg = "<input class='center' type='image' src='images/select_user.png' alt='"._("Posix")."'  
                     name='user_edit_%KEY%-posixAccount' title='"._("Edit UNIX properties")."'>";
-    $eviroimg = "<input type='image' src='images/smallenv.png' alt='"._("Environment")."'  
+    $eviroimg = "<input class='center' 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")."'     
+    $mailimg  = "<input class='center' type='image' src='images/mailto.png' alt='"._("Mail")."'     
                     name='user_edit_%KEY%-mailAccount' title='"._("Edit mail properties")."'>";
-    $fonimg   = "<input type='image' src='images/%image%' alt='"._("Phone")."'     
+    $fonimg   = "<input class='center' type='image' src='images/%image%' alt='"._("Phone")."'     
                     name='user_edit_%KEY%-phoneAccount' title='"._("Edit phone properties")."%title%'>";
-    $faximg   = "<input type='image' src='images/fax_small.png' alt='"._("Fax")."'     
+    $faximg   = "<input class='center' type='image' src='images/fax_small.png' alt='"._("Fax")."'     
                     name='user_edit_%KEY%-gofaxAccount' title='"._("Edit fax properies")."'>";
-    $sambaimg = "<input type='image' src='images/select_winstation.png' alt='"._("Samba")."'     
+    $sambaimg = "<input class='center' type='image' src='images/select_winstation.png' alt='"._("Samba")."'     
                     name='user_edit_%KEY%-sambaAccount' title='"._("Edit samba properties")."'>"; 
-    $tplcreateuserimg  = "<input type='image' src='images/list_new.png' alt='"._("Create user from template")."'
+    $tplcreateuserimg  = "<input type='image' class='center' src='images/list_new.png' alt='"._("Create user from template")."'
                     name='userfrom_tpl_%KEY%' title='"._("Create user with this template")."'>";   
     
 
-    $empty    = "<img src='images/empty.png' style='width:16px;height:16px;' alt=''>"; 
+    $empty    = "<img class='center' src='images/empty.png' style='width:16px;height:16px;' alt=''>"; 
 
     // User and Template  Images  
-    $userimg  = "<img src='images/select_user.png' alt='User' title='%s'>";   
-    $tplimg   = "<img src='images/select_template.png' alt='Template' title='%s'>";   
+    $userimg  = "<img class='center' src='images/select_user.png' alt='User' title='%s'>";   
+    $tplimg   = "<img class='center' src='images/select_template.png' alt='Template' title='%s'>";   
     $editlink = "<a href='?plug=".$_GET['plug']."&amp;id=%s&amp;act=edit_entry'>%s</a>";
 
     // Defines Arrays to save User and Templates
@@ -991,7 +991,13 @@ class userManagement extends plugin
      */
 
     /* Create base to search in */
-    $base2 = preg_replace("/ou=people,/i","",$base);
+
+    $peopleOU = get_people_ou();
+    if(empty($peopleOU))  {
+      $base2 = $base;
+    }else{
+      $base2 = preg_replace("/".$peopleOU."/i","",$base);
+    }
 
     /* Get all departments within this subtree */
     $res3 =  get_list2($this->ui->subtreeACL, "(&(|(ou=$regex)(description=$regex))(objectClass=gosaDepartment))",