Lastseen module doesn't display links to webadmin webpages anymore if webadmin isn't loaded.

Patch by BrianC, thanks.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2126 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
darthgandalf
2010-09-09 03:30:27 +00:00
parent 83f6366473
commit 70ae4bab6f
2 changed files with 14 additions and 4 deletions
+11 -1
View File
@@ -94,6 +94,16 @@ public:
virtual bool OnWebRequest(CWebSock& WebSock, const CString& sPageName, CTemplate& Tmpl) {
if (sPageName.empty() || sPageName == "index") {
CModules& GModules = CZNC::Get().GetModules();
if (GModules.size()) {
for (unsigned int b = 0; b < GModules.size(); b++) {
if(GModules[b]->GetModName().Equals("WEBADMIN")) {
Tmpl["WebAdminLoaded"] = "true";
break;
}
}
}
MTimeMulti mmSorted;
const MUsers& mUsers = CZNC::Get().GetUserMap();
@@ -134,7 +144,7 @@ public:
Row["Info"] += " channel" + CString(n == 1 ? "" : "s");
}
}
return true;
}
+3 -3
View File
@@ -7,7 +7,7 @@
<td>User</td>
<td>Last Seen</td>
<td>Info</td>
<td>Action</td>
<? IF WebAdminLoaded ?><td>Action</td><? ENDIF ?>
</tr>
</thead>
<tbody>
@@ -16,10 +16,10 @@
<td><? VAR Username ?></td>
<td><? VAR LastSeen DEFAULT="- unknown -" ?></td>
<td><? VAR Info ?></td>
<td><span class="nowrap">
<? IF WebAdminLoaded TOP ?><td><span class="nowrap">
[<a href="/mods/webadmin/edituser?user=<?VAR Username ESC=URL?>">Edit</a>]
<? IF !IsSelf ?>[<a href="/mods/webadmin/deluser?user=<?VAR Username ESC=URL?>">Delete</a>]<? ENDIF ?>
</span></td>
</span></td><? ENDIF ?>
</tr>
<? ENDLOOP ?>
</tbody>