From 133c2dbbb90c489c95b1e7b50823e9e0cfe9c71f Mon Sep 17 00:00:00 2001 From: Patrick Davison Date: Thu, 14 Feb 2013 04:11:33 -0800 Subject: Mute-User and Lockdown for chat. :). --- pages/admin.php | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) (limited to 'pages/admin.php') diff --git a/pages/admin.php b/pages/admin.php index bda527d..2109f7c 100644 --- a/pages/admin.php +++ b/pages/admin.php @@ -9,7 +9,7 @@ topbar($Links); include_once('./includes/datas.php'); include_once('./includes/maps.php'); include_once('./includes/mapoftheday.php'); -include_once('./includes/sqlEmbedded.php'); +include_once('./includes/sqli.php'); include_once('./includes/playerStats.php'); if ($_GET['applyall'] == 'true') { @@ -41,12 +41,30 @@ else if ($_GET['deleteErrors'] == 'true') { echo "Log restarted!"; } +else if ($_POST['muteUser'] == 'true') { + + muteUser($_POST['muteUserID'], $_POST['muteHours']); + echo "User ID ".$_POST['muteUserID']." muted for ".$_POST['muteHours']." hours"; +} + +function muteUser($userID, $numHours) { + global $mysqli; + $stmt = $mysqli->prepare("UPDATE `users` + SET `dateChatGaggedUntil` = ADDDATE(CURDATE(), INTERVAL ? HOUR) + WHERE `ID` = ?"); + $stmt->bind_param('ii', $numHours, $userID); + $stmt->execute(); + return; +} + + $sql = "SELECT `ID`, `displayName`, `dateJoined`, `dateLogin`, `email`, `isAdmin` FROM `users`"; $result = mysql_query($sql); -echo ' +?> +

Administrators Page

News:

@@ -57,13 +75,21 @@ echo '

Links: View Errorlog.txt

-

Hello admins, this is our current userlist.

+
+ + + USERID: + LENGTH IN HOURS: +
+
-'; + + +
IDDisplay name:Joined On:Last LogonEmailAdministrator