-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathaskPassword.php
More file actions
307 lines (307 loc) · 17.1 KB
/
askPassword.php
File metadata and controls
307 lines (307 loc) · 17.1 KB
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
<?php
if(isset($_COOKIE['keyword'])){
if($_COOKIE['keyword']){
if(strpos($_COOKIE['keyword'], '.') !== false || strpos($_COOKIE['keyword'], '/') !== false){
// bad cookie. ignore it
unset($_COOKIE['keyword']);
}
}
}
ini_set("open_basedir", "./");
?>
<!DOCTYPE html>
<html>
<head>
<title>AaronOS - Password</title>
<link rel="icon" href="favicon_si_beta.ico" type="image/x-icon">
<script defer>
function getId(target){
return document.getElementById(target);
}
var googlePlay = "";
if(window.location.href.indexOf('GooglePlay=true') > -1){
googlePlay = '?GooglePlay=true';
}
function acceptPassword(token){
document.cookie = "logintoken=" + token + ';';
getId("checkBtn").style.opacity = "0.5";
getId("checkBtn").style.pointerEvents = "none";
getId("password").style.opacity = "0.5";
getId("password").style.pointerEvents = "none";
setTimeout(function(){
window.location = 'aosBeta.php' + googlePlay;
}, 500);
}
function rejectPassword(message){
getId("error").innerHTML = message;
getId('password').value = '';
}
if(localStorage.getItem("login_failmessage")){
rejectPassword(localStorage.getItem("login_failmessage"));
localStorage.removeItem("login_failmessage");
}
var running = 0;
function checkPassword(){
//document.cookie = 'password=' + document.getElementById('password').value + "; Max-Age:315576000";
//window.location = 'aosBeta.php' + googlePlay;
if(!running){
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = () => {
if(xhttp.readyState === 4){
if(xhttp.status === 200){
if(xhttp.responseText === 'REJECT'){
rejectPassword("Password incorrect.");
}else if(xhttp.responseText.indexOf(' ') === -1 && xhttp.responseText.length === 30 && xhttp.responseText !== ''){
acceptPassword(xhttp.responseText);
}else{
rejectPassword("Error: " + xhttp.responseText + '.');
}
}else{
rejectPassword("Connection error " + xhttp.status + ". Try again.");
}
running = 0;
}
};
var fd = new FormData();
fd.append("pass", document.getElementById('password').value);
fd.append("loggingInViaUI", "true");
xhttp.open('POST', 'checkPassword.php');
xhttp.send(fd);
running = 1;
}
}
function skipPassword(){
if(confirm("Are you sure you want to create a new account and potentially lose all the data associated with your old one?")){
document.cookie = 'keyword=; Max-Age=-99999999';
window.location = 'aosBeta.php' + googlePlay;
}
}
var apps = {
messaging: {
vars: {
objTypes: {
img: function(str){
return '<img onclick="this.classList.toggle(\'MSGdivGrowPic\');this.parentNode.classList.toggle(\'MSGdivGrowPicParent\')" style="max-width:calc(100% - 6px);max-height:400px;padding-left:3px;padding-right:3px;" src="' + str + '">';
},
url: function(str){
if(str.indexOf('http://') !== 0 && str.indexOf('https://') !== 0 && str.indexOf('/') !== 0){
str = 'https://' + str;
}
return '<a target="_blank" href="' + str + '">' + str + '</a>';
},
site: function(str){
if(str.indexOf('http://') !== 0 && str.indexOf('https://') !== 0 && str.indexOf('/') !== 0){
str = 'https://' + encodeURI(str);
}
return '<div style="position:relative;display:block;width:100%;border:none;background:#FFF;margin-top:-3px;margin-bottom:-3px;border-radius:10px;box-shadow:inset 0 0 5px #000;height:400px;" onclick="if(event.target.tagName.toLowerCase() === \'button\'){this.outerHTML = \'<iframe src=\\\'\' + this.getAttribute(\'aosMessagingSiteURL\') + \'\\\' style=\\\'\' + this.getAttribute(\'style\') + \'\\\'></iframe>\'}" aosMessagingSiteURL="' + str + '"><p style="margin-top:188px;text-align:center;"><button>Click to load site:<br>' + str + '</button></p></div>';
},
b: function(str){
return '<b>' + str + '</b>';
},
i: function(str){
return '<i>' + str + '</i>';
},
u: function(str){
return '<u>' + str + '</u>';
},
font: function(str){
var strComma = str.indexOf(',');
var strCommaSpace = str.indexOf(', ');
var strSplit = '';
if(strComma > -1){
if(strCommaSpace === strComma){
strSplit = str.split(', ');
return '<span style="font-family:' + strSplit.shift().split(';')[0] + ', monospace;">' + strSplit.join(', ') + '</span>';
}else{
strSplit = str.split(',');
return '<span style="font-family:' + strSplit.shift().split(';')[0] + ', monospace;">' + strSplit.join(',') + '</span>';
}
}else{
return '[font]' + str + '[/font]';
}
},
color: function(str){
var strComma = str.indexOf(',');
var strCommaSpace = str.indexOf(', ');
var strSplit = '';
if(strComma > -1){
if(strCommaSpace === strComma){
strSplit = str.split(', ');
return '<span style="color:' + strSplit.shift().split(';')[0] + ';">' + strSplit.join(', ') + '</span>';
}else{
strSplit = str.split(',');
return '<span style="color:' + strSplit.shift().split(';')[0] + ';">' + strSplit.join(',') + '</span>';
}
}else{
return '[color]' + str + '[/color]';
}
},
glow: function(str){
var strComma = str.indexOf(',');
var strCommaSpace = str.indexOf(', ');
var strSplit = '';
if(strComma > -1){
if(strCommaSpace === strComma){
strSplit = str.split(', ');
return '<span style="text-shadow:0 0 5px ' + strSplit.shift().split(';')[0].split(' ')[0] + ';">' + strSplit.join(', ') + '</span>';
}else{
strSplit = str.split(',');
return '<span style="text-shadow:0 0 5px ' + strSplit.shift().split(';')[0].split(' ')[0] + ';">' + strSplit.join(',') + '</span>';
}
}else{
return '[glow]' + str + '[/glow]';
}
},
outline: function(str){
var strComma = str.indexOf(',');
var strCommaSpace = str.indexOf(', ');
var strSplit = '';
if(strComma > -1){
if(strCommaSpace === strComma){
strSplit = str.split(', ');
strShift = strSplit.shift().split(';')[0].split(' ')[0];
return '<span style="text-shadow:1px 0 0 ' + strShift + ', -1px 0 0 ' + strShift + ', 0 1px 0 ' + strShift + ', 0 -1px 0 ' + strShift + ';">' + strSplit.join(', ') + '</span>';
}else{
strSplit = str.split(',');
strShift = strSplit.shift().split(';')[0].split(' ')[0];
return '<span style="text-shadow:1px 0 0 ' + strShift + ', -1px 0 0 ' + strShift + ', 0 1px 0 ' + strShift + ', 0 -1px 0 ' + strShift + ';">' + strSplit.join(',') + '</span>';
}
}else{
return '[outline]' + str + '[/outline]';
}
},
flip: function(str){
return '<div style="transform:rotate(180deg);display:inline-block;position:relative">' + str + '</div>';
}
},
objSafe: {
img: 0,
url: 0,
site: 0,
b: 1,
i: 1,
u: 1,
font: 1,
color: 1,
glow: 1,
outline: 1,
flip: 1
},
objDesc: {
img: 'Embed an image via URL.',
url: 'Format your text as a clickable URL.',
site: 'Embed a website via URL',
b: 'Format your text as bold.',
i: 'Format your text as italics.',
u: 'Format your text as underlined.',
font: 'Format your text with a font.',
color: 'Format your text with a color.',
glow: 'Format your text with a colorful glow.',
outline: 'Format your text with an outline.',
flip: 'Flip your text upside-down.'
},
objExamp: {
img: '[img]https://image.prntscr.com/image/jcPyuzbNTNu1cHgg18yaZg.png[/img]',
url: '[url]https://duckduckgo.com[/url]',
site: '[site]https://bing.com[/site]',
b: '[b]This is bold text.[/b]',
i: '[i]This is italic text.[/i]',
u: '[u]This is underlined text.[/u]',
font: '[font]Comic Sans MS, This text has a custom font.[/font]',
color: '[color]red, This is red text via name.[/color]<br><br>[color]#00AA00, This is green text via hex.[/color]',
glow: '[glow]red, This is glowy red text.[/glow]',
outline: '[outline]red, This is red outlined text.[/outline]',
flip: '[flip]This is upside-down text.[/flip]'
},
parseBB: function(text, safe){
var tempIn = text;
var tempPointer = tempIn.length - 6;
while(tempPointer >= 0){
var nextObj = tempIn.indexOf('[', tempPointer);
if(nextObj > -1){
var nextEnd = tempIn.indexOf(']', nextObj);
if(nextEnd > -1){
var nextType = tempIn.toLowerCase().substring(nextObj + 1, nextEnd);
if(this.objTypes[nextType]){
var nextClose = tempIn.toLowerCase().indexOf('[/' + nextType + ']', nextEnd);
if(nextClose > -1){
if(!(safe && !this.objSafe[nextType])){
var replaceStr = tempIn.substring(nextEnd + 1, nextClose);
var newStr = this.objTypes[nextType](replaceStr);
tempIn = tempIn.substring(0, nextObj) + newStr + tempIn.substring(nextClose + 3 + nextType.length, tempIn.length);
}
}
}
}
}
tempPointer--;
}
return tempIn;
}
}
}
};
</script>
<?php
echo '<link rel="stylesheet" href="askPassword.css?ms='.time().'">';
?>
</head>
<body>
<?php
if(isset($_COOKIE['keyword'])){
if(file_exists('USERFILES/'.$_COOKIE['keyword'].'/aos_system/desktop/lockscreen_image.txt')){
echo '<div id="background" style="background-image:url('.file_get_contents('USERFILES/'.$_COOKIE['keyword'].'/aos_system/desktop/lockscreen_image.txt').');"></div>';
}else{
echo '<div id="background"></div>';
}
}else{
echo '<div id="background"></div>';
}
?>
<div id="card">
<h1>AaronOS</h1>
<hr><br>
<h1 style="font-family:Consolas, monospace;float:right;" id="hoursMinutes"></h1>
<h1 style="text-align:left;margin-bottom:0;">Welcome</h1>
<?php
if(isset($_COOKIE['keyword'])){
if(file_exists('messageUsernames/n_'.$_COOKIE['keyword'].'.txt')){
echo '<div id="name">'.file_get_contents('messageUsernames/n_'.$_COOKIE['keyword'].'.txt').'</div><script>document.getElementById("name").innerHTML = apps.messaging.vars.parseBB(document.getElementById("name").innerHTML, 1)</script>';
}else{
echo '<div id="name"> </div>';
}
}else{
echo '<div id="name"> </div>';
}
?>
<br>
<input type="password" size="10" placeholder="Password" onkeypress="if(event.keyCode === 13){checkPassword();}" id="password"><button id="checkBtn" onclick="checkPassword()"><img style="height:32px;margin-bottom:-6px;" src="images/loginArrow2.png"></button><br><br>
<span id="error"> </span>
<br><br><br>
<div id="keywordDiv">
OS ID: <span id="keywordHider"><?php echo $_COOKIE['keyword'] ?></span><br>
<div id="keywordPrompt">Click to Show</div>
</div><br>
Not your account? <button onclick="skipPassword()">Create a New One</button>
</div>
</body>
<script defer>
document.getElementById('password').focus();
var date = new Date();
var hours = date.getHours();
var minutes = date.getMinutes();
if(minutes < 10){
minutes = "0" + minutes;
}
getId("hoursMinutes").innerHTML = (hours < 13 ? hours : hours - 12) + ":" + minutes;
setInterval(() => {
date = new Date();
hours = date.getHours();
minutes = date.getMinutes();
if(minutes < 10){
minutes = "0" + minutes;
}
getId("hoursMinutes").innerHTML = (hours < 13 ? hours : hours - 12) + ":" + minutes;
}, 1000)
</script>
</html>