/
login.php
executable file
·136 lines (121 loc) · 3.68 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<?php
include('classes/Session.php');
$session = new Session();
$session->destroySession();
?>
<!DOCTYPE html>
<html lang="en-us">
<meta charset="utf-8" />
<head>
<title>Accurity Valuation</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/png" sizes="16x16" href="css/images/favicon-32x32.png">
<link rel="stylesheet" href="css/login.css">
</head>
<body>
<div class="msg">
<?php
if(isset($_SESSION['login-error'])){
echo $_SESSION['login-error'];
unset($_SESSION['login-error']);
}
?>
<div class="success message" <?php if(!isset($_REQUEST['msg'])){?>style="display:none;"<?php }?>>
<h3>Your login credentials are sent to your email.</h3>
</div>
</div>
<div class="form">
<div class="header"><h2><img class="img-responsive logo" src="css/images/main-logo.jpg" width="200" /></h2></div>
<div class="login">
<div id="login">
<form action="login_check.php" method="post" autocomplete="off">
<ul>
<li>
<span class="un"><i class="fa fa-user"></i></span><input type="email" name="email" required class="text" placeholder="User Name Or Email" autofocus/></li>
<li>
<span class="un"><i class="fa fa-lock"></i></span><input type="password" name="password" required class="text" placeholder="User Password"/></li>
<li>
<input type="submit" value="LOGIN" class="btn">
</li>
<li><div class="span"><span class="ch"><input type="checkbox" id="r"> <label for="r">Remember Me</label> </span> <span class="ch"><a id="fpass">Forgot Password?</a></span></div></li>
</ul>
</form>
</div>
<div id="forgot"></div>
</div>
<div class="sign">
<div class="need">@ 2015 Accurity </div>
<div class="up">Absolute Web Services</div>
</div>
</div>
<br/><br/>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
$(document).ready(function(){
setTimeout(function() {
$('.message').fadeOut('fast');
}, 6000); // <-- time in milliseconds
$('#fpass').click(function() {
var data = '<h4>Recover Password</h4><form action="forgot_password.php" method="post" onsubmit="return validate();" autocomplete="off"><ul><li><span class="un"><i class="fa fa-key"></i></span><input id="forgot_email" type="email" name="email" required class="text" placeholder="Enter your registered email to recover password" onblur="check_email(this.value);" autofocus/></li><div id="fmail"></div><input type="submit" value="Recover" class="btn-small"> <input type="button" onclick="revert();" value="Cancel" class="btn-small"></ul></form><br/><br/>';
$('#forgot').html(data);
$('#login').html('');
});
});
function revert(){
location = "login.php";
}
function getXMLHTTP() { //fuction to return the xml http object
var xmlhttp=false;
try{
xmlhttp=new XMLHttpRequest();
}
catch(e) {
try{
xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e){
try{
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e1){
xmlhttp=false;
}
}
}
return xmlhttp;
}
function check_email(email) {
var strURL = "check_forgot_mail.php?mail="+email;
var req = getXMLHTTP();
if (req) {
req.onreadystatechange = function() {
if (req.readyState == 4) {
// only if "OK"
if (req.status == 200) {
if(req.responseText == "noquestions")
{
location = "login.php?msg=lcss";
}
else
{
document.getElementById('fmail').innerHTML=req.responseText;
}
} else {
//alert("There was a problem while using XMLHTTP:\n" + req.statusText);
}
}
}
req.open("GET", strURL, true);
req.send(null);
}
}
function validate(){
var fmail = $('#fmail').html();
if(fmail.length>0){
return false;
}
return true;
}
</script>
</body>
</html>