From b03416fbc2a62a12e3fea140b282f310528a2121 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Sat, 21 Apr 2007 11:04:50 +0000 Subject: [PATCH] added delete links and updated images --- lam/lib/lists.inc | 22 ++++++++-- lam/templates/delete.php | 2 +- lam/templates/lists/deletelink.php | 67 ++++++++++++++++++++++++++++++ lam/templates/main_header.php | 2 +- 4 files changed, 88 insertions(+), 5 deletions(-) create mode 100644 lam/templates/lists/deletelink.php diff --git a/lam/lib/lists.inc b/lam/lib/lists.inc index 4f62b4a7..e0b03c5a 100644 --- a/lam/lib/lists.inc +++ b/lam/lib/lists.inc @@ -384,9 +384,9 @@ class lamList { echo " type . "')\"" . " type=\"checkbox\" name=\"" . $info[$i]['LAM_ID'] . "\">\n"; } - echo " type . "&DN='" . $info[$i]['dn'] . "'\">"; - echo "\"""; - echo "\n"; + echo " "; + $this->listPrintToolLinks($info[$i]); + echo "\n"; for ($k = 0; $k < sizeof($this->attrArray); $k++) { echo (""); $attrName = strtolower($this->attrArray[$k]); @@ -406,6 +406,22 @@ class lamList { echo (""); } + /** + * Prints the tool image links (e.g. edit and delete) for each account. + * + * $account array LDAP attributes + */ + function listPrintToolLinks($account) { + // edit image + echo "type . "&DN='" . $account['dn'] . "'\">"; + echo "\"""; + echo ""; + // delete image + echo "type . "&DN='" . $account['dn'] . "'\">"; + echo "\"""; + echo ""; + } + /** * Prints the content of a cell in the account list for a given LDAP entry and attribute. * diff --git a/lam/templates/delete.php b/lam/templates/delete.php index fd7689bc..efd79732 100644 --- a/lam/templates/delete.php +++ b/lam/templates/delete.php @@ -61,7 +61,7 @@ setlanguage(); if (!isset($_SESSION['cache'])) { $_SESSION['cache'] = new cache(); } -if ($_GET['type']) { +if (isset($_GET['type']) && isset($_SESSION['delete_dn'])) { // Create account list foreach ($_SESSION['delete_dn'] as $dn) { $start = strpos ($dn, "=")+1; diff --git a/lam/templates/lists/deletelink.php b/lam/templates/lists/deletelink.php new file mode 100644 index 00000000..7e41b282 --- /dev/null +++ b/lam/templates/lists/deletelink.php @@ -0,0 +1,67 @@ +userlink\n"; + echo "\n"; + echo "\n"; + StatusMessage("ERROR", "No account or type given."); + echo ("\n"); +} + +?> diff --git a/lam/templates/main_header.php b/lam/templates/main_header.php index 223b7dc8..5eb2d2ce 100644 --- a/lam/templates/main_header.php +++ b/lam/templates/main_header.php @@ -66,7 +66,7 @@ $types = $_SESSION['config']->get_ActiveTypes(); LDAP Account Manager - logout  + logout