forked from MediaFrontPage/mediafrontpage
/
auth.php
executable file
·47 lines (47 loc) · 1.48 KB
/
auth.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
42
43
44
45
46
47
<?php
require_once("config.php");
If (!$authsecured) {
echo "<script>window.location = 'index.php';</script>";
exit;
}
if (isset($_POST['user']) && isset($_POST['password'])) {
if ($_POST['user']==$authusername && $_POST['password']==$authpassword) {
// OK
$_SESSION['loggedin'] = true;
echo "<script>window.location = 'index.php';</script>";
exit;
} else {
?>
<html>
<head>
<title>Media Center</title>
<link rel="shortcut icon" href="favicon.ico" />
<link rel="stylesheet" type="text/css" href="css/front.css" />
<link rel="stylesheet" type="text/css" href="css/static_widget.css" />
<link href="css/settings.css" rel="stylesheet" type="text/css">
<body>
<center>
<br><br><br>
<form action="auth.php" method="post">
<table class="widget" width=259 cellpadding=0 cellspacing=0 id=1>
<tr style=cursor: move;>
<td align=center height=25><div class="widget-head">MediaFrontPage Authentication</div></td>
<tr>
<td align=center height=25><br>Invalid Username and/or Password.</td>
<tr>
<td align=center height=25> </td>
<tr>
<td align=center height=25>Please try again.</td>
<tr>
<td align=center height=25><input type="button" value="<< Back" onClick="history.go(-1);return false;" /><br><br></td>
</table>
</form>
</center>
<?php
}
} else {
// not logging in
echo "<script>window.location = 'login.php';</script>";
exit;
}
?>