From 790a2af6357cf9e47f9c448c46adea6de9abae2e Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 17 Apr 2007 11:01:16 +0000 Subject: [PATCH] Fixed layout and skip removing users if no user is selected git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6069 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/users/class_divListUsers.inc | 4 ++- plugins/admin/users/class_userManagement.inc | 37 +++++++++++--------- 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/plugins/admin/users/class_divListUsers.inc b/plugins/admin/users/class_divListUsers.inc index 43883eed3..177be0a36 100644 --- a/plugins/admin/users/class_divListUsers.inc +++ b/plugins/admin/users/class_divListUsers.inc @@ -57,6 +57,7 @@ class divListUsers extends MultiSelectWindow /* set Page header */ $this->AddHeader(array("string"=> $chk, "attach"=>"style='width:20px;'")); + $this->AddHeader(array("string"=> " ", "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." ".$posix." ".$enviro." ".$maila." ".$fonac." ".$faxac." ".$samba." ".$netatalk; /* Create each field */ - $field0 = array("string" => ""); + $field0 = array("string" => "" , + "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('/ /', ' ', @LDAP::fix($val['dn']))."'"); $field3 = array("string" => $UseImg, "attach" => "style='width:166px;'"); diff --git a/plugins/admin/users/class_userManagement.inc b/plugins/admin/users/class_userManagement.inc index ff480bea7..9d24b558f 100644 --- a/plugins/admin/users/class_userManagement.inc +++ b/plugins/admin/users/class_userManagement.inc @@ -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 = "
";
-      foreach($this->dns as $dn){
-        add_lock ($dn, $this->ui->dn);
-        $dns_names .= $dn."\n";
-      }
-      $dns_names .="
"; - /* 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 = "
";
+        foreach($this->dns as $dn){
+          add_lock ($dn, $this->ui->dn);
+          $dns_names .= $dn."\n";
+        }
+        $dns_names .="
"; + + /* 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))); + } } -- 2.30.2