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/lib/function.php b/lib/function.php index 0badfce..563f876 100644 --- a/lib/function.php +++ b/lib/function.php @@ -1335,6 +1335,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) { @@ -1377,8 +1388,8 @@ function addslashes_array($data) { // logic to decide where the message goes based on info provided if (!function_exists('get_discord_webhook')) return; - - $wh_url = get_discord_webhook($type, $user, $in); + + $wh_url = get_discord_webhook($type, $in); if (!$wh_url) return; 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.";