[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 394
  • Last Modified:

User Authentication variable problem DW8 ASP VB

Hi

Can anyone see why I keep getting this error message, when it seems that the variable IS defined as "Admin":

Error Type:
Microsoft VBScript runtime (0x800A01F4)
Variable is undefined: 'MM_authorizedUsers'
/MR07test/admin/add_product.asp, line 7

The code is:

<%
' *** Restrict Access To Page: Grant or deny access to this page
MM_authorizedUsers="Admin"
MM_authFailedURL="failed_login.asp"
MM_grantAccess=false
If Session("MM_Username") <> "" Then
  If (false Or CStr(Session("MM_UserAuthorization"))="") Or _
         (InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization"))>=1) Then
    MM_grantAccess = true
  End If
End If
If Not MM_grantAccess Then
  MM_qsChar = "?"
  If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&"
  MM_referrer = Request.ServerVariables("URL")
  if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" & Request.QueryString()
  MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" & Server.URLEncode(MM_referrer)
  Response.Redirect(MM_authFailedURL)
End If
%>

I have tried this several times but getting nowhere

Thanks

Dave
0
swordfishsoup
Asked:
swordfishsoup
  • 2
1 Solution
 
GawaiCommented:
i guess you have set
Option Explicit
on top of page

so define all variable befor you use them
Dim MM_authorizedUsers, MM_authFailedURL
so on


 and later you can use them
0
 
swordfishsoupAuthor Commented:
You guessed good!

Thanks very much for your help

Have a good evening

Dave
0
 
GawaiCommented:
u r alway welcome :)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now