From 81c864d025f8175c06c92e7afa5b7f3e42c0815d Mon Sep 17 00:00:00 2001 From: darthgandalf Date: Sat, 15 Jan 2011 17:08:57 +0000 Subject: [PATCH] Only admins should be able to load email module. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2266 726aef4b-f618-498e-8847-2d620e286838 --- modules/extra/email.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/extra/email.cpp b/modules/extra/email.cpp index 4dd32bd9..0750888a 100644 --- a/modules/extra/email.cpp +++ b/modules/extra/email.cpp @@ -48,6 +48,12 @@ public: virtual ~CEmail() {} virtual bool OnLoad(const CString & sArgs, CString& sMessage) { +#ifndef MOD_EMAIL_ALLOW_EVERYONE + if (!m_pUser->IsAdmin()) { + sMessage = "You must be admin to use the email module"; + return false; + } +#endif m_sMailPath = sArgs; StartParser();