home *** CD-ROM | disk | FTP | other *** search
/ bombers.k12.ar.us / bombers.k12.ar.us.tar / bombers.k12.ar.us / survey / AccessDenied.asp next >
Text File  |  2006-11-29  |  9KB  |  200 lines

  1. <!--#Include File="Include/Top_inc.asp"-->
  2. <%
  3. '***********************************************************************
  4. '   Application: SelectSurveyASP Advanced v8.1.11
  5. '   Author: Aaron Baril for ClassApps.com
  6. '   Page Description: This page is displayed when the user attempts to 
  7. '                     access a screen that they do not have access to.
  8. '
  9. '   COPYRIGHT NOTICE                                
  10. '
  11. '   See attached Software License Agreement
  12. '
  13. '   (c) Copyright 2002 - 2006 by ClassApps.com.  All rights reserved.
  14. '***********************************************************************
  15. %>
  16. <!--#Include File="Include/SurveyUtility_inc.asp"-->
  17. <!--#Include File="Include/Utility_inc.asp"-->
  18. <!--#Include File="Include/Constants_inc.asp"-->
  19. <!--#Include File="Include/Config_inc.asp"-->
  20. <!--#Include File="Include/adovbs_inc.asp"-->
  21. <!--#Include File="Include/CurrentUser_inc.asp"-->
  22. <!--#Include File="Include/SurveySecurity_inc.asp"-->
  23.  
  24. <%
  25.     Dim rsSurvey
  26.     Dim strMessage
  27.     Dim strSQL
  28.     Dim strTitle
  29.     Dim strAdminEmailAddress
  30.     Dim strPageTitle1
  31.     Dim strPageTitle2
  32.     
  33.     'Set defaults
  34.     strPageTitle1 = "Unable to Access Page"
  35.     strPageTitle2 = "Unable to Access the Requested Page"
  36.     strMessage = "There was an unspecified error while trying to access the requested page."
  37.     
  38.     'Only query for information about the survey if a Survey ID was passed to this page.  For errors
  39.     'that do not pass survey ID's, the error is general to the survey application.
  40.     If Len(Request.QueryString("SurveyID")) > 0 Then
  41.         'Select some basic information about the survey
  42.         Set rsSurvey = Server.CreateObject("ADODB.Recordset")
  43.         strSQL = "SELECT title, admin_email_address " & _
  44.                     "FROM sur_survey " & _
  45.                     "WHERE survey_id = " & Request.QueryString("SurveyID")
  46.         rsSurvey.Open ConvertSQL(strSQL), SURVEY_APP_CONNECTION, adOpenForwardOnly, adLockReadOnly, adCmdText
  47.             
  48.         rsSurvey.MoveFirst
  49.         strTitle = rsSurvey("title")
  50.         strAdminEmailAddress = rsSurvey("admin_email_address")
  51.         rsSurvey.Close
  52.         Set rsSurvey = Nothing
  53.     End If
  54.  
  55.     'Based on the reason passed in, display the appropriate error message
  56.     Select Case CLng(Request.QueryString("Reason"))
  57.         Case SUR_ACCESS_DENIED_NOT_OWNER:
  58.             strPageTitle1 = "Unable to Access Survey"
  59.             strPageTitle2 = "Insufficient Permissions to Manage Survey"
  60.             strMessage = "You do not have permission to manage or modify the survey '" & strTitle & "' because you are not an owner or administrator."
  61.         Case SUR_ACCESS_DENIED_NOT_ADMIN_SECURITY_LEVEL:
  62.             strPageTitle1 = "Unable to Access Survey"
  63.             strPageTitle2 = "Insufficient Permissions to Manage Survey"
  64.             strMessage = "You have not been granted administrative permissions.  Administrative permissions are needed to create or modify surveys."
  65.         Case SUR_ACCESS_DENIED_NOT_PERMISSION_TO_VIEW_REPORT:
  66.             strPageTitle1 = "Unable to View Report"
  67.             strPageTitle2 = "Insufficient Permissions to View Report"
  68.             strMessage = "You cannot view this report because you are not an owner and because the survey's reports are not public."
  69.         Case SUR_ACCESS_DENIED_NOT_PERMISSION_TO_PAGE_FILTERS:
  70.             strPageTitle1 = "Unable to Manage Filters"
  71.             strPageTitle2 = "Insufficient Permissions to Manage Filters"
  72.             strMessage = "You cannot manage report filters because you do not have access rights to this report."
  73.         Case SUR_ACCESS_DENIED_NOT_EMAIL_LIST_OWNER:
  74.             strPageTitle1 = "Unable to Delete Email List"
  75.             strPageTitle2 = "Insufficient Permissions to Delete Email List"
  76.             strMessage = "You cannot delete this email list because you are not the owner."
  77.         Case SUR_ACCESS_DENIED_NOT_TEMPLATE_OWNER:
  78.             strPageTitle1 = "Unable to Delete Template"
  79.             strPageTitle2 = "Insufficient Permissions to Delete Template"
  80.             strMessage = "You cannot delete this template because you are not the owner."
  81.         Case SUR_ACCESS_DENIED_NOT_LIBRARY_OWNER:
  82.             strPageTitle1 = "Unable to Delete Library"
  83.             strPageTitle2 = "Insufficient Permissions to Delete Library"
  84.             strMessage = "You cannot delete this library because you are not the owner."
  85.         Case SUR_ACCESS_DENIED_INVALID_SURVEY_ID:
  86.             strPageTitle1 = "Unable to Access Survey"
  87.             strPageTitle2 = "Invalid Survey ID"
  88.             strMessage = "The survey ID used in trying to take this survey is not valid.  There are no surveys in the system with that survey ID."
  89.         Case SUR_ACCESS_DENIED_NOT_OWNER_FOR_RESULTS_SHARING
  90.             strPageTitle1 = "Unable to Access Results Sharing"
  91.             strPageTitle2 = "Insufficient Permissions to Access Results Sharing"
  92.             strMessage = "You cannot access the results sharing for this survey because you are not an owner or administrator of the survey."
  93.         Case SUR_ACCESS_DENIED_REPORT_SHARE_INACTIVE:
  94.             strPageTitle1 = "Unable to Access Reports"
  95.             strPageTitle2 = "Inactive Report Share"
  96.             strMessage = "You cannot access the reports for the survey '" & strTitle & "' because the report share is not currently active."
  97.         Case SUR_ACCESS_DENIED_REPORT_SHARE_DELETED:
  98.             strPageTitle1 = "Unable to Access Reports"
  99.             strPageTitle2 = "Deleted Report Share"
  100.             strMessage = "You cannot access the reports for this survey because the report share has been deleted."
  101.         Case SUR_ACCESS_DENIED_REPORT_SHARE_NOT_DATA_EXPORT
  102.             strPageTitle1 = "Unable to Access Data Export"
  103.             strPageTitle2 = "Insufficient Permissions to Export Data"
  104.             strMessage = "You cannot access the data export functionality for this survey because this permission has not been granted to you."
  105.         Case SUR_ACCESS_DENIED_REPORT_SHARING_DISABLED:
  106.             strPageTitle1 = "Unable to Access Reports"
  107.             strPageTitle2 = "Report Sharing Is Disabled for this Survey"
  108.             strMessage = "You cannot access the reports for the survey '" & strTitle & "' because the report sharing for this survey has been disabled by the survey owner(s)."
  109.     End Select
  110. %>
  111.  
  112. <html>
  113. <head>
  114.     <title><%=strPageTitle1%></title>
  115.     <link rel="stylesheet" href="Resources/StyleSheet/SurveyStyle.css">
  116. </head>
  117. <body class="MainBodyStyle">
  118.  
  119. <!--#Include File="Include/FrameworkTop_inc.asp"-->
  120.  
  121. <table border="0" cellspacing="0" cellpadding="0" width="754" class="MediumBlueBackgroundColor">
  122.     <tr>
  123.         <td height="36" valign="center">
  124.               <span class="H1HeadingStyle"><a name="skipnav" tabindex="1"><%=strPageTitle1%></a></span>
  125.         </td>
  126.     </tr>
  127. </table>
  128.  
  129. <!--#Include File="Include/FrameworkTop2_inc.asp"-->
  130.  
  131. <table width="740" border="0" cellpadding="0" cellspacing="6" class="LightGrayBackgroundColor">
  132.     <tr>
  133.         <td width="1"></td>
  134.         <td width="738" align="left" valign="center" height="36" class="Normal">
  135.             <span class="H2HeadingStyle"><%=strPageTitle2%></span>
  136.         </td>
  137.         <td width="1"> </td>
  138.     </tr>
  139. </table>
  140. <table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td height="1" background="Resources/Images/ThinDivider.gif"></td></tr>
  141. <table border="0" cellpadding="0" cellspacing="6" width="740" class="WhiteBackgroundColor">
  142.     <tr>
  143.         <td width="1" rowspan="20"></td>
  144.         <td align="left" valign="top" class="Normal">
  145.             <br>
  146.             <%=strMessage%>
  147.             <br>
  148.             <br>
  149. <%
  150.             If CLng(Request.QueryString("Reason")) = SUR_ACCESS_DENIED_NOT_ADMIN_SECURITY_LEVEL Or CLng(Request.QueryString("Reason")) = SUR_ACCESS_DENIED_INVALID_SURVEY_ID Then
  151. %>                    
  152.         
  153.                 If you believe you received this message in error, please contact the application administrator:<br><br>
  154. <%
  155.             Else
  156. %>
  157.                 If you believe you received this message in error, please contact the survey adminstrator:<br><br>
  158. <%
  159.             End If
  160. %>            
  161.             <a href="mailto:<%=strAdminEmailAddress%>"><%=strAdminEmailAddress%></a>
  162.             <br>
  163.             <br>
  164.         </td>
  165.         <td width="1" rowspan="20"> </td>
  166.     </tr>
  167.     <tr>
  168.         <td align="right" valign="top" class="Normal">
  169. <%
  170.             'If the user is logged in and has "Admin" or "Create" security permissions, redirect to the list of 
  171.             'surveys to manage; if the error occurred on the template page, redirect to the main listof templates; 
  172.             'otherwise, redirect the list of surveys to take.
  173.             If CStr(Request.QueryString("Reason")) = CStr(SUR_ACCESS_DENIED_NOT_TEMPLATE_OWNER) Then
  174. %>                     
  175.                 <a href="TemplateList.asp"><img border="0" alt="Click to return to the template list" src="Resources/Buttons/OK.gif" name="btnOK"></a>
  176. <%
  177.             ElseIf IsLoggedIn() = True And (lngUserSecurityLevel = SUR_SECURITY_LEVEL_CREATE Or lngUserSecurityLevel = SUR_SECURITY_LEVEL_ADMIN) Then
  178. %>                     
  179.                 <a href="SurveyList.asp"><img border="0" alt="Click to return to the main survey list" src="Resources/Buttons/OK.gif" name="btnOK"></a>
  180. <%
  181.             Else
  182. %>                     
  183.                 <a href="<%=SUR_APPLICATION_DEFAULT_HOME_PAGE%>"><img border="0" alt="OK" src="Resources/Buttons/OK.gif" name="btnOK"></a>
  184. <%
  185.             End If
  186. %>                     
  187.         </td>
  188.     </tr>
  189. </table>
  190.  
  191. <!--#Include File="Include/FrameworkBottom_inc.asp"-->
  192.  
  193. </body>
  194. </html>
  195.  
  196. <%        
  197.     'Ensure that the web server returns the page
  198.     Response.Flush
  199. %>
  200.