changed layout

This commit is contained in:
Roland Gruber 2008-12-16 16:52:20 +00:00
parent 4f2fe2db31
commit 186daaf35d
1 changed files with 65 additions and 74 deletions

View File

@ -3,7 +3,7 @@
$Id$
This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam)
Copyright (C) 2003 - 2006 Roland Gruber
Copyright (C) 2003 - 2008 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
@ -61,33 +61,26 @@ if (!$_SESSION['ldap'] || !$_SESSION['ldap']->server()) {
exit;
}
// on abort go back to main page
if (isset($_POST['abort'])) {
metaRefresh("../tools.php");
// check if new profile should be created
elseif (isset($_POST['createProfileButton'])) {
metaRefresh("profilepage.php?type=" . $_POST['createProfile']);
exit;
}
// check if user has pressed submit button
elseif (isset($_POST['submit'])) {
// forward to other profile pages
if ($_POST['submit']) {
for ($i = 0; $i < sizeof($profileClasses); $i++) {
// create new profile
if ($_POST['profile'] == ("new" . $profileClasses[$i]['scope'])) {
metaRefresh("profilepage.php?type=" . $profileClasses[$i]['scope']);
}
// edit profile
elseif($_POST['profile'] == ("edit" . $profileClasses[$i]['scope'])) {
metaRefresh("profilepage.php?type=" . $profileClasses[$i]['scope'] .
"&amp;edit=" . $_POST['e_' . $profileClasses[$i]['scope']]);
}
// delete profile
elseif($_POST['profile'] == ("del" . $profileClasses[$i]['scope'])) {
metaRefresh("profiledelete.php?type=" . $profileClasses[$i]['scope'] .
"&amp;del=" . $_POST['d_' . $profileClasses[$i]['scope']]);
}
}
// check if a profile should be edited
for ($i = 0; $i < sizeof($profileClasses); $i++) {
if (isset($_POST['editProfile_' . $profileClasses[$i]['scope']]) || isset($_POST['editProfile_' . $profileClasses[$i]['scope'] . '_x'])) {
metaRefresh("profilepage.php?type=" . $profileClasses[$i]['scope'] .
"&amp;edit=" . $_POST['profile_' . $profileClasses[$i]['scope']]);
exit;
}
}
// check if a profile should be deleted
for ($i = 0; $i < sizeof($profileClasses); $i++) {
if (isset($_POST['deleteProfile_' . $profileClasses[$i]['scope']]) || isset($_POST['deleteProfile_' . $profileClasses[$i]['scope'] . '_x'])) {
metaRefresh("profiledelete.php?type=" . $profileClasses[$i]['scope'] .
"&amp;del=" . $_POST['profile_' . $profileClasses[$i]['scope']]);
exit;
}
exit;
}
// get list of profiles for each account type
@ -111,63 +104,61 @@ for ($i = 0; $i < sizeof($profileClasses); $i++) {
echo "</head>\n";
echo "<body>\n";
echo "<br>\n";
echo "<h1>" . _('Profile editor') . "</h1>\n";
echo "<br>\n";
echo "<form action=\"profilemain.php\" method=\"post\">\n";
// new profile
echo "<fieldset class=\"useredit\">\n";
echo "<legend>\n";
echo "<b>" . _('Create a new profile') . "</b>\n";
echo "</legend>\n";
echo "<br><table border=0>\n";
echo "<tr><td>\n";
echo "<select class=\"user\" name=\"createProfile\">\n";
for ($i = 0; $i < sizeof($profileClasses); $i++) {
echo "<option value=\"" . $profileClasses[$i]['scope'] . "\">" . $profileClasses[$i]['title'] . "</option>\n";
}
echo "</select>\n";
echo "</td>\n";
echo "<td>\n";
echo "<input type=\"submit\" name=\"createProfileButton\" value=\"" . _('Create') . "\">";
echo "</td></tr>\n";
echo "</table>\n";
echo "</fieldset>\n";
echo "<br>\n";
// existing profiles
echo "<fieldset class=\"useredit\">\n";
echo "<legend>\n";
echo "<b>" . _('Manage existing profiles') . "</b>\n";
echo "</legend>\n";
echo "<br><table border=0>\n";
for ($i = 0; $i < sizeof($profileClasses); $i++) {
echo "<fieldset class=\"" . $profileClasses[$i]['scope'] . "edit\">\n";
echo "<legend>\n";
echo "<b>" . $profileClasses[$i]['title'] . "</b>\n";
echo "</legend>\n";
echo "<table border=0>\n";
// new profile
echo "<tr>\n";
echo "<td>\n";
echo "<input type=\"radio\" name=\"profile\" value=\"new" . $profileClasses[$i]['scope'] . "\">\n";
echo "</td>\n";
echo "<td colspan=2>" . _("Create a new profile") . "</td>\n";
echo "<td>";
echo "<img alt=\"" . $profileClasses[$i]['title'] . "\" src=\"../../graphics/" . $profileClasses[$i]['scope'] . ".png\">&nbsp;\n";
echo $profileClasses[$i]['title'];
echo "</td>\n";
echo "<td>&nbsp;";
echo "<select class=\"user\" style=\"width: 20em;\" name=\"profile_" . $profileClasses[$i]['scope'] . "\">\n";
echo $profileClasses[$i]['profiles'];
echo "</select>\n";
echo "</td>\n";
echo "<td>&nbsp;";
echo "<input type=\"image\" src=\"../../graphics/edit.png\" name=\"editProfile_" . $profileClasses[$i]['scope'] . "\" " .
"alt=\"" . _('Edit') . "\" title=\"" . _('Edit') . "\">";
echo "&nbsp;";
echo "<input type=\"image\" src=\"../../graphics/delete.png\" name=\"deleteProfile_" . $profileClasses[$i]['scope'] . "\" " .
"alt=\"" . _('Delete') . "\" title=\"" . _('Delete') . "\">";
echo "</td>\n";
echo "</tr>\n";
// edit profile
echo "<tr>\n";
echo "<td>\n";
echo "<input type=\"radio\" name=\"profile\" value=\"edit" . $profileClasses[$i]['scope'] . "\">\n";
echo "</td>\n";
echo "<td>\n";
echo "<select class=\"" . $profileClasses[$i]['scope'] . "\" name=\"e_" . $profileClasses[$i]['scope'] . "\" size=1>\n";
echo $profileClasses[$i]['profiles'];
echo "</select>\n";
echo "</td>\n";
echo "<td>" . _("Edit profile") . "</td>\n";
echo "</tr>\n";
// delete profile
echo "<tr>\n";
echo "<td>\n";
echo "<input type=\"radio\" name=\"profile\" value=\"del" . $profileClasses[$i]['scope'] . "\">\n";
echo "</td>\n";
echo "<td>\n";
echo "<select class=\"" . $profileClasses[$i]['scope'] . "\" name=\"d_" . $profileClasses[$i]['scope'] . "\" size=1>\n";
echo $profileClasses[$i]['profiles'];
echo "</select>\n";
echo "</td>\n";
echo "<td>" . _("Delete profile") . "</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "</fieldset>\n";
echo "<br>\n";
}
echo "<p>\n";
echo "<input type=\"submit\" name=\"submit\" value=\"" . _("Ok") . "\">\n";
echo "<input type=\"submit\" name=\"abort\" value=\"" . _("Cancel") . "\">\n";
echo "</p>\n";
echo "</table>\n";
echo "</fieldset>\n";
echo "<br>\n";
echo "</form>\n";
echo "</body>\n";