diff --git a/admin-slammer.php b/admin-slammer.php index 99447e1..ede9f98 100644 --- a/admin-slammer.php +++ b/admin-slammer.php @@ -42,6 +42,7 @@ else if ($_POST['knockout']) echo "Delivered IP ban to {$uinfo['lastip']}.\n"; xk_ircsend("1|". xk(8) . $uinfo['name'] . xk(7). " (IP " . xk(8) . $uinfo['lastip'] . xk(7) .") is the latest victim of the new EZ BAN button(tm)."); + report("super", "**" . $uinfo['name'] . "** (IP " . $uinfo['lastip'] .") is the latest victim of the new EZ BAN button(tm)."); echo "\n".redirect("admin-slammer.php", 'the slammer (for another go)', 2); die(); diff --git a/irc.php b/irc.php index 05123d0..fa6b2ec 100644 --- a/irc.php +++ b/irc.php @@ -9,9 +9,14 @@ require 'lib/layout.php'; $servers[3] = "irc.tcrf.net"; if ($server > count($servers) || $server <= -1) $server = 0; + print "$header
"; + print " $tblstart + $tccellh>Hold up, it's ". '$' ."YEAR. + $tccell1>Maybe you want to head straight for our Discord? + $tblend"; -print " $header
$tblstart +print "

$tblstart $tccellh>IRC Chat - BadnikZONE, #tcrf, #x $tccell1>Server List: "; diff --git a/lib/function.php b/lib/function.php index 0a35408..563f876 100644 --- a/lib/function.php +++ b/lib/function.php @@ -1336,6 +1336,17 @@ function addslashes_array($data) { } + function report($type, $msg) { + if (!function_exists('get_discord_webhook')) return; + + $wh_url = get_discord_webhook($type, null); + + if (!$wh_url) return; + + discord_send($wh_url, $outdiscord); + } + + // general purpose report function, now with discord! function xk_ircout($type, $user, $in) { // gone @@ -1357,18 +1368,33 @@ function addslashes_array($data) { if ($in['pmatch'] >= 3) $color = array(7, 4); elseif ($in['pmatch'] >= 5) $color = array(4, 5); $extra = " (". xk($color[1]) ."Password matches: ". xk($color[0]) . $in['pmatch'] . xk() .")"; + $extradiscord = " (**Password matches**: " . $in['pmatch'] . ")"; } $out = "1|New user: #". xk(12) . $in['id'] . xk(11) ." $user ". xk() ."(IP: ". xk(12) . $in['ip'] . xk() .")$extra: https://jul.rustedlogic.net/?u=". $in['id']; + $outdiscord = "New user: **#" . $in['id'] . "** (IP: " . $in['ip'] . ")$extra: "; } else { // global $sql; // $res = $sql -> resultq("SELECT COUNT(`id`) FROM `posts`"); $out = "$dest|New $type by ". xk(11) . $user . xk() ." (". xk(12) . $in['forum'] .": ". xk(11) . $in['thread'] . xk() ."): https://jul.rustedlogic.net/?p=". $in['pid']; + $outdiscord = "New $type by **" . $user . "** (" . $in['forum'] . ": **" . $in['thread'] . "**): "; } xk_ircsend($out); + + // discord part + + // logic to decide where the message goes based on info provided + if (!function_exists('get_discord_webhook')) return; + + $wh_url = get_discord_webhook($type, $in); + + if (!$wh_url) return; + + discord_send($wh_url, $outdiscord); + } function xk_ircsend($str) { @@ -1387,6 +1413,28 @@ function addslashes_array($data) { return true; } + function discord_send($url, $msg) { + // stripped down from https://gist.github.com/Mo45/cb0813cb8a6ebcd6524f6a36d4f8862c + $json_data = json_encode([ + "content" => $msg + ], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); + + + $ch = curl_init($url); + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json')); + curl_setopt($ch, CURLOPT_POST, 1); + curl_setopt($ch, CURLOPT_POSTFIELDS, $json_data); + curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); + curl_setopt($ch, CURLOPT_HEADER, 0); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + + $response = curl_exec($ch); + // echo $response; + curl_close($ch); + + return true; + } + function xk($n = -1) { if ($n == -1) $k = ""; else $k = str_pad($n, 2, 0, STR_PAD_LEFT); diff --git a/login.php b/login.php index 57aca60..f8dfd6d 100644 --- a/login.php +++ b/login.php @@ -40,11 +40,14 @@ //if ($fails > 1) @xk_ircsend("102|". xk(14) ."Failed attempt". xk(8) ." #$fails ". xk(14) ."to log in as ". xk(8) . $username . xk(14) ." by IP ". xk(8) . $_SERVER['REMOTE_ADDR'] . xk(14) ."."); + report("mod", "Failed attempt **#$fails** to log in as **$username** by IP " . $_SERVER['REMOTE_ADDR'] . "."); if ($fails >= 5) { $sql->query("INSERT INTO `ipbans` SET `ip` = '". $_SERVER['REMOTE_ADDR'] ."', `date` = '". ctime() ."', `reason` = 'Send e-mail for password recovery'"); @xk_ircsend("102|". xk(7) ."Auto-IP banned ". xk(8) . $_SERVER['REMOTE_ADDR'] . xk(7) ." for this."); + report("mod", "Auto-IP banned " . $_SERVER['REMOTE_ADDR'] . "for this."); @xk_ircsend("1|". xk(7) ."Auto-IP banned ". xk(8) . $_SERVER['REMOTE_ADDR'] . xk(7) ." for repeated failed logins."); + report("super", "Auto-IP banned " . $_SERVER['REMOTE_ADDR'] . "for repeated failed logins."); } $msg = "Couldn't login. Either you didn't enter an existing username, or you haven't entered the right password for the username."; diff --git a/schemes/garbg.php b/schemes/garbg.php index 32cc5c4..6c79dea 100644 --- a/schemes/garbg.php +++ b/schemes/garbg.php @@ -25,7 +25,7 @@ $linkcolor4 = 'CCE8FF'; # Hover $tableborder = '000011'; # Border color for tables - $tableheadtext = '002549'; # Table header text color + $tableheadtext = 'bdd8f1'; # Table header text color $tableheadbg = '000921'; # Table header background (you can use images) $categorybg = '002864'; # Category BG $tablebg1 = '001E4B'; # Table cell 1 background diff --git a/schemes/spec-zen.php b/schemes/spec-zen.php index 8fd49cc..ebbfbaa 100644 --- a/schemes/spec-zen.php +++ b/schemes/spec-zen.php @@ -4,7 +4,8 @@ $formcss=1; $inputborder='000000'; - $bgcolor='010'; + $bgcolor='010 linear-gradient(45deg, #001100 40%, #001600 40%, #001600 50%, #001100 50%, #001100 90%, #001600 90%, #001600 100%); background-size: 35.36px 35.36px'; + $bgimage=""; $textcolor='DDDDDD'; $linkcolor ='BEFEBA';