diff admin.inc.php @ 5:76c3b89d7b11

Improve voting, clean up the code, etc.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 05 Dec 2012 08:08:58 +0200
parents 8019b357cc03
children d76020022881
line wrap: on
line diff
--- a/admin.inc.php	Tue Dec 04 21:28:11 2012 +0200
+++ b/admin.inc.php	Wed Dec 05 08:08:58 2012 +0200
@@ -1,20 +1,21 @@
 <?
 // Check if sessions are enabled
-if (!stChkSetting("admpass"))
+if (!stChkSetting("admPassword"))
 {
   echo "<h1>Oh noes, admin configuration not done!</h1>\n".
   "<p>Better go and prod that, so you get to use the fine admin interface.</p>\n";
   $authState = "error";
 }
 else
-if (stAuthSession())
+if (stAdmSessionAuth())
 {
   $authState = "ok";
 }
 else
 {
   // Perform authentication if we are not in session already
-  echo "<h1>Party admin login</h1>\n".
+  echo
+    "<h1>Party admin login</h1>\n".
     "<p>Please use illegal telepathy over HTTP to provide a password to enter the party administration systembolaget.</p>\n".
     "<form name=\"admlogin\" action=\"login.php\" method=\"post\">\n".
     stGetFormHiddenInput("mode", "check")."\n".
@@ -363,29 +364,24 @@
 }
 </script>
 
-<div id="nstatus">
--
-</div>
+<!-- ========================== -->
 
-<div id="pageTabs">
-</div>
+<div id="nstatus">-</div>
+
+<div id="pageTabs"></div>
 
 <!-- ========================== -->
 
 <div id="ntab0">
-
-<form method="post" action="" onsubmit="return addNews()">
- <input id="nntitle" type="text" size="40" /><br />
- <textarea id="nntext" rows="5" cols="60"></textarea><br />
- <input id="nnauthor" type="text" value="orgaz" />
- <input id="nnadd" type="submit" value=" Add post " />
- <input type="button" value=" Clear " onClick="this.form.reset()" />
-</form>
-
-<hr />
-
-<div id="nnews">
-</div>
+  <form method="post" action="" onsubmit="return addNews()">
+    <input id="nntitle" type="text" size="40" /><br />
+    <textarea id="nntext" rows="5" cols="60"></textarea><br />
+    <input id="nnauthor" type="text" value="orgaz" />
+    <input id="nnadd" type="submit" value=" Add post " />
+    <input type="button" value=" Clear " onClick="this.form.reset()" />
+  </form>
+  <hr />
+  <div id="nnews"></div>
 </div>
 
 <!-- ========================== -->
@@ -398,55 +394,47 @@
 <!-- ========================== -->
 
 <div id="ntab2">
-<div id="ndump">
-</div>
+  <div id="ndump"></div>
 </div>
 
 <!-- ========================== -->
 
 <div id="ntab3">
-
-<form method="post" action="" onsubmit="return addCompo()">
- <input id="ncname" type="text" size="64" /><br />
- <textarea id="ncdescription" rows="5" cols="60"></textarea><br />
- <input id="nccompo" type="submit" value=" Add compo " />
- <input type="button" value=" Clear " onClick="this.form.reset()" />
-</form>
-
-<hr />
-<div id="ncompos">
-</div>
+  <form method="post" action="" onsubmit="return addCompo()">
+    <input id="ncname" type="text" size="64" /><br />
+    <textarea id="ncdescription" rows="5" cols="60"></textarea><br />
+    <input id="nccompo" type="submit" value=" Add compo " />
+    <input type="button" value=" Clear " onClick="this.form.reset()" />
+  </form>
+  <hr />
+  <div id="ncompos"></div>
 </div>
 
 <!-- ========================== -->
 
 <div id="ntab4">
-<div id="nentries">
-</div>
+  <div id="nentries"></div>
 </div>
 
 <!-- ========================== -->
 
 <div id="ntab5">
-<p>
-Key entries can only be generated via the shell-utility 'keygen'.
-</p>
-<div id="nvoters">
-</div>
+  <p>
+    Key entries can only be generated via the shell-utility 'keygen'.
+  </p>
+  <div id="nvoters"></div>
 </div>
 
 <!-- ========================== -->
 
 <script type="text/javascript">
-registerTab("ntab0", "News");
-registerTab("ntab1", "Attendees");
-registerTab("ntab2", "Dump");
-registerTab("ntab3", "Compos");
-registerTab("ntab4", "Entries");
-registerTab("ntab5", "Voters");
-updateTabList();
-switchActiveTab("ntab0");
+  registerTab("ntab0", "News");
+  registerTab("ntab1", "Attendees");
+  registerTab("ntab2", "Dump");
+  registerTab("ntab3", "Compos");
+  registerTab("ntab4", "Entries");
+  registerTab("ntab5", "Voters");
+  updateTabList();
+  switchActiveTab("ntab0");
 </script>
-<?
-}
-?>
\ No newline at end of file
+<? } ?>
\ No newline at end of file