summaryrefslogtreecommitdiffstats
path: root/pages/admin.php
diff options
context:
space:
mode:
Diffstat (limited to 'pages/admin.php')
-rw-r--r--pages/admin.php34
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)) {