-
Notifications
You must be signed in to change notification settings - Fork 1
/
authent.php
35 lines (29 loc) · 918 Bytes
/
authent.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
<?php
include 'conf.php';
$_password = "";
$username = "";
if (isset($_REQUEST['password'])) $_password = $_REQUEST['password'];
if (isset($_REQUEST['username'])) $username = $_REQUEST['username'];
if ($_password=="" || $username=="") {
header('HTTP/1.0 401 Unauthorized');
die();
}
if(!isset($accounts[$username])) {
header('HTTP/1.0 401 Unauthorized');
die();
}
if($accounts[$username] != $_password) {
header('HTTP/1.0 401 Unauthorized');
die();
}
#Check if folder exist
if (!file_exists("data/$username")) {
mkdir("data/$username", 0777, false);
}
if (!file_exists("data/$username/pdfscorecards")) {
mkdir("data/$username/pdfscorecards", 0777, false);
}
if (!file_exists("data/$username/scorecards")) {
mkdir("data/$username/scorecards", 0777, false);
}
?>