Skip to content

Commit

Permalink
upgrade to recaptcha v3, cleanup login
Browse files Browse the repository at this point in the history
  • Loading branch information
kedarv committed Mar 28, 2020
1 parent 9b2752e commit 34c2f41
Show file tree
Hide file tree
Showing 77 changed files with 6,216 additions and 5,793 deletions.
8 changes: 3 additions & 5 deletions assets/config/database.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
if(basename($_SERVER["PHP_SELF"]) == "database.php") {
if (basename($_SERVER["PHP_SELF"]) == "database.php") {
die("403 - Access Forbidden");
}
//SQL Information
$host['hostname'] = 'localhost'; // Hostname [Usually locahost]
$host['hostname'] = '127.0.0.1'; // Hostname [Usually locahost]
$host['user'] = 'root'; // Database Username [Usually root]
$host['password'] = ''; // Database Password [Leave blank if unsure]
$host['database'] = 'mapleblade'; // Database Name
Expand All @@ -16,6 +16,4 @@
$worldport = "8484";

/* Don`t touch. */
$mysqli = new MySQLi($host['hostname'],$host['user'],$host['password'],$host['database']);

?>
$mysqli = new MySQLi($host['hostname'], $host['user'], $host['password'], $host['database']);
202 changes: 105 additions & 97 deletions assets/config/funcs.php

Large diffs are not rendered by default.

1,049 changes: 562 additions & 487 deletions assets/config/install/install.php

Large diffs are not rendered by default.

122 changes: 61 additions & 61 deletions assets/config/properties.php
Original file line number Diff line number Diff line change
@@ -1,67 +1,67 @@
<?php
if(basename($_SERVER["PHP_SELF"]) == "properties.php") {
die("403 - Access Forbidden");
if (basename($_SERVER["PHP_SELF"]) == "properties.php") {
die("403 - Access Forbidden");
}
try {
/* Site Controls */
$properties = $mysqli->query("SELECT * FROM ".$prefix."properties");
if (!$properties)
/* Site Controls */
$properties = $mysqli->query("SELECT * FROM ".$prefix."properties");
if (!$properties) {
throw new Exception($mysqli->error);
$prop = $properties->fetch_assoc();
$themetype = "light";
$nav = "navbar navbar-expand-lg navbar-light bg-light";
$ipaddress = isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];


/* Name of server */
$servername = $prop['name'];
$siteurl = $prop['siteurl'];
$banner = $prop['banner'];
$background = $prop['background'];
$bgcolor = $prop['bgcolor'];
$bgrepeat = $prop['bgrepeat'];
$bgcenter = $prop['bgcenter'];
$bgfixed = $prop['bgfixed'];
$bgcover = $prop['bgcover'];
/* Download link for client */
$client = $prop['client'];
$server = $prop['server'];
/* Server Version and Type*/
$version = (float)$prop['version'];
$servertype = $prop['type'];
/* Forum url*/
$forumurl = $prop['forumurl'];
/* Server Rates */
$exprate = $prop['exprate'];
$mesorate = $prop['mesorate'];
$droprate = $prop['droprate'];
/* Flood Prevention */
$baseflood = $prop['flood'];
/* Flood Interval */
$basefloodint = $prop['floodint'];
/* Level for GMs and up */
$gmlevel = $prop['gmlevel'];
/* Get Theme */
$theme = $prop['theme'];
$getdarkhemes = array("cyborg", "slate", "superhero", "darkly");
if (in_array($theme, $getdarkhemes)) {
$themetype = "dark";
}
/*Get Vote Config*/
$colnx = $prop['colnx'];
$colvp = $prop['colvp'];

/* reCAPTCHA Keys */
$recaptcha_public = ($prop['recaptcha_public'] ?: null);
$recaptcha_private = ($prop['recaptcha_private'] ?: null);
}
$prop = $properties->fetch_assoc();
$themetype = "light";
$nav = "navbar navbar-expand-lg navbar-light bg-light";
$ipaddress = isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];

/* Name of server */
$servername = $prop['name'];
$siteurl = $prop['siteurl'];
$domain = $prop['domain'];
$banner = $prop['banner'];
$background = $prop['background'];
$bgcolor = $prop['bgcolor'];
$bgrepeat = $prop['bgrepeat'];
$bgcenter = $prop['bgcenter'];
$bgfixed = $prop['bgfixed'];
$bgcover = $prop['bgcover'];
/* Download link for client */
$client = $prop['client'];
$server = $prop['server'];
/* Server Version and Type*/
$version = (float)$prop['version'];
$servertype = $prop['type'];
/* Forum url*/
$forumurl = $prop['forumurl'];
/* Server Rates */
$exprate = $prop['exprate'];
$mesorate = $prop['mesorate'];
$droprate = $prop['droprate'];
/* Flood Prevention */
$baseflood = $prop['flood'];
/* Flood Interval */
$basefloodint = $prop['floodint'];
/* Level for GMs and up */
$gmlevel = $prop['gmlevel'];
/* Get Theme */
$theme = $prop['theme'];
$getdarkhemes = array("cyborg", "slate", "superhero", "darkly");
if (in_array($theme, $getdarkhemes)) {
$themetype = "dark";
}
/*Get Vote Config*/
$colnx = $prop['colnx'];
$colvp = $prop['colvp'];

/* reCAPTCHA Keys */
$recaptcha_public = ($prop['recaptcha_public'] ?: null);
$recaptcha_private = ($prop['recaptcha_private'] ?: null);

$hash_algorithm = ($prop['hash_algorithm']);
if ($prop['nav']) {
$nav = "navbar navbar-expand-lg navbar-dark bg-dark";
}
} catch(Exception $e) {
print("Unable to load MapleBit configuration. Perhaps MapleBit has not been installed yet.<br/>To resolve this, delete <b>assets/config/install/installdone.txt</b> and reload this page.");
exit();
$hash_algorithm = ($prop['hash_algorithm']);
if ($prop['nav']) {
$nav = "navbar navbar-expand-lg navbar-dark bg-dark";
}
} catch (Exception $e) {
print("Unable to load MapleBit configuration. Perhaps MapleBit has not been installed yet.<br/>To resolve this, delete <b>assets/config/install/installdone.txt</b> and reload this page.");
exit();
}
?>
Loading

0 comments on commit 34c2f41

Please sign in to comment.