From 39798299236d86a8d6d80d8ec4e8919fbfb9834d Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Sun, 25 May 2003 10:57:32 +0000 Subject: [PATCH] initial checkin of profile editor create and change profiles not yet implemented --- lam/templates/profedit/profiledelete.php | 112 ++++++++++++ lam/templates/profedit/profilehost.php | 38 ++++ lam/templates/profedit/profilemain.php | 220 +++++++++++++++++++++++ lam/templates/profedit/profileuser.php | 38 ++++ 4 files changed, 408 insertions(+) create mode 100644 lam/templates/profedit/profiledelete.php create mode 100644 lam/templates/profedit/profilehost.php create mode 100644 lam/templates/profedit/profilemain.php create mode 100644 lam/templates/profedit/profileuser.php diff --git a/lam/templates/profedit/profiledelete.php b/lam/templates/profedit/profiledelete.php new file mode 100644 index 00000000..b1d81263 --- /dev/null +++ b/lam/templates/profedit/profiledelete.php @@ -0,0 +1,112 @@ +server()) { + echo("\n"); + exit; +} + +// print standard header +echo (""); +echo ("" . _("Delete User Profile") . "\n"); +echo "\n"; +echo (""); +echo ("

"); + echo ("\"LDAP




\n"); + +// check if admin has submited delete operation +if ($_POST['submit']) { + // delete user profile + if ($_POST['type'] == "user") { + if (!delUserProfile($_POST['del'])) { + StatusMessage("ERROR", "", _("Unable to delete profile! ") . $_POST['del']); + } + else StatusMessage("INFO", "", _("Deleted profile: ") . $_POST['del']); + } + // delete host profile + elseif ($_POST['type'] == "host") { + if (!delHostProfile($_POST['del'])) { + StatusMessage("ERROR", "", _("Unable to delete profile! ") . $_POST['del']); + } + else StatusMessage("INFO", "", _("Deleted profile: ") . $_POST['del']); + } + // wrong profile type + else { + StatusMessage("ERROR", "", _("Wrong or missing type! ") . $_POST['type']); + } + echo ("
" . _("Back to Profile Editor...") . ""); + echo ("\n"); + exit; +} + +// check if admin has aborted delete operation +if ($_POST['abort']) { + StatusMessage("INFO", "", _("Delete operation canceled.")); + echo ("
" . _("Back to Profile Editor...") . ""); + echo ("\n"); + exit; +} + +// check if right type was given +$type = $_GET['type']; +if (($type == "user") || ($type == "host")) { + // user profile + if ($type == "user") { + echo ("

" . _("Do you really want to delete this profile? ") . ""); + echo ($_GET['del'] . "


\n"); + echo ("
\n"); + echo ("
\n"); + echo ("\n"); + echo ("\n"); + echo (""); + echo (""); + echo ("
\n"); + } + // host profile + elseif ($type == "host") { + echo ("

" . _("Do you really want to delete this profile? ") . ""); + echo ($_GET['del'] . "


\n"); + echo ("
\n"); + echo ("
\n"); + echo ("\n"); + echo ("\n"); + echo (""); + echo (""); + echo ("
\n"); + } +} +else{ + // no valid profile type + StatusMessage("ERROR", "", _("Wrong or missing type! ") . $type); + echo ("" . _("Back to Profile Editor...") . ""); +} diff --git a/lam/templates/profedit/profilehost.php b/lam/templates/profedit/profilehost.php new file mode 100644 index 00000000..55ce926f --- /dev/null +++ b/lam/templates/profedit/profilehost.php @@ -0,0 +1,38 @@ +server()) { + echo("\n"); + exit; +} + diff --git a/lam/templates/profedit/profilemain.php b/lam/templates/profedit/profilemain.php new file mode 100644 index 00000000..64f0866b --- /dev/null +++ b/lam/templates/profedit/profilemain.php @@ -0,0 +1,220 @@ +server()) { + echo(""); + exit; +} + +// check if user has pressed submit or abort button +if ($_POST['forward'] == "yes") { + // on abort go back to main page + if ($_POST['abort']) { + echo(""); + } + // on submit forward to other profile pages + elseif ($_POST['submit']) { + // create new user profile + if ($_POST['profile'] == "newuser") { + echo(""); + } + // edit user profile + elseif($_POST['profile'] == "edituser") { + echo(""); + } + // delete user profile + elseif($_POST['profile'] == "deluser") { + echo(""); + } + // create new host profile + elseif ($_POST['profile'] == "newhost") { + echo(""); + } + // edit host profile + elseif($_POST['profile'] == "edithost") { + echo(""); + } + // delete user profile + elseif($_POST['profile'] == "delhost") { + echo(""); + } + } + print_r($_POST); + exit; +} + +// get list of user profiles and generate entries for dropdown box +$usrprof = getUserProfiles(); +$userprofiles = ""; +for ($i = 0; $i < sizeof($usrprof); $i++) { + $userprofiles = $userprofiles . "\n"; +} + +// get list of host profiles and generate entries for dropdown box +$hstprof = getHostProfiles(); +$hostprofiles = ""; +for ($i = 0; $i < sizeof($hstprof); $i++) { + $hostprofiles = $hostprofiles . "\n"; +} + +?> + + + + LDAP Account Manager + + + +

+ + LDAP Account Manager + +

+
+ +
+
+ +
+ + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + +
+ + + + + + +
+
+ +
+ + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + +
+ + + + + + +
+
+ +
+
+ + + + + "> + "> + + + diff --git a/lam/templates/profedit/profileuser.php b/lam/templates/profedit/profileuser.php new file mode 100644 index 00000000..55ce926f --- /dev/null +++ b/lam/templates/profedit/profileuser.php @@ -0,0 +1,38 @@ +server()) { + echo("\n"); + exit; +} +