forked from vandalj/NoCatSplash-Auth
/
index.php
41 lines (37 loc) · 1.16 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
// Configuration
require_once("config/config.php"); // Common Configuration Variables
require_once("config/auth.php"); // Basic Authentication
// Check if Attempted to Login
$logging = isset($_POST["login"]);
if ($logging) {
// Retrieve Username and Password
$username = isset($_POST["username"]) ? $_POST["username"] : false;
$password = isset($_POST["password"]) ? $_POST["password"] : false;
// Authenticate
$login_success = login($username, $password);
} else {
// Didn't Submit Login Form
// Therefore Unsuccesful Login
$login_success = false;
}
?>
<html>
<head>
<title><? echo($splash_title); ?></title>
</head>
<body>
<h1><? echo($splash_title); ?> Login</h1>
<?
// Check if Login was Successful
if ($login_success) {
// Login Successful
// Render Login Continue Button
renderLoginButton($cat_gateway);
} else {
// Render Login Form
renderLogin($splash_url, $logging);
}
?>
</body>
</html>