From eb935da142515693977596928de00f21d3525ed6 Mon Sep 17 00:00:00 2001 From: psychon Date: Sun, 11 Oct 2009 12:58:48 +0000 Subject: [PATCH] blockuser: Add a missing admin check Non-admin users should not be able to block any users. Really, they shouldn't. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1648 726aef4b-f618-498e-8847-2d620e286838 --- modules/extra/blockuser.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/extra/blockuser.cpp b/modules/extra/blockuser.cpp index 2815220e..e923f293 100644 --- a/modules/extra/blockuser.cpp +++ b/modules/extra/blockuser.cpp @@ -54,6 +54,11 @@ public: void OnModCommand(const CString& sCommand) { CString sCmd = sCommand.Token(0); + if (!m_pUser->IsAdmin()) { + PutModule("Access denied"); + return; + } + if (sCmd.Equals("list")) { CTable Table; MCString::iterator it; @@ -86,7 +91,7 @@ public: PutModule("Unblocked [" + sUser + "]"); else PutModule("This user is not blocked"); - } else if (sCmd.Equals("help")) { + } else { PutModule("Commands: list, block [user], unblock [user]"); } }