2
require_once('inc/main.php');
3
require_once("inc/securimage.php");
9
if (isset($_POST['submitBtn']) || isset($_POST['resetBtn'])) {
11
$sImg = new Securimage();
12
$bValid = $sImg->check($_POST['captcha']);
15
if (isset($_POST['submitBtn'])) {
16
if (!isset($_POST['username']) || !isset($_POST['password']))
19
$sUsername = isset($_POST['username']) ? $_POST['username'] : '';
20
$sPassword = isset($_POST['password']) ? $_POST['password'] : '';
23
$sError = "The CAPTCHA wasn't entered correctly. Go back and try it again.";
25
$sError = $sLogin->LoginUser($sUsername, $sPassword);
28
header(sprintf("Location: %s", SITE_URL));
30
} else if (isset($_POST['resetBtn'])) {
32
$sError = "The CAPTCHA wasn't entered correctly. Go back and try it again.";
34
$sError = $sLogin->ForgotPassword($_POST['email']);
35
} else if (isset($_POST['changeBtn'])) {
36
$sError = $sLogin->ChangePassword($_POST['username'], $_POST['password'], $_POST['password2'], $_POST['key']);
39
header(sprintf("Location: %s/login.php", SITE_URL));
42
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
43
<html xmlns="http://www.w3.org/1999/xhtml">
45
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
46
<title>Little Software Stats | Login</title>
47
<link rel="stylesheet" href="css/screen.css" type="text/css" media="screen" title="default" />
49
<link type="image/x-icon" href="images/shared/favicon.ico" rel="icon" />
50
<link type="image/x-icon" href="images/shared/favicon.ico" rel="shortcut icon" />
52
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
54
<!-- Custom jquery scripts -->
55
<script src="js/jquery/custom_jquery.js" type="text/javascript"></script>
57
<!-- MUST BE THE LAST SCRIPT IN <HEAD></HEAD></HEAD> png fix -->
58
<script src="js/jquery/jquery.pngFix.pack.js" type="text/javascript"></script>
59
<script type="text/javascript">
60
$(document).ready(function(){ $(document).pngFix( ); });
65
<!-- Start: login-holder -->
66
<div id="login-holder">
70
<a href="index.php"><img src="images/shared/logo.png" width="261" height="40" alt="Little Software Stats" /></a>
74
<div class="clear"></div>
76
<!-- start loginbox ................................................................................. -->
78
<!-- start message -->
79
<?php if (!empty($sError)) { ?>
80
<div id="message-red" align="center">
81
<table border="0" width="90%" cellpadding="0" cellspacing="0">
83
<td class="red-left"><?php echo $sError; ?></td>
84
<td class="red-right"><a class="close-red"><img src="images/table/icon_close_red.png" alt="" /></a></td>
88
<?php } else if (empty($sError) && isset($_POST['resetBtn'])) { ?>
89
<div id="message-green" align="center">
90
<table border="0" width="90%" cellpadding="0" cellspacing="0">
92
<td class="green-left">Please check your inbox for further instructions on how to reset your password.</td>
93
<td class="green-right"><a class="close-red"><img src="images/table/icon_close_green.png" alt="" /></a></td>
99
<!-- start login-inner -->
100
<?php if ($_REQUEST['action'] == "resetPwd") { ?>
101
<div id="login-inner">
102
<form action="#" method="post">
103
<table border="0" cellpadding="0" cellspacing="0">
106
<td><input name="username" type="text" class="login-inp" value="<?php echo $_REQUEST['login']; ?>" /></td>
110
<td><input name="password" type="password" class="login-inp" /></td>
113
<th>Password (again)</th>
114
<td><input name="password2" type="password" class="login-inp" /></td>
117
<th>Activation key</th>
118
<td><input name="key" type="text" class="login-inp" value="<?php echo $_REQUEST['key']; ?>" /></td>
122
<td><input name="changeBtn" type="submit" class="submit-login" /></td>
128
<div id="login-inner">
129
<form action="#" method="post">
130
<table border="0" cellpadding="0" cellspacing="0">
133
<td><input name="username" type="text" class="login-inp" /></td>
137
<td><input name="password" type="password" class="login-inp" /></td>
140
<td colspan="2" align="center"><a href="#" onclick="$('#siimage').attr('src', 'inc/captcha.php?sid=' + Math.random()); return false"><img src="inc/captcha.php" alt="CAPTCHA" id="siimage" width="300" height="80" /></a></td>
143
<th>Security<br />code</th>
144
<td><input name="captcha" type="text" class="login-inp" /></td>
148
<td><input name="submitBtn" type="submit" class="submit-login" /></td>
153
<div class="clear"></div>
154
<a href="" class="forgot-pwd">Forgot Password?</a>
156
<!-- end login-inner -->
158
<!-- end loginbox -->
160
<!-- start forgotbox ................................................................................... -->
162
<div id="forgotbox-text">Please send us your email and we'll reset your password.</div>
163
<!-- start forgot-inner -->
164
<div id="forgot-inner">
165
<form action="#" method="post">
166
<table border="0" cellpadding="0" cellspacing="0">
168
<th>Email address:</th>
169
<td><input name="email" type="text" class="login-inp" /></td>
172
<td colspan="2" align="center"><a href="#" onclick="$('#siimage').attr('src', 'inc/captcha.php?sid=' + Math.random()); return false"><img src="inc/captcha.php" alt="CAPTCHA" id="siimage" width="300" height="80" /></a></td>
175
<th>Security<br />code</th>
176
<td><input name="captcha" type="text" class="login-inp" /></td>
180
<td><input name="resetBtn" type="submit" class="submit-login" /></td>
185
<!-- end forgot-inner -->
186
<div class="clear"></div>
187
<a href="" class="back-login">Back to login</a>
189
<!-- end forgotbox -->
192
<!-- End: login-holder -->
b'\\ No newline at end of file'