php require_once php classPanel php require_once php classPanelPageGen

  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
<?php
require_once("../php/classPanel.php");
require_once("../php/classPanelPageGenerator.php");
session_start();
$url_array = parse_url($_SERVER['REQUEST_URI']);
$path = $url_array["path"];
$Panel = new classPanel();
$_ERROR = 0;
if(!empty($_POST)){
if (isset($_POST["settings"])) {
$Panel->void_UpdateSettings($_POST);
}
if (isset($_POST["auth"])) {
if ($Panel->b_checkAdmin($_POST["email"], $_POST["password"])) {
$_SESSION["admin_login"] = $_POST["email"];
$_SESSION["admin_password"] = $_POST["password"];
}
else {
header("Location: /admin/auth");
}
}
if (isset($_POST["addSpamer"])) {
if (!$Panel->b_CheckSpammerAcc($_POST["log"])) {
$Panel->void_AddSpammer($_POST["log"], $_POST["pass"]);
}
else {
$_ERROR = 1;
}
}
}
if (!empty($_GET)){
if (array_key_exists("do", $_GET)) {
if (($_GET["do"] == "SetBalance") && isset($_GET["id"]) && isset($_GET["balance"])) {
$Panel->void_SetBalance($_GET["id"], $_GET["balance"]);
}
if (($_GET["do"] == "SetPassword") && isset($_GET["id"]) && isset($_GET["pass"])) {
$Panel->void_SetPassword($_GET["id"], $_GET["pass"]);
}
if (($_GET["do"] == "SetKT") && isset($_GET["id"]) && isset($_GET["kt"])) {
$Panel->void_SetKT($_GET["id"], $_GET["kt"]);
}
}
}
if ((!isset($_SESSION["admin_login"]) && !isset($_SESSION["admin_password"])) && (($path !== "/admin/auth") && ($path !== "/admin/auth/"))){
header("Location: /admin/auth");
}
else if (!$Panel->b_checkAdmin($_SESSION["admin_login"], $_SESSION["admin_password"]) && (($path !== "/admin/auth") && ($path !== "/admin/auth/"))) {
header("Location: /admin/auth");
}
$PanelPageGen = new PageGenerator("template");
switch ($path){
case "/admin/auth":
case "/admin/auth/":
if (isset($_SESSION["admin_login"]) && isset($_SESSION["admin_password"])){
header("Location: /admin");
}
else echo $PanelPageGen->GenerateAuth();
break;
case "/admin/logout":
case "/admin/logout/":
if (isset($_SESSION["admin_login"]) && isset($_SESSION["admin_password"])){
unset($_SESSION["admin_login"]);
unset($_SESSION["admin_password"]);
}
header("Location: /admin/auth");
break;
case "/admin":
case "/admin/":
echo $PanelPageGen->GenerateIndex();
break;
case "/admin/spammers":
case "/admin/spammers/":
echo $PanelPageGen->GenerateSpammers($_ERROR);
break;
case "/admin/settings":
case "/admin/settings/":
echo $PanelPageGen->GenerateSettings();
break;
case "/admin/del_all":
case "/admin/del_all/":
$Panel->void_TruncAccs();
header("Location: /admin");
break;
case "/admin/delete":
case "/admin/delete/":
$Panel->void_dropAccount($_GET["id"]);
header("Location: /admin");
break;
case "/admin/resetVisits":
case "/admin/resetVisits/":
$Panel->void_resetVisits();
header("Location: /admin");
break;
case "/admin/toggleValid":
case "/admin/toggleValid/":
$Panel->void_ToggleValid($_GET["id"]);
header("Location: /admin");
break;
case "/admin/delSpamer":
case "/admin/delSpamer/":
$Panel->void_dropSpammer($_GET["id"]);
header("Location: /admin/spammers");
break;
case "/admin/newaccs":
case "/admin/newaccs/":
if ($Panel->b_newAccs()) echo "1";
$Panel->void_setNotificated();
break;
}
?>