2017-05-27 00:22:50 -04:00
|
|
|
|
<!DOCTYPE html>
|
2015-04-10 00:02:12 -04:00
|
|
|
|
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
|
|
|
|
|
<head>
|
|
|
|
|
<meta charset="utf-8" />
|
2017-05-26 18:49:27 -04:00
|
|
|
|
<title>IW4MAdmin by RaidMax</title>
|
2017-05-27 00:22:50 -04:00
|
|
|
|
<meta name="description" content="Administration tool for IW4M servers. IW4MAdmin Created by RaidMax">
|
2017-05-26 18:49:27 -04:00
|
|
|
|
<link href='https://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
|
2015-04-10 00:02:12 -04:00
|
|
|
|
|
2017-05-26 18:49:27 -04:00
|
|
|
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
|
|
|
|
|
<script src="https://use.fontawesome.com/9c581fe29b.js"></script>
|
2015-04-10 00:02:12 -04:00
|
|
|
|
|
2017-05-26 18:49:27 -04:00
|
|
|
|
<link rel="stylesheet" type="text/css" href="/webfront/main.css"/>
|
|
|
|
|
<link rel="stylesheet" type="text/css" href="/webfront/mobile.css"/>
|
2015-04-10 00:02:12 -04:00
|
|
|
|
</head>
|
2017-05-26 18:49:27 -04:00
|
|
|
|
<script>
|
|
|
|
|
var user;
|
|
|
|
|
|
|
|
|
|
$.getJSON("_userinfo", function(response) {
|
|
|
|
|
user = response;
|
|
|
|
|
$(document).trigger("actionEventLoad");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function showErrorMessage(msg)
|
|
|
|
|
{
|
2017-05-27 00:22:50 -04:00
|
|
|
|
message = "An unknown error occurred!";
|
|
|
|
|
switch(msg)
|
|
|
|
|
{
|
|
|
|
|
case 0:
|
|
|
|
|
message = "No error";
|
|
|
|
|
break;
|
|
|
|
|
case 1:
|
|
|
|
|
message = "Permission denied";
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
message = "User exists";
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
message = "Invalid user";
|
|
|
|
|
break;
|
|
|
|
|
case 4:
|
|
|
|
|
message = "Incorrect username or password";
|
|
|
|
|
break;
|
|
|
|
|
case 5:
|
|
|
|
|
message = "No credentials entered";
|
|
|
|
|
break;
|
|
|
|
|
case 6:
|
|
|
|
|
message = "User not authorized";
|
|
|
|
|
break;
|
|
|
|
|
case 7:
|
|
|
|
|
message = "Password too long";
|
|
|
|
|
break;
|
|
|
|
|
case 8:
|
|
|
|
|
message = "Username too long";
|
|
|
|
|
break;
|
|
|
|
|
case 9:
|
|
|
|
|
message = "Bad profile data entered";
|
|
|
|
|
break;
|
|
|
|
|
case 10:
|
|
|
|
|
message = "Invalid session";
|
|
|
|
|
break;
|
|
|
|
|
case 11:
|
|
|
|
|
message = "Bad thread content entered";
|
|
|
|
|
break;
|
|
|
|
|
case 12:
|
|
|
|
|
message = "No thread content entered";
|
|
|
|
|
break;
|
|
|
|
|
case 13:
|
|
|
|
|
message = "Thread content too long";
|
|
|
|
|
break;
|
|
|
|
|
case 14:
|
|
|
|
|
message = "Thread title too long";
|
|
|
|
|
break;
|
|
|
|
|
case 15:
|
|
|
|
|
message = "Invalid thread specified";
|
|
|
|
|
break;
|
|
|
|
|
case 16:
|
|
|
|
|
message = "Could not save reply";
|
|
|
|
|
break;
|
|
|
|
|
case 17:
|
|
|
|
|
message = "Invalid category specified";
|
|
|
|
|
break;
|
|
|
|
|
case 18:
|
|
|
|
|
message = "Empty category";
|
|
|
|
|
break;
|
|
|
|
|
case 19:
|
|
|
|
|
message = "Password do not match";
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
$('.alertBox').html(message).addClass('error').slideDown("fast");
|
2017-05-26 18:49:27 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function parseGet(val) {
|
|
|
|
|
var result = "undefined",
|
|
|
|
|
tmp = [];
|
|
|
|
|
location.search
|
|
|
|
|
.substr(1)
|
|
|
|
|
.split("&")
|
|
|
|
|
.forEach(function (item) {
|
|
|
|
|
tmp = item.split("=");
|
|
|
|
|
if (tmp[0] === val) result = decodeURIComponent(tmp[1]);
|
|
|
|
|
});
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getColorForLevel(level, name)
|
|
|
|
|
{
|
|
|
|
|
switch (level)
|
|
|
|
|
{
|
|
|
|
|
case "User":
|
|
|
|
|
case "Guest":
|
|
|
|
|
return "<span style='color: rgba(255, 255, 255, 0.85);'>" + name + "</span>";
|
|
|
|
|
case "Trusted":
|
|
|
|
|
case "Kick":
|
|
|
|
|
case "User":
|
|
|
|
|
return "<span style='color: rgba(116,147,99,1);''>" + name + "</span>";
|
|
|
|
|
case "Flagged":
|
2017-06-01 13:42:28 -04:00
|
|
|
|
case "Flag":
|
2017-05-26 18:49:27 -04:00
|
|
|
|
case "TempBan":
|
|
|
|
|
return "<span style='color: rgba(253, 139, 22, 0.85);'>" + name + "</span>";
|
|
|
|
|
case "Banned":
|
|
|
|
|
case "Ban":
|
|
|
|
|
case "Console":
|
|
|
|
|
return "<span style='color: rgba(255, 69, 69, 0.85);'>" + name + "</span>";
|
|
|
|
|
case "Moderator":
|
|
|
|
|
case "Warning":
|
2017-06-01 13:42:28 -04:00
|
|
|
|
case "Report":
|
2017-05-26 18:49:27 -04:00
|
|
|
|
return "<span style='color: rgba(235, 211, 101, 0.75);'>" + name + "</span>";
|
|
|
|
|
case "Administrator":
|
|
|
|
|
return "<span style='color: rgba(236, 130, 222, 0.69);'>" + name + "</span>";
|
|
|
|
|
case "SeniorAdmin":
|
|
|
|
|
return "<span style='color: rgba(50, 177, 185, 0.85);'>" + name + "</span>";
|
|
|
|
|
case "Owner":
|
|
|
|
|
return "<span style='color: rgb(0, 122, 204);'>" + name + "</span>";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function formatMessages(messages)
|
|
|
|
|
{
|
|
|
|
|
var chats = "";
|
|
|
|
|
$.each(messages, function(i, chat) {
|
|
|
|
|
chats +=
|
2017-05-27 00:22:50 -04:00
|
|
|
|
"<div class='chatPlayerName tableCell'>" + $("<div/>").html(chat['Name']).text()+ ":</div><div class='chatPlayerMessage tableCell'>" + $("<div/>").html(chat['Message']).text() + "</div> \
|
2017-05-26 18:49:27 -04:00
|
|
|
|
<div style='display:table-row'></div>"
|
|
|
|
|
});
|
|
|
|
|
return chats;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getPages()
|
|
|
|
|
{
|
|
|
|
|
$.getJSON("/pages", function(result){
|
|
|
|
|
$.each(result, function(i, page){
|
|
|
|
|
if (page['visible'] == true)
|
|
|
|
|
$("#navContainer").append("<div class=navEntry><a href=\"" + page['pagePath'] + "\">" + page['pageName'] + "</a></div>");
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function shouldHideAction(author)
|
|
|
|
|
{
|
|
|
|
|
// fixme dynamic
|
2017-05-27 00:22:50 -04:00
|
|
|
|
if (author.ranking == null)
|
2017-05-26 18:49:27 -04:00
|
|
|
|
return " display: none";
|
2017-05-27 00:22:50 -04:00
|
|
|
|
else if (user.user.ranking.name == "Moderator" || user.user.ranking.name == "Administrator" || user.user.id == author.id)
|
2017-05-26 18:49:27 -04:00
|
|
|
|
return "";
|
|
|
|
|
else {
|
|
|
|
|
return " display: none";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function formatPlayers(players)
|
|
|
|
|
{
|
|
|
|
|
var p = "";
|
|
|
|
|
for (i = 0; i < players.length; i++)
|
|
|
|
|
{
|
2017-05-27 00:22:50 -04:00
|
|
|
|
p += "<div class='playerName tableCell'><a href=\"/players?id=" + players[1*i]['playerID'] + "\">" + getColorForLevel(players[1*i]['playerLevel'], $("<div/>").html(players[1*i]['playerName']).text()) + "</a></div>";
|
2017-05-26 18:49:27 -04:00
|
|
|
|
if (i % 2 == 1 && i != 0 )
|
|
|
|
|
p += "<div style='display: table-row'></div>";
|
|
|
|
|
}
|
|
|
|
|
return p;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function checkJustNow(timestr)
|
|
|
|
|
{
|
2017-08-23 18:29:48 -04:00
|
|
|
|
return timestr
|
2017-05-26 18:49:27 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getDate(datestr)
|
|
|
|
|
{
|
|
|
|
|
var creationDate = new Date(datestr);
|
|
|
|
|
return (creationDate.getMonth() + 1) + '-' + creationDate.getDate() + '-' + creationDate.getFullYear();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function checkPrivilege()
|
|
|
|
|
{
|
2017-05-27 00:22:50 -04:00
|
|
|
|
$.getJSON("_userinfo", function (response) { if (response.user.ranking.id != 1) window.location.replace("home"); else $('.infoBox').show(); });
|
2017-05-26 18:49:27 -04:00
|
|
|
|
}
|
2015-04-19 14:14:30 -04:00
|
|
|
|
</script>
|
2017-05-26 18:49:27 -04:00
|
|
|
|
<body>
|
|
|
|
|
<div id="header">
|
|
|
|
|
<div id="navContainer">
|
|
|
|
|
<div id="navHeader">IW4MAdmin</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="loader"></div>
|
|
|
|
|
<div id="content">
|