diff options
author | Patrick Davison <snapwilliam@gmail.com> | 2013-02-14 04:11:33 -0800 |
---|---|---|
committer | Patrick Davison <snapwilliam@gmail.com> | 2013-02-14 04:11:33 -0800 |
commit | 133c2dbbb90c489c95b1e7b50823e9e0cfe9c71f (patch) | |
tree | ea7409af6605eb1a5eeb19e15a1baae7fd1787c4 /pages/admin.php | |
parent | c7c8e39f9fd438a8b6279cc7410a9ce1289a6418 (diff) | |
download | pathery-133c2dbbb90c489c95b1e7b50823e9e0cfe9c71f.tar.xz |
Mute-User and Lockdown for chat. :).
Diffstat (limited to 'pages/admin.php')
-rw-r--r-- | pages/admin.php | 34 |
1 files changed, 30 insertions, 4 deletions
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 '
+?>
+
<center>
<h3>Administrators Page</h3>
<p>News:</p>
@@ -57,13 +75,21 @@ echo ' </p>
<p>Links: <a href="errorlogs">View Errorlog.txt</a></p>
-<p>Hello admins, this is our current userlist.</p>
+ <form action="admin" method="post" id='muteOptions'>
+ <input type="hidden" name="muteUser" value="true">
+ <input type="submit" value='MUTE USER'>
+ USERID:<input type="text" name="muteUserID" id="muteUserID" value="" maxlength="20" autocomplete="off" >
+ LENGTH IN HOURS:<input type="text" name="muteHours" id="muteHours" value="" maxlength="20" autocomplete="off" >
+ </form>
+
</center>
<table style="padding-left:20px;">
<tr>
<th>ID</th><th>Display name:</th><th>Joined On:</th><th>Last Logon</th><th>Email</th><th>Administrator</th>
</tr>
-';
+
+
+<?
while (list($CUID, $CUsername, $Joined, $LastLogon, $email, $isAdmin) = mysql_fetch_row($result)) {
|