| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,35 @@ |
| 1 |
+<?php |
|
| 2 |
+//Login Script |
|
| 3 |
+//Validates Username and Password |
|
| 4 |
+require_once ("config.php");
|
|
| 5 |
+ |
|
| 6 |
+if ($_POST['legalterms'] != "on") |
|
| 7 |
+{
|
|
| 8 |
+ //did not agree to legal terms, go back |
|
| 9 |
+ header("Location: authenticate.php?status=legalterms");
|
|
| 10 |
+ exit(); |
|
| 11 |
+} |
|
| 12 |
+ |
|
| 13 |
+if (md5($_POST['f_user'].$_POST['f_pass']) == $admin_password && $_POST['f_user'] == $admin_username) |
|
| 14 |
+{
|
|
| 15 |
+ //successful admin login |
|
| 16 |
+ session_start(); |
|
| 17 |
+ $_SESSION['admin_logged_in'] = true; |
|
| 18 |
+ header("Location: admin.php");
|
|
| 19 |
+ exit(); |
|
| 20 |
+} |
|
| 21 |
+ |
|
| 22 |
+if (md5($_POST['f_user'].$_POST['f_pass']) == $upload_password && $_POST['f_user'] == $upload_username) |
|
| 23 |
+{
|
|
| 24 |
+ //successful upload login |
|
| 25 |
+ session_start(); |
|
| 26 |
+ $_SESSION['upload_logged_in'] = true; |
|
| 27 |
+ header("Location: index.php");
|
|
| 28 |
+ exit(); |
|
| 29 |
+} |
|
| 30 |
+ |
|
| 31 |
+//Username or password was incorrect at this point! |
|
| 32 |
+header("Location: authenticate.php?status=error");
|
|
| 33 |
+exit(); |
|
| 34 |
+ |
|
| 35 |
+?> |