From dbed9fa72eabaad2494c9ec0cca962c5a122d6fe Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Sat, 23 Aug 2003 09:22:13 +0000 Subject: [PATCH] added PDF button --- lam/templates/lists/listusers.php | 50 ++++++++++++++++++++----------- 1 file changed, 33 insertions(+), 17 deletions(-) diff --git a/lam/templates/lists/listusers.php b/lam/templates/lists/listusers.php index f18b7411..b1fb51ed 100644 --- a/lam/templates/lists/listusers.php +++ b/lam/templates/lists/listusers.php @@ -23,6 +23,8 @@ $Id$ include_once ("../../lib/config.inc"); include_once("../../lib/ldap.inc"); +include_once("../../lib/pdf.inc"); +include_once("../../lib/account.inc"); // used to display status messages include_once ("../../lib/status.inc"); @@ -60,21 +62,31 @@ 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 -if ($_POST['new_user'] || $_POST['del_user']){ - // add new user - if ($_POST['new_user']){ - echo(""); - exit; - } - // delete user(s) - if ($_POST['del_user']){ - // search for checkboxes - $users = array_keys($_POST, "on"); - $userstr = implode(";", $users); - echo(""); - } - exit; +// 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']){ + // add new user + if ($_POST['new_user']){ + echo(""); + exit; + } + // delete user(s) + elseif ($_POST['del_user']){ + // search for checkboxes + $users = array_keys($_POST, "on"); + $userstr = implode(";", $users); + echo(""); + } + // PDF + elseif ($_POST['pdf_user']){ + // search for checkboxes + $users = array_keys($_POST, "on"); + print_r($users); + $userlist = array(); + // load users from LDAP + for ($i = 0; $i < sizeof($users); $i++) $userlist[] = loaduser($users[$i]); + createUserPDF($userlist); + } + exit; } echo $_SESSION['header']; @@ -303,8 +315,12 @@ if (in_array("gidnumber", $attr_array)) { echo ("

 

\n"); echo ("

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

\n"); echo ("

 

\n");