mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-11 15:52:25 -05:00
fixed aliases
fixed forum decoding of thread content fixed escaping html "special" characters in player names on webfront fixed findall not always informing if no matches found.
This commit is contained in:
@ -15,6 +15,8 @@ namespace IW4MAdmin
|
||||
|
||||
static void Main(string[] args)
|
||||
{
|
||||
System.Diagnostics.Process.GetCurrentProcess().PriorityClass = System.Diagnostics.ProcessPriorityClass.BelowNormal;
|
||||
|
||||
Version = 1.6;
|
||||
handler = new ConsoleEventDelegate(OnProcessExit);
|
||||
SetConsoleCtrlHandler(handler, true);
|
||||
|
@ -285,6 +285,7 @@ namespace IW4MAdmin
|
||||
GetAliases(allAliases, currentIdentityAliases);
|
||||
if (Origin.Alias != null)
|
||||
allAliases.Add(Origin.Alias);
|
||||
allAliases.Add(currentIdentityAliases);
|
||||
return allAliases;
|
||||
}
|
||||
|
||||
|
@ -758,8 +758,9 @@ namespace IW4MAdmin
|
||||
bool authed = ApplicationManager.GetInstance().GetClientDatabase().GetAdmins().FindAll(x => x.IP == querySet["IP"] && x.Level > Player.Permission.Trusted).Count > 0
|
||||
|| querySet["IP"] == "127.0.0.1";
|
||||
bool recent = false;
|
||||
bool individual = querySet["id"] != null;
|
||||
|
||||
if (querySet["id"] != null)
|
||||
if (individual)
|
||||
{
|
||||
matchedPlayers.Add(ApplicationManager.GetInstance().GetClientDatabase().GetPlayer(Convert.ToInt32(querySet["id"])));
|
||||
}
|
||||
@ -801,18 +802,24 @@ namespace IW4MAdmin
|
||||
playernpID = pp.NetworkID,
|
||||
forumID = -1,
|
||||
authed = authed,
|
||||
showV2Features = false
|
||||
showV2Features = false,
|
||||
playerAliases = new List<string>(),
|
||||
playerIPs = new List<string>()
|
||||
|
||||
};
|
||||
|
||||
if (!recent)
|
||||
if (!recent && individual)
|
||||
{
|
||||
foreach (var a in ApplicationManager.GetInstance().GetAliases(pp))
|
||||
{
|
||||
eachPlayer.playerAliases = a.Names;
|
||||
eachPlayer.playerIPs = a.IPS;
|
||||
eachPlayer.playerAliases.AddRange(a.Names);
|
||||
eachPlayer.playerIPs.AddRange(a.IPS);
|
||||
}
|
||||
}
|
||||
|
||||
eachPlayer.playerAliases = eachPlayer.playerAliases.Distinct().ToList();
|
||||
eachPlayer.playerIPs = eachPlayer.playerIPs.Distinct().ToList();
|
||||
|
||||
eachPlayer.playerConnections = pp.Connections;
|
||||
eachPlayer.lastSeen = Utilities.GetTimePassed(pp.LastConnection);
|
||||
pInfo.Add(eachPlayer);
|
||||
|
Binary file not shown.
@ -8,6 +8,7 @@ CHANGELOG:
|
||||
-prune command demotes inactive admins (defaults to 30 days if no days are specified)
|
||||
-confirmation message sent after kick
|
||||
-paginated players page
|
||||
-fixed aliases
|
||||
|
||||
Version 1.5
|
||||
CHANGELOG:
|
||||
|
@ -1,34 +1,29 @@
|
||||
<script>
|
||||
var curFrom = 0;
|
||||
var curFrom = 0;
|
||||
|
||||
function getNextPage()
|
||||
{
|
||||
curFrom += 15;
|
||||
return curFrom;
|
||||
}
|
||||
function getNextPage() {
|
||||
curFrom += 15;
|
||||
return curFrom;
|
||||
}
|
||||
|
||||
function getPrevPage()
|
||||
{
|
||||
if ((curFrom - 15) >= 0)
|
||||
{
|
||||
curFrom -= 15;
|
||||
return (curFrom );
|
||||
}
|
||||
else
|
||||
{
|
||||
curFrom = 0;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
function getPrevPage() {
|
||||
if ((curFrom - 15) >= 0) {
|
||||
curFrom -= 15;
|
||||
return (curFrom);
|
||||
}
|
||||
else {
|
||||
curFrom = 0;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
function getPenalties(from)
|
||||
{
|
||||
$("#penaltyList").html("");
|
||||
$(".loader").fadeIn();
|
||||
$.getJSON("/_penalties?from=" + from, function(result) {
|
||||
$.each(result, function(i, penalty) {
|
||||
$("#penaltyList").append(
|
||||
"<div class=\"playerPenalty table alternate_" + i % 2 + "\"> \
|
||||
function getPenalties(from) {
|
||||
$("#penaltyList").html("");
|
||||
$(".loader").fadeIn();
|
||||
$.getJSON("/_penalties?from=" + from, function (result) {
|
||||
$.each(result, function (i, penalty) {
|
||||
$("#penaltyList").append(
|
||||
"<div class=\"playerPenalty table alternate_" + i % 2 + "\"> \
|
||||
<div class=\"penaltyName tableCell\"><a href=\"/players?id="+ penalty['playerID'] + "\">" + penalty['playerName'] + "</a></div> \
|
||||
<div class=\"penaltyType tableCell\">"+ getColorForLevel(penalty['penaltyType'], penalty['penaltyType']) + "</div> \
|
||||
<div class=\"penaltyReason tableCell\">"+ penalty['penaltyReason'] + "</div> \
|
||||
@ -36,28 +31,28 @@ function getPenalties(from)
|
||||
<div class=\"penaltyTime tableCell\">"+ penalty['penaltyTime'] + "</div> \
|
||||
<div class=\" penaltyRemaining tableCell\">" + penalty['Expires'] + "</div> \
|
||||
</div>"
|
||||
)
|
||||
});
|
||||
)
|
||||
});
|
||||
|
||||
}).done(function (data) { $(".loader").fadeOut(); });
|
||||
}
|
||||
$( document ).ready(function() {
|
||||
getPenalties(0);
|
||||
});
|
||||
}).done(function (data) { $(".loader").fadeOut(); });
|
||||
}
|
||||
$(document).ready(function () {
|
||||
getPenalties(0);
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="penaltyHeader table">
|
||||
<div class="penaltyName tableCell">Name</div>
|
||||
<div class="penaltyType tableCell">Type</div>
|
||||
<div class="penaltyReason tableCell">Reason</div>
|
||||
<div class="penaltyOrigin tableCell">Admin</div>
|
||||
<div class="penaltyTime tableCell">Time</div>
|
||||
<div class="penaltyRemaining tableCell">Remaining</div>
|
||||
<div class="penaltyName tableCell">Name</div>
|
||||
<div class="penaltyType tableCell">Type</div>
|
||||
<div class="penaltyReason tableCell">Reason</div>
|
||||
<div class="penaltyOrigin tableCell">Admin</div>
|
||||
<div class="penaltyTime tableCell">Time</div>
|
||||
<div class="penaltyRemaining tableCell">Remaining</div>
|
||||
</div>
|
||||
<div id="penaltyList">
|
||||
</div>
|
||||
<hr />
|
||||
<div id="paginationButtons" class="table">
|
||||
<div id="paginationButtons" class="table">
|
||||
<div id="previousPage" class="tableCell"><a href=# onclick="getPenalties(getPrevPage())"><<</a></div>
|
||||
<div id="nextPage" class="tableCell"><a href=# onclick="getPenalties(getNextPage())">>></a></div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,4 +1,14 @@
|
||||
|
||||
<script>
|
||||
function escapeHtml(unsafe) {
|
||||
return unsafe
|
||||
.replace(/&/g, "&")
|
||||
.replace(/</g, "<")
|
||||
.replace(/>/g, ">")
|
||||
.replace(/"/g, """)
|
||||
.replace(/'/g, "'");
|
||||
}
|
||||
|
||||
var curFrom = 0;
|
||||
|
||||
function getNextPage() {
|
||||
@ -9,18 +19,22 @@
|
||||
function getPrevPage() {
|
||||
if ((curFrom - 15) >= 0) {
|
||||
curFrom -= 15;
|
||||
return (curFrom - 15);
|
||||
return (curFrom);
|
||||
}
|
||||
else
|
||||
else {
|
||||
curFrom = 0;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
function formatHidden(data, authed) {
|
||||
var p = "<div class=\"hiddenWrapper\"><span>Expand</span><div class=\"hiddenElements\">";
|
||||
|
||||
if (authed) {
|
||||
if (data == undefined || data.length == 0)
|
||||
p += "Not Loaded"
|
||||
$.each(data, function (i, dat) {
|
||||
p += "<span>" + dat + "</span><br/>"
|
||||
p += "<span>" + escapeHtml(dat) + "</span><br/>"
|
||||
})
|
||||
}
|
||||
|
||||
@ -36,7 +50,7 @@
|
||||
var p = "";
|
||||
p +=
|
||||
"<div class=\"playerInfo table alternate_" + i % 2 + "\"> \
|
||||
<div class=\"tableCell\"><a href=\"/players?id=" + player['playerID'] + "\">" + player['playerName'] + "</a></div> \
|
||||
<div class=\"tableCell\"><a href=\"/players?id=" + player['playerID'] + "\">" + escapeHtml(player['playerName']) + "</a></div> \
|
||||
<div class=\"tableCell\">" + formatHidden(player['playerAliases'], player.authed) + "</div> \
|
||||
<div class=\"tableCell\">" + formatHidden(player['playerIPs'], player.authed) + "</div> \
|
||||
<div class=\"tableCell\">" + getColorForLevel(player['playerLevel'], player['playerLevel']) + "</div> \
|
||||
@ -73,7 +87,8 @@
|
||||
$.each(result, function (i, player) {
|
||||
printPlayer(player, i);
|
||||
});
|
||||
}).done(function (data) { $(".loader").fadeOut(); });
|
||||
}).done(function (data) { $(".loader").fadeOut(); })
|
||||
.error(function (data) { $(".loader").fadeOut(); })
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
|
Reference in New Issue
Block a user