-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin.php
executable file
·52 lines (38 loc) · 971 Bytes
/
admin.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
<?php
include "front.class.php";
include "giflib.class.php";
include_once "settings.class.php";
$f = new Front();
$g = new Giflib();
$s = new Settings("gisicle.json");
session_start();
define("USERNAME_BACKEND", "admin");
define("PASSWORD_BACKEND", "admin");
$f->dispHead();
if(isset($_GET["exit"])) {
unset($_SESSION["login"]);
}
if(isset($_POST["username"]) && isset($_POST["password"])) {
if($_POST["username"] == USERNAME_BACKEND && $_POST["password"] == PASSWORD_BACKEND) {
$_SESSION["login"] = 1;
} else {
$f->dispLoginError();
}
}
if(isset($_SESSION["login"])) {
if(isset($_POST["gifsicle_settings"])) {
$PostAr = $_POST;
unset($PostAr["gifsicle_settings"]);
foreach ($PostAr as $key => $value) {
$s->set($key,$value);
}
}
if(isset($_GET["clear"])) {
$g->clearCache();
}
$f->dispAdminPage($g->nbAndSize(),$s->getAll());
} else {
$f->dispLoginForm();
}
$f->dispFoot();
?>