Skip to content

Commit 8bb6d60

Browse files
committed
admins can see redacted usernames, fix #2653
1 parent c715d6a commit 8bb6d60

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

Zero-K.info/AppCode/HtmlHelperExtensions.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public static MvcHtmlString Print(this HtmlHelper helper, ForumThread thread) {
156156
/// <param name="ignoreDeleted">If false, just prints "{redacted}" for accounts marked as deleted</param>
157157
public static MvcHtmlString PrintAccount(this HtmlHelper helper, Account account, bool colorize = true, bool ignoreDeleted = false, bool makeLinks = true) {
158158
if (account == null) return new MvcHtmlString("Nobody");
159-
else if (account.IsDeleted && !ignoreDeleted) return new MvcHtmlString("{redacted}");
159+
else if (account.IsDeleted && !ignoreDeleted && !Global.IsModerator) return new MvcHtmlString("{redacted}");
160160
else {
161161
var clanStr = "";
162162
var url = Global.UrlHelper();
@@ -185,14 +185,16 @@ public static MvcHtmlString PrintAccount(this HtmlHelper helper, Account account
185185
string rank = string.Format(
186186
"<img src='/img/ranks/{0}.png' class='icon16' alt='rank' />",
187187
account.GetIconName());
188-
string user = account.Name;
188+
string name = account.Name;
189+
if (account.IsDeleted) name += "(REDACTED)";
190+
string user = name;
189191
if (makeLinks)
190192
{
191193
user = string.Format(
192194
"<a href='/Users/Detail/{0}' style='color:{1}' nicetitle='$user${0}'>{2}</a>",
193195
account.AccountID,
194196
colorize ? color : "",
195-
account.Name);
197+
name);
196198
}
197199

198200
return

0 commit comments

Comments
 (0)