From: <dar...@us...> - 2010-09-09 03:30:33
|
Revision: 2126 http://znc.svn.sourceforge.net/znc/?rev=2126&view=rev Author: darthgandalf Date: 2010-09-09 03:30:27 +0000 (Thu, 09 Sep 2010) Log Message: ----------- Lastseen module doesn't display links to webadmin webpages anymore if webadmin isn't loaded. Patch by BrianC, thanks. Modified Paths: -------------- trunk/modules/lastseen/tmpl/index.tmpl trunk/modules/lastseen.cpp Modified: trunk/modules/lastseen/tmpl/index.tmpl =================================================================== --- trunk/modules/lastseen/tmpl/index.tmpl 2010-09-09 03:29:59 UTC (rev 2125) +++ trunk/modules/lastseen/tmpl/index.tmpl 2010-09-09 03:30:27 UTC (rev 2126) @@ -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> Modified: trunk/modules/lastseen.cpp =================================================================== --- trunk/modules/lastseen.cpp 2010-09-09 03:29:59 UTC (rev 2125) +++ trunk/modules/lastseen.cpp 2010-09-09 03:30:27 UTC (rev 2126) @@ -94,6 +94,16 @@ 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 @@ Row["Info"] += " channel" + CString(n == 1 ? "" : "s"); } } - + return true; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |