diff --git a/lam/templates/lists/listusers.php b/lam/templates/lists/listusers.php index 363c4d7d..29218cc3 100644 --- a/lam/templates/lists/listusers.php +++ b/lam/templates/lists/listusers.php @@ -63,7 +63,7 @@ if ($trans_primary == "on" && !$_GET["norefresh"]) { $usr_units = $_SESSION['usr_units']; // check if button was pressed and if we have to add/delete a user or create a PDF -if ($_POST['new_user'] || $_POST['del_user'] || $_POST['pdf_user']){ +if ($_POST['new_user'] || $_POST['del_user'] || $_POST['pdf_user'] || $_POST['pdf_all']){ // add new user if ($_POST['new_user']){ metaRefresh("../account.php?type=user"); @@ -76,18 +76,28 @@ if ($_POST['new_user'] || $_POST['del_user'] || $_POST['pdf_user']){ $userstr = implode(";", $users); metaRefresh("../delete.php?type=user&DN='$userstr'"); } - // PDF + // PDF for selected users elseif ($_POST['pdf_user']){ // search for checkboxes $users = array_keys($_POST, "on"); - $userlist = array(); + $list = array(); // load users from LDAP for ($i = 0; $i < sizeof($users); $i++) { - $userlist[$i] = loaduser($users[$i]); - $userlist[$i]->unix_password = ""; - $userlist[$i]->smb_password = ""; + $list[$i] = loaduser($users[$i]); + $list[$i]->unix_password = ""; + $list[$i]->smb_password = ""; } - createUserPDF($userlist); + if (sizeof($list) > 0) createUserPDF($list); + } + // PDF for all users + elseif ($_POST['pdf_all']){ + $list = array(); + for ($i = 0; $i < sizeof($_SESSION['userlist']); $i++) { + $list[$i] = loaduser($_SESSION['userlist'][$i]['dn']); + $list[$i]->unix_password = ""; + $list[$i]->smb_password = ""; + } + if (sizeof($list) > 0) createUserPDF($list); } exit; } @@ -321,8 +331,9 @@ echo ("

\n"); echo ("\n"); if ($user_count != 0) { echo ("\n"); - echo ("      "); - echo ("\n"); + echo ("        "); + echo ("\n"); + echo ("\n"); } echo ("

\n"); @@ -333,7 +344,7 @@ echo "\n"; /** * @brief draws a navigation bar to switch between pages - * + * * * @return void */