forked from cainkilgore/geekstats.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.php
70 lines (54 loc) · 2.2 KB
/
config.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
// By Cain Kilgore
// January 2018 Project
class Config {
var $pageList = [];
const fileNotFoundMessage = "The specified resource or directory could not be found.";
const accessForbiddenMessage = "The file you tried to access is protected.";
const internalServerMessage = "We've hit a internal server error. Rest assured, we're working on it.";
const teapotMessage = "I'm a teapot.";
const databaseHostname = "localhost";
const databaseUsername = "geekstats";
const databasePassword = "dGl0dGllcw==";
const databaseName = "geekstats";
const minUpdateInterval = 1;
const maxUpdateInterval = 60;
const showLargeHeader = true;
const siteName = "geekstats.io";
const siteMotto = "The friendly dashboard that monitors for you.";
const underMaintenance = false;
const maintenanceMessage = "We're working on some stuff.";
const limitedAdminAccounts = true;
function loadConfig() {
array_push($this->pageList, "Home,/");
array_push($this->pageList, "Admin,/services/list");
}
function getNavbarPages() {
return $this->pageList;
}
function encryptPassword($password) {
$resultPassword = base64_encode($password);
$resultPassword = md5($resultPassword);
$resultPassword = hash('sha512', $resultPassword);
$resultPassword = base64_encode($password);
return $resultPassword;
}
function logout() {
session_unset();
session_destroy();
header('Location: /');
}
function verifyLoggedIn() {
if($_SESSION["username"] == "") header('Location: /denied');
}
function backToHomepage() {
header('Location: /');
}
function displayErrorMessage($message) {
echo "<div class='alert alert-danger' role='alert'>$message</div>\n";
}
function displaySuccessMessage($message) {
echo "<div class='alert alert-success' role='alert'>$message</div>\n";
}
}
?>