Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 Moderator access to select Admin pages
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

PPSSWeb
Junior Member

312 Posts

Posted - 31 July 2007 :  10:56:10  Show Profile  Reply with Quote
This adds a page that allows the moderators access specific admin funtions or other information.

I am using it to give moderators access to the statistics on the site (this is an intranet site and the managers only have moderator access but love to hear the statistics). It is pretty simple and should be easy to tweak for what you want site moderators to have access to.

Note: <font color="orange">This is not a secure page!</font id="orange"> It only uses a mlev check for security, so I highly recommend not putting anything sensative or potentially damaging on or linked from the page. If anyone knows of a better check that I should be using for security, please post it here.

In inc_header.asp look for:
 if (mlev = 4) or (lcase(strNoCookies) = "1") then
Response.Write " <tr>" & vbNewLine & _
" <td align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """><a href=""admin_home.asp""" & dWStatus("Access the Forum Admin Functions...") & " tabindex=""-1"">Admin Options</a>"


Just before it add this to create a link to the moderator page similar to admin options:
 if (mlev = 3) then
Response.Write " <tr>" & vbNewLine & _
" <td align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """><a href=""moderator_home.asp""" & dWStatus("Access the Forum Moderator Functions...") & " tabindex=""-1"">Moderator Options</a>" & _
" <br /><br /></font></td>" & vbNewLine & _
" </tr>" & vbNewLine
end if


Then create a page named <b>moderator_home.asp</b> modeled after the admin_home.asp page. Like the following:

<%
'#################################################################################
'## Snitz Forums 2000 v3.4.05
'#################################################################################
'## Copyright (C) 2000-05 Michael Anderson, Pierre Gorissen,
'## Huw Reddick and Richard Kinser
'##
'## This program is free software; you can redistribute it and/or
'## modify it under the terms of the GNU General Public License
'## as published by the Free Software Foundation; either version 2
'## of the License, or (at your option) any later version.
'##
'## All copyright notices regarding Snitz Forums 2000
'## must remain intact in the scripts and in the outputted HTML
'## The "powered by" text/logo with a link back to
'## http://forum.snitz.com in the footer of the pages MUST
'## remain visible when the pages are viewed on the internet or intranet.
'##
'## This program is distributed in the hope that it will be useful,
'## but WITHOUT ANY WARRANTY; without even the implied warranty of
'## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
'## GNU General Public License for more details.
'##
'## You should have received a copy of the GNU General Public License
'## along with this program; if not, write to the Free Software
'## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
'##
'## Support can be obtained from our support forums at:
'## http://forum.snitz.com
'##
'## Correspondence and Marketing Questions can be sent to:
'## manderson@snitz.com
'##
'#################################################################################
%>
<!--#INCLUDE FILE="config.asp"-->
<!--#INCLUDE FILE="inc_sha256.asp"-->
<!--#INCLUDE FILE="inc_header.asp" -->
<%
If Mlev < 3 then
Response.Write "<BR><FONT COLOR=""RED"" SIZE=""+7""><CENTER>YOU DO NOT BELONG HERE!</CENTER></FONT><BR>"

Else
Response.Write " <table border=""0"" width=""100%"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td width=""33%"" align=""left"" nowrap><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
" " & getCurrentIcon(strIconFolderOpen,"","align=""absmiddle""") & " <a href=""default.asp"">All Forums</a><br />" & vbNewLine & _
" " & getCurrentIcon(strIconBar,"","align=""absmiddle""") & getCurrentIcon(strIconFolderOpenTopic,"","align=""absmiddle""") & " Moderator Section<br /></font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" <br />" & vbNewLine & _
" <table border=""0"" width=""50%"" cellspacing=""0"" cellpadding=""0"" align=""center"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strTableBorderColor & """>" & vbNewLine & _
" <table border=""0"" width=""100%"" cellspacing=""1"" cellpadding=""4"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strCategoryCellColor & """ colspan=""2""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strCategoryFontColor & """><b>Moderator Functions</b></font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strForumCellColor & """ valign=""top""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>" & vbNewLine & _
" </UL><p><b>Forums Statistics:</b>" & vbnewline & _
" <LI><span class=""spnMessageText""><a href=""sitestat.asp"">View Basic Statistics Table</a></span></LI>" & vbNewLine & _
" <LI><span class=""spnMessageText""><a href=""member_stats.asp"">View Detailed Statistics Tables</a></span></LI>" & vbNewLine & _
" </UL></p>" & vbNewLine & _
" </font></td>" & vbNewLine & _
" </tr>" & vbNewLine
'Response.Write " <tr>" & vbNewLine & _
'" <td bgcolor=""" & strForumCellColor & """ valign=""top"" colspan=""2""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>" & vbNewLine & _
'" <p><b>Important Information from Snitz Forums 2000:</b>" & vbNewLine & _
'" <script type=""text/javascript"" src=""http://forum.snitz.com/forum/syndicate.asp""></script></p></font></td>" & vbNewLine & _
'" </tr>" & vbNewLine
Response.Write " </table>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" <br />" & vbNewLine & _
" <center><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strDefaultFontColor & """><a href=""default.asp"">Back to Forums</a></font></center><br />" & vbNewLine & _
" <br />" & vbNewLine
End If
WriteFooter
Response.End
%>


Lastly, to allow moderators access to what is normally an admin only page. change the check for the admin login for that page from:
if Session(strCookieURL & "Approval") <> "15916941253" then
scriptname = split(request.servervariables("SCRIPT_NAME"),"/")
Response.Redirect "admin_login.asp?target=" & scriptname(ubound(scriptname))
end if

to:
if  Mlev <> 3 and Session(strCookieURL & "Approval") <> "15916941253" then
scriptname = split(request.servervariables("SCRIPT_NAME"),"/")
Response.Redirect "admin_login.asp?target=" & scriptname(ubound(scriptname))
end if


<font size="1">- editted: typo</font id="size1">

Edited by - PPSSWeb on 31 July 2007 11:12:55
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.09 seconds. Powered By: Snitz Forums 2000 Version 3.4.07