summaryrefslogtreecommitdiff
path: root/htdocs/moderate/login.php
diff options
context:
space:
mode:
authorJesse Morgan <jesse@jesterpm.net>2011-05-12 16:59:36 -0700
committerJesse Morgan <jesse@jesterpm.net ; true>2011-05-12 16:59:36 -0700
commitdd24e2c973a7979894971bdc38d904d2aecc7d5d (patch)
tree2f8474d22cbf29749219bd6dd543bb22b959465e /htdocs/moderate/login.php
parente159ae5209a561043ceb89aa640b207df15181b7 (diff)
Well, you can see posts on the moderation panel now
Diffstat (limited to 'htdocs/moderate/login.php')
-rw-r--r--htdocs/moderate/login.php54
1 files changed, 54 insertions, 0 deletions
diff --git a/htdocs/moderate/login.php b/htdocs/moderate/login.php
new file mode 100644
index 0000000..92cddc1
--- /dev/null
+++ b/htdocs/moderate/login.php
@@ -0,0 +1,54 @@
+<?php
+
+require_once('../src/base.inc.php');
+
+$error = "";
+
+if (isset($_GET['logout'])) {
+ unset($_SESSION['currentUser']);
+}
+
+if (isset($_POST['login_email']) and isset($_POST['login_password'])) {
+ $user = User::getByEmail(addslashes($_POST['login_email']));
+
+ if ($user and $user->authenticate($_POST['login_password'])) {
+ $_SESSION['currentUser'] = $user;
+ header('Location: index.php');
+
+ } else {
+ $error = "<div class=\"error\">Invalid Username/Password</div>";
+ }
+}
+
+require_once('header.inc.php');
+
+?>
+
+
+<h2>Login</h2>
+
+<?php echo $error; ?>
+
+<form method="post">
+
+<label>Email</label>
+<div class="element">
+ <input type="text" name="login_email" />
+</div>
+
+<label>Password</label>
+<div class="element">
+ <input type="password" name="login_password" />
+</div>
+
+<div>
+ <input type="submit" value="Login" />
+</div>
+
+</form>
+
+<?php
+
+require_once('footer.inc.php');
+
+?>