-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
executable file
·123 lines (109 loc) · 3.4 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
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
<!doctype html>
<html>
<head>
<title>OctoEdit - Login</title>
<link rel="stylesheet" type="text/css" href="src/css/main.css" />
<script type="text/javascript" src="src/js/jquery-1.8.3.min.js"></script>
<script src="src/notifications/js/notification.js"></script>
<link href="src/notifications/main.css" rel="stylesheet" type="text/css" media="screen" />
</head>
<body>
<script type="text/javascript">
$(document).ready(function(){
$("#submit").click(function() {
// validate and process form here
var error = "";
var username = $("input#txtUsername").val();
if (username == "") {
error = "username";
}
var password = $("input#txtPassword").val();
if (password == "") {
if (error != "") {
error = error + " or password";
}else {
error = "password";
}
}
if (error != "") {
dialog("Error", "Unfortunately no " +error+" could be obtained.");
return false;
}
var dataString = '&username=' + username + '&password=' + password;
//alert (dataString);return false;
$.ajax({
type: "POST",
url: "src/auth/login.php",
data: dataString,
success: function(output) {
if (output == "success") {
window.location = 'app/index.php';
}else {
dialog("Login", output);
}
}
});
return false;
});
$("#txtPlainPassword").show();
$("#txtPassword").hide();
$("#txtPlainPassword").focus(function() {
$(this).hide();
$("#txtPassword").show();
$("#txtPassword").focus();
});
$("#txtPassword").blur(function() {
if($(this).val().length == 0)
{
$(this).hide();
$("#txtPlainPassword").show();
}
});
$("#txtPlainUsername").show();
$("#txtUsername").hide();
$("#txtPlainUsername").focus(function() {
$(this).hide();
$("#txtUsername").show();
$("#txtUsername").focus();
});
$("#txtUsername").blur(function() {
if($(this).val().length == 0)
{
$(this).hide();
$("#txtPlainUsername").show();
}
});
});
function dialog(dialogTitle, dialogContent) {
$.notification(
{
title: dialogTitle,
content: dialogContent,
img: "src/notifications/demo/thumb.png",
border: false,
timeout: 10000
}
);
}
</script>
<div class="wrapper">
<div id="content">
<div id="header"><span class="textXLarge">OctoEdit</span></div>
<div id="content-header"><span class="textLarge">Login or Register</span></div>
<form>
<input type="text" name="username" id="txtPlainUsername" value="Username" class="textfield" />
<input required name="username" id="txtUsername" type="text" class="textfield" />
<input type="text" name="password" id="txtPlainPassword" value="Password" class="textfield" />
<input required name="password" type="password" id="txtPassword" class="textfield"/>
<input class="submit-btn" id="submit" type="submit" value="Click to Continue" />
</form>
</div>
<div class="push"></div>
</div>
<div class="footer">
<div id="footer-content">
<span>Made with love by Sebastian Ruiz.</span>
</div>
</div>
</body>
</html>