added delete links and updated images

This commit is contained in:
Roland Gruber 2007-04-21 11:04:50 +00:00
parent 2370dc1f19
commit b03416fbc2
4 changed files with 88 additions and 5 deletions

View File

@ -384,9 +384,9 @@ class lamList {
echo " <td height=22 align=\"center\"><input onClick=\"list_click(this, '" . $info[$i]['LAM_ID'] . "', '" . $this->type . "')\"" .
" type=\"checkbox\" name=\"" . $info[$i]['LAM_ID'] . "\"></td>\n";
}
echo " <td align='center'><a href=\"../account/edit.php?type=" . $this->type . "&amp;DN='" . $info[$i]['dn'] . "'\">";
echo "<img src=\"../../graphics/edit.gif\" alt=\"" . _("Edit") . "\" title=\"" . _("Edit") . "\">";
echo "</a></td>\n";
echo " <td align='center'>";
$this->listPrintToolLinks($info[$i]);
echo "</td>\n";
for ($k = 0; $k < sizeof($this->attrArray); $k++) {
echo ("<td>");
$attrName = strtolower($this->attrArray[$k]);
@ -406,6 +406,22 @@ class lamList {
echo ("</table>");
}
/**
* Prints the tool image links (e.g. edit and delete) for each account.
*
* $account array LDAP attributes
*/
function listPrintToolLinks($account) {
// edit image
echo "<a href=\"../account/edit.php?type=" . $this->type . "&amp;DN='" . $account['dn'] . "'\">";
echo "<img src=\"../../graphics/edit.png\" alt=\"" . _("Edit") . "\" title=\"" . _("Edit") . "\">";
echo "</a>";
// delete image
echo "<a href=\"deletelink.php?type=" . $this->type . "&amp;DN='" . $account['dn'] . "'\">";
echo "<img src=\"../../graphics/delete.png\" alt=\"" . _("Delete") . "\" title=\"" . _("Delete") . "\">";
echo "</a>";
}
/**
* Prints the content of a cell in the account list for a given LDAP entry and attribute.
*

View File

@ -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;

View File

@ -0,0 +1,67 @@
<?php
/*
$Id$
This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam)
Copyright (C) 2007 Roland Gruber
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more detaexils.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/**
* This page will redirect to delete.php if the given user is valid.
*
* It is called from the list views via the delete links.
*
* @package lists
* @author Roland Gruber
*/
/** security functions */
include_once("../../lib/security.inc");
/** Needed to find DNs of users */
include_once("../../lib/ldap.inc");
/** Used to display error messages */
include_once("../../lib/status.inc");
// start session
startSecureSession();
setlanguage();
// get account name and type
$dn = $_GET['DN'];
$type = $_GET['type'];
if (isset($dn) && isset($type)) {
$dn = str_replace("\\", '',$dn);
$dn = str_replace("'", '',$dn);
$_SESSION['delete_dn'] = array($dn);
// redirect to delete.php
metaRefresh("../delete.php?type=" . $type);
}
else {
// print error message if user was not found
echo $_SESSION['header'];
echo "<title>userlink</title>\n";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../../style/layout.css\">\n";
echo "</head><body>\n";
StatusMessage("ERROR", "No account or type given.");
echo ("</body></html>\n");
}
?>

View File

@ -66,7 +66,7 @@ $types = $_SESSION['config']->get_ActiveTypes();
<td align="center">
<a href="http://lam.sourceforge.net" target="new_window"><img src="../graphics/banner.jpg" border=1 alt="LDAP Account Manager"></a>
</td>
<td width="200" align="right" height=20><a href="./logout.php" target="_top"><img alt="logout" src="../graphics/go.png">&nbsp;<big><b><?php echo _("Logout") ?></b></big></a></td>
<td width="200" align="right" height=20><a href="./logout.php" target="_top"><img alt="logout" src="../graphics/exit.png">&nbsp;<big><b><?php echo _("Logout") ?></b></big></a></td>
</tr>
</table>
<p align="center">