comparison admin.inc.php @ 107:6e076b3630a0

Cleanup the code a bit.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 21 Oct 2013 22:47:29 +0300
parents a85f258f6beb
children 986c25c2e2bc
comparison
equal deleted inserted replaced
106:324f3a415237 107:6e076b3630a0
33 // Check if sessions are enabled 33 // Check if sessions are enabled
34 if (!stChkSetting("admPassword")) 34 if (!stChkSetting("admPassword"))
35 { 35 {
36 echo "<h1>Oh noes, admin configuration not done!</h1>\n". 36 echo "<h1>Oh noes, admin configuration not done!</h1>\n".
37 "<p>Better go and prod that, so you get to use the fine admin interface.</p>\n"; 37 "<p>Better go and prod that, so you get to use the fine admin interface.</p>\n";
38 $authState = "error";
39 } 38 }
40 else 39 else
41 if (stAdmSessionAuth()) 40 if (!stAdmSessionAuth(FALSE))
42 {
43 $authState = "ok";
44 }
45 else
46 { 41 {
47 // Perform authentication if we are not in session already 42 // Perform authentication if we are not in session already
48 echo 43 echo
49 "<h1>Party admin login</h1>\n". 44 "<h1>Party admin login</h1>\n".
50 "<p>Please use illegal telepathy over HTTP to provide a password to enter the party administration systembolaget.</p>\n". 45 "<p>Please use illegal telepathy over HTTP to provide a password to enter the party administration systembolaget.</p>\n".
51 stGetFormStart("admlogin", "admlogin.php"). 46 stGetFormStart("admlogin", "admlogin.php").
52 stGetFormHiddenInput("mode", "check")."\n". 47 stGetFormHiddenInput("mode", "check")."\n".
53 stGetFormPasswordInput("admpass", "", "")."\n". 48 stGetFormPasswordInput("admpass", "", "")."\n".
54 stGetFormSubmitInput("submit", "Login"). 49 stGetFormSubmitInput("submit", "Login").
55 "</form>\n"; 50 "</form>\n";
56 51 }
57 $authState = "login"; 52 else
58 }
59
60 if ($authState == "ok")
61 { 53 {
62 ?> 54 ?>
63 <script type="text/javascript"> 55 <script type="text/javascript">
64 // <? stCreateSettingsData(); include "ajax.js"; ?> 56 // <? stCreateSettingsData(); include "ajax.js"; ?>
65 57