forked from tylerhall/Shine
-
Notifications
You must be signed in to change notification settings - Fork 1
/
login.php
44 lines (39 loc) · 1.92 KB
/
login.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
<?PHP
require 'includes/master.inc.php';
// Kick out user if already logged in.
if($Auth->loggedIn()) redirect('index.php');
// Try to log in...
if(!empty($_POST['username']))
{
$Auth->login($_POST['username'], $_POST['password']);
if($Auth->loggedIn())
redirect('index.php');
else
$Error->add('username', "We're sorry, you have entered an incorrect username and password. Please try again.");
}
// Clean the submitted username before redisplaying it.
$username = isset($_POST['username']) ? htmlspecialchars($_POST['username']) : '';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Shine - An Open Source Dashboard for Inidie Mac Developers</title>
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.5.2/build/reset-fonts-grids/reset-fonts-grids.css">
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.5.2/build/base/base-min.css">
<link rel="stylesheet" href="styles/screen.css" type="text/css" media="screen" title="Screen" charset="utf-8" />
</head>
<body>
<h1>Welcome to Shine</h1>
<div id="main">
<form action="login.php" method="post">
<?PHP echo $Error; ?>
<p><label for="username">Username:</label> <input type="text" name="username" value="<?PHP echo $username;?>" id="username" /></p>
<p><label for="password">Password:</label> <input type="password" name="password" value="" id="password" /></p>
<p><a href="http://wiki.github.com/tylerhall/Shine/installation">Trouble logging in?</a></p>
<p><input type="submit" name="btnlogin" value="Login" id="btnlogin" /></p>
</form>
</div>
</body>
</html>