-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnewmap-handle.php
44 lines (41 loc) · 1.03 KB
/
newmap-handle.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
<?php
include("utils/db.php");
ini_set('display_errors', 0);
session_start();
if(!isset($_GET["c"]))
{
http_response_code(401);
die();
} else {
if(session_status() == PHP_SESSION_ACTIVE)
{
if(!isset($_SESSION['username'])||!isset($_SESSION['password']))
{
http_response_code(403);
die();
} else {
if(!CheckIfCorrect($_SESSION['username'],$_SESSION['password'],$conn))
{
http_response_code(403);
die();
}
}
} else {
http_response_code(403);
die();
}
if(CheckIfAdmin($conn,$_SESSION['username']))
{
$c = $_GET['c'];
$data = "Added using built-in submit";
$stmt = $conn->prepare("INSERT INTO `beatmapsets`(`checksum`, `name`) VALUES (?, ?)");
$stmt->bind_param("ss",$c,$data);
$stmt->execute();
Header("location: /index.php");
die();
} else {
Header("location: /index.php");
die();
}
}
?>