summaryrefslogtreecommitdiff
path: root/utils/admin.php
diff options
context:
space:
mode:
authordeva <deva>2009-04-23 08:05:41 +0000
committerdeva <deva>2009-04-23 08:05:41 +0000
commit9ecc7372ae70b397f5546adb60b0e4542a6bbb78 (patch)
tree47e739d384c8099204610cf860b45c2003fc3f59 /utils/admin.php
parent0f3ed98adf5505672397f609965173adcef578fc (diff)
A little cleaning up... a lot more to come...
Diffstat (limited to 'utils/admin.php')
-rw-r--r--utils/admin.php60
1 files changed, 60 insertions, 0 deletions
diff --git a/utils/admin.php b/utils/admin.php
new file mode 100644
index 0000000..8efbb56
--- /dev/null
+++ b/utils/admin.php
@@ -0,0 +1,60 @@
+<div class="admin">
+ <div class="header">Admin</div>
+<?php
+if($loggedin == true) {
+?>
+<?php
+ $users = new Users($DATA_DIR . "/users.xml");
+ if($userid) $UID = $userid;
+ else $UID = $HTTP_COOKIE_VARS["UserID"];
+ $user = $users->findUser($UID);
+?>
+<div class="logout">
+<a href="?page=admin&amp;action=logout">Logout <em><?php echo $UID;?></em></a>
+</div>
+<div class="menu">
+<?php
+include_once($UTIL_DIR . "/modules.php");
+
+foreach($modules as $modulename => $module) {
+ if($m == $modulename) $admin_module = $module;
+ echo "<a class=\"entry\" href=\"?page=admin&amp;m=$modulename\">$module->admin_title</a>\n";
+}
+?>
+</div>
+<div class="submenu">
+<?php
+if($admin_module) {
+ foreach($admin_module->admin_submodules as $submodulename => $submodule) {
+ if($s == $submodule) {
+ $admin_submodule = $s;
+ $admin_submodule_name = $submodulename;
+ }
+ echo "<a class=\"entry\" href=\"?page=admin&amp;m=$m&amp;s=$submodule\">$submodulename</a>\n";
+ }
+}
+?>
+</div>
+<div class="form">
+<?php
+if($admin_submodule) {
+ echo "<div class=\"header\">$admin_submodule_name</div>\n";
+ include_once($UTIL_DIR . "/convert.php");
+ $admin_module->admin($admin_submodule, $a, convert_array($vars));
+}
+?>
+</div>
+<?php
+} else { // logged in?
+?>
+<div class="form">
+<form action="?page=admin&amp;action=login" method="post">
+<p>UserID: <input name="userid"/></p>
+<p>Password: <input name="password" type="password"/></p>
+<p><button type="submit">Login</button></p>
+</form>
+</div>
+<?php
+}
+?>
+</div>