Skip to content
Permalink
Browse files

Got everything working again, fixed database

  • Loading branch information...
zbee committed Jul 11, 2017
1 parent 415f1f8 commit c979dfd3ac7e6fa6bd06351653d5c3055eb57dc8
@@ -1,5 +1,5 @@
<?php
require_once("/var/www/abian/header.php");
require_once("/var/www/Abian/header.php");
if (!is_array($session)) $UserSystem->redirect301("/u/login");
#if ($session["title"] !== "Moderator") $UserSystem->redirect301("/");
?>
@@ -132,5 +132,5 @@
</div>

<?php
require_once("/var/www/abian/footer.php");
require_once("/var/www/Abian/footer.php");
?>
@@ -1,5 +1,5 @@
<?php
require_once("/var/www/abian/header.php");
require_once("/var/www/Abian/header.php");
if (!is_array($session)) $UserSystem->redirect301("/u/login");
#if ($session["title"] !== "Moderator") $UserSystem->redirect301("/");
$users = $UserSystem->dbSel(["users", ["username" => ["!=", ""]]]);
@@ -66,4 +66,4 @@
</div>
</div>

<?php require_once("/var/www/abian/footer.php"); ?>
<?php require_once("/var/www/Abian/footer.php"); ?>
@@ -1,5 +1,5 @@
<?php
require_once("/var/www/abian/header.php");
require_once("/var/www/Abian/header.php");
if ($session === false) $UserSystem->redirect301("/u/login");
$recaptcha = recaptcha_get_html($re["site"], null, true);
@@ -34,10 +34,10 @@
)
)
);
$dir = "/var/www/abian/dl/";
$dir = "/var/www/Abian/dl/";
$file = $dir . basename($UserSystem->sanitize($slug) . ".zip");
$search = $UserSystem->dbSel(["bots", ["slug" => $slug]])[0];
if (!file_exists("/var/www/abian/dl/" . $slug . ".zip")
if (!file_exists("/var/www/Abian/dl/" . $slug . ".zip")
&& $search === 0) {
$size = $UserSystem->sanitize(
array_change_key_case(
@@ -50,7 +50,7 @@
);
if ($size < 5500000) {
file_put_contents(
"/var/www/abian/dl/" . $slug . ".zip",
"/var/www/Abian/dl/" . $slug . ".zip",
file_get_contents($_POST["f"])
);
$m = $_POST["m"] == 1 ? 1 : 0;
@@ -189,5 +189,5 @@
</div>
EOT;
require_once("/var/www/abian/footer.php");
require_once("/var/www/Abian/footer.php");
?>
@@ -1,6 +1,6 @@
<?php
require_once("/var/www/abian/_secret_keys.php");
require_once("/var/www/abian/libs/usersystem/config.php");
require_once("/var/www/Abian/_secret_keys.php");
require_once("/var/www/Abian/libs/usersystem/config.php");
$response = "";
if (isset($_POST["up"]) || isset($_POST["down"])) {
@@ -1,5 +1,5 @@
<?php
require_once("/var/www/abian/header.php");
require_once("/var/www/Abian/header.php");
$bot = null;
if (isset($_GET) && count($_GET) > 0) {
$bot = array_search(array_values($_GET)[0], $_GET);
@@ -38,10 +38,10 @@
]
)[0];
if ($search === 0) {
if (file_get_contents("/var/www/abian/dl/" . $slug . ".zip") !=
if (file_get_contents("/var/www/Abian/dl/" . $slug . ".zip") !=
file_get_contents($_POST["f"])) {
$file = file_put_contents(
"/var/www/abian/dl/" . $slug . ".zip",
"/var/www/Abian/dl/" . $slug . ".zip",
file_get_contents($_POST["f"])
);
}
@@ -153,5 +153,5 @@
}
}
require_once("/var/www/abian/footer.php");
require_once("/var/www/Abian/footer.php");
?>
@@ -1,5 +1,5 @@
<?php
require_once("/var/www/abian/header.php");
require_once("/var/www/Abian/header.php");
$bot = null;
if (isset($_GET) && count($_GET) > 0) {
$bot = array_search(array_values($_GET)[0], $_GET);
@@ -272,5 +272,5 @@ class="img-thumbnail" style="width:75%" />
EOT;
}
require_once("/var/www/abian/footer.php");
require_once("/var/www/Abian/footer.php");
?>
@@ -1,5 +1,5 @@
<?php
require_once("/var/www/abian/header.php");
require_once("/var/www/Abian/header.php");
if ($session === false) $UserSystem->redirect301("/u/login");
$bots = $UserSystem->dbSel(["bots", ["user" => $session["id"]]]);
@@ -67,5 +67,5 @@
</div>
EOT;
require_once("/var/www/abian/footer.php");
require_once("/var/www/Abian/footer.php");
?>
@@ -167,7 +167,7 @@
} else {
date_default_timezone_set("America/Denver");
$server = date("Y-m-d h:i:s A");
date_default_timezone_set($session["timeZone"]);
if ($session["timeZone"] !== "") date_default_timezone_set($session["timeZone"]);
$user = date("Y-m-d h:i:s A");
$ahead = abs((strtotime($server) - strtotime($user)) / 3600);
$ahead = $ahead>0 ?$ahead." hours ahead" : $ahead." hours behind";
@@ -8,16 +8,16 @@
header("Location: $redirect");
}
if (!isset($sidebar)) $sidebar = true;
require_once("/var/www/abian/_secret_keys.php");
require_once("/var/www/abian/libs/usersystem/config.php");
require_once("/var/www/abian/libs/Parsedown.php");
require_once("/var/www/abian/libs/Abian.php");
require_once("/var/www/abian/libs/recaptcha.php");
require_once("/var/www/Abian/_secret_keys.php");
require_once("/var/www/Abian/libs/usersystem/config.php");
require_once("/var/www/Abian/libs/Parsedown.php");
require_once("/var/www/Abian/libs/Abian.php");
require_once("/var/www/Abian/libs/recaptcha.php");
$Abian = new Abian;
$session = $UserSystem->verifySession();
if ($session === true) {
$session = $UserSystem->session();
date_default_timezone_set($session["timeZone"]);
if ($session["timeZone"] !== "") date_default_timezone_set($session["timeZone"]);
$Abian->lastActive($session["id"]);
$xp = $Abian->calcXP($session["id"]);
} elseif ($session === "ban") {
@@ -1,5 +1,5 @@
<?php
require_once("/var/www/abian/header.php");
require_once("/var/www/Abian/header.php");
if (isset($_GET["loggedin"])) {
$info = "In " . $Abian->codeToCountry($_SERVER["HTTP_CF_IPCOUNTRY"]) . " using " . $Abian->getBrowser() . " on " . $Abian->getOS();
$hist = $Abian->historify("user.login", $info);
@@ -8,5 +8,5 @@
echo $Abian->getBots(["id" => ["!=", "a"], "sort" => ["dateUpdate", "desc"]]);
require_once("footer.php");
require_once("/var/www/Abian/footer.php");
?>
@@ -24,8 +24,8 @@ class Abian extends UserSystem {
public function getAvatar ($user, $small = false, $http = true) {
$preface = $http === true
? "https://abian.zbee.me/cache/"
: "/var/www/abian/cache/";
if (file_exists("/var/www/abian/cache/$user.jpg")) {
: "/var/www/Abian/cache/";
if (file_exists("/var/www/Abian/cache/$user.jpg")) {
return $small === true
? "$preface$user-32x.jpg"
: "$preface$user.jpg";
@@ -34,10 +34,11 @@ public function getAvatar ($user, $small = false, $http = true) {
if ($search[0] !== 1) return "user";
$e = md5(strtolower(trim($search[1]["email"])));
$l = "https://www.gravatar.com/avatar/".$e;
$file32 = "/var/www/abian/cache/$user-32x.jpg";
$file = "/var/www/abian/cache/$user.jpg";
if (!@copy($l."?s=512", $file)) return "copy";
if (!@copy($l."?s=32", $file32)) return "copy";
$file32 = "/var/www/Abian/cache/$user-32x.jpg";
$file = "/var/www/Abian/cache/$user.jpg";
print copy($l."?s=512", $file);
if (!@copy($l."?s=512", $file)) return "copy1";
if (!@copy($l."?s=32", $file32)) return "copy2";
return $small === true
? "$preface$user-32x.jpg"
: "$preface$user.jpg";
@@ -62,24 +63,21 @@ public function verifyAQ ($aq, $user) {
$u = $u[1];
$trim = substr(
file_get_contents(
"http://www.aq.com/character.asp?id=" . $a,
false,
null,
0,
16500
),
16250
$trim = file_get_contents(
"http://www.aq.com/character.asp?id=" . $a,
false,
null,
0
);
$trim = explode("intColorTrim=", $trim);
if (!isset($trim[1])) return "aqName";
$trim = $trim[1];
$trim = explode("&", substr($trim, 13))[0];
$trim = dechex($trim);
$trim = explode("&", $trim)[0];
$trim = str_pad(dechex($trim), 6, "0", STR_PAD_LEFT);
$dec = str_pad(dechex(substr($u["id"], 0, 6)), 6, "0", STR_PAD_LEFT);
$dec = dechex(substr($u["id"], 0, 6));
if ($trim != $dec) return "match";
$updated = $this->dbUpd(
@@ -141,7 +139,7 @@ public function lastActive ($user) {
$_SERVER["REMOTE_ADDR"],
FILTER_SANITIZE_FULL_SPECIAL_CHARS
);
if (ENCRYPTION === true) $ipAddress = encrypt($ipAddress, $username);
if (ENCRYPTION === true) $ipAddress = encrypt($ipAddress, $user);
return $this->dbUpd(
[
"users",
@@ -439,8 +437,13 @@ public function historify ($action, $description, $target = null) {
*/
public function getCommit() {
#Check if cache is reliable, if not fetch it again
$cached = explode(":", file_get_contents("/var/www/abian/libs/commit.txt"));
$date = $cached[0]; $commit = $cached[1];
if (file_exists("/var/www/Abian/libs/commit.txt")) {
$cached = explode(":", file_get_contents("/var/www/Abian/libs/commit.txt"));
$date = $cached[0];
$commit = $cached[1];
} else {
$date = 0;
}
if ($date === date("YmdHi", time())) {
return $commit;
} else {
@@ -453,7 +456,7 @@ public function getCommit() {
$data = json_decode($data, true);
$return = $data[0]["sha"];
file_put_contents(
"/var/www/abian/libs/commit.txt",
"/var/www/Abian/libs/commit.txt",
date("YmdHi", time()) . ":" . $return
);
return $return;
BIN +160 KB libs/database.png
Binary file not shown.
Oops, something went wrong.

0 comments on commit c979dfd

Please sign in to comment.
You can’t perform that action at this time.