Code

Fixed layout and skip removing users if no user is selected
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 17 Apr 2007 11:01:16 +0000 (11:01 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 17 Apr 2007 11:01:16 +0000 (11:01 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6069 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/users/class_divListUsers.inc
plugins/admin/users/class_userManagement.inc

index 43883eed3e830c3e09dfdf0cf030e78090ed934f..177be0a36186be4914eb7ad77c679b5841b49b78 100644 (file)
@@ -57,6 +57,7 @@ class divListUsers extends MultiSelectWindow
 
     /* set Page header */
     $this->AddHeader(array("string"=> $chk,          "attach"=>"style='width:20px;'"));
+    $this->AddHeader(array("string"=> "&nbsp;",          "attach"=>"style='width:20px;'"));
     $this->AddHeader(array("string"=>_("Username")." / "._("Department")));
     $this->AddHeader(array("string"=>_("Properties"),   "attach" => "style='width:166px;'"));
     $this->AddHeader(array("string"=>_("Actions"),      "attach" => "style='width:".$action_col_size."px;border-right:0px;text-align:right;'"));
@@ -296,7 +297,8 @@ class divListUsers extends MultiSelectWindow
       $UseImg = $usrimg2."&nbsp;".$posix."&nbsp;".$enviro."&nbsp;".$maila."&nbsp;".$fonac."&nbsp;".$faxac."&nbsp;".$samba."&nbsp;".$netatalk;
 
       /* Create each field */
-      $field0 = array("string" => "<input type='checkbox' id='item_selected_".$key."' name='item_selected_".$key."' >");
+      $field0 = array("string" => "<input type='checkbox' id='item_selected_".$key."' name='item_selected_".$key."'>" ,
+                      "attach" => "style='width:20px;'");
       $field1 = array("string" => sprintf($tpl,$val['dn']), "attach" => "style='text-align:center;width:20px;'");
       $field2 = array("string" => sprintf($editlink,$key,$display), "attach" => "style='' title='".preg_replace('/ /', '&nbsp;', @LDAP::fix($val['dn']))."'");
       $field3 = array("string" => $UseImg, "attach" => "style='width:166px;'");
index ff480bea78b3e5365e3b03679a7377afa3b95b1a..9d24b558f2996da673e45c9a726be3b3c04f88ad 100644 (file)
@@ -295,25 +295,30 @@ class userManagement extends plugin
     if ($s_action=="del_multiple"){
       $ids = $this->list_get_selected_items();
 
-      foreach($ids as $id){
-        $dn = $this->list[$id]['dn'];
-        if (($user= get_lock($dn)) != ""){
-          return(gen_locked_message ($user, $dn));
+      if(count($ids)){
+
+        foreach($ids as $id){
+          $dn = $this->list[$id]['dn'];
+          if (($user= get_lock($dn)) != ""){
+            return(gen_locked_message ($user, $dn));
+          }
+          $this->dns[$id] = $dn; 
         }
-        $this->dns[$id] = $dn; 
-      }
 
-      $dns_names = "<br><pre>";
-      foreach($this->dns as $dn){
-        add_lock ($dn, $this->ui->dn);
-        $dns_names .= $dn."\n";
-      }
-      $dns_names .="</pre>";
 
-      /* Lock the current entry, so nobody will edit it during deletion */
-      $smarty->assign("info",     sprintf(_("You're about to delete the following user(s) %s"), @LDAP::fix($dns_names)));
-      $smarty->assign("multiple", true);
-      return($smarty->fetch(get_template_path('remove.tpl', TRUE)));
+
+        $dns_names = "<br><pre>";
+        foreach($this->dns as $dn){
+          add_lock ($dn, $this->ui->dn);
+          $dns_names .= $dn."\n";
+        }
+        $dns_names .="</pre>";
+
+        /* Lock the current entry, so nobody will edit it during deletion */
+        $smarty->assign("info",     sprintf(_("You're about to delete the following user(s) %s"), @LDAP::fix($dns_names)));
+        $smarty->assign("multiple", true);
+        return($smarty->fetch(get_template_path('remove.tpl', TRUE)));
+      }
     }