This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Dreamweaver > July 2005 > Login with redirect (ASP) - Still need help with Select Case - Murray or Lionstone!!





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Login with redirect (ASP) - Still need help with Select Case - Murray or Lionstone!!
Wally Kolcz

2005-07-29, 11:18 pm

What is wrong with this? I tried to use the Case method to do a redirect
and it give me an error on this line:
set MM_rsUser = Server.CreateObject(MM_flag)

The error is:
Server object error 'ASP 0177 : 80004005'
Server.CreateObject Failed


I know I am missing something here, please help!

Here is the code how it stands.
<%
' *** Validate request to log in to this site.
MM_LoginAction = Request.ServerVariables("URL")
If Request.QueryString<>"" Then MM_LoginAction = MM_LoginAction + "?" +
Server.HTMLEncode(Request.QueryString)
MM_valUsername=CStr(Request.Form("username"))
If MM_valUsername <> "" Then
MM_fldUserAuthorization="priv"
MM_redirectLogin1Success="../membersarea/index.asp"
set MM_rsUser = Server.CreateObject(MM_flag)
MM_rsUser.ActiveConnection = MM_projectproofing_STRING
MM_rsUser.Source = "SELECT username, password"
If MM_fldUserAuthorization <> "" Then MM_rsUser.Source = MM_rsUser.Source
& "," & MM_fldUserAuthorization
MM_rsUser.Source = MM_rsUser.Source & " FROM projectproofing.members
WHERE
username='" & Replace(MM_valUsername,"'","''") &"' AND password='" &
Replace(Request.Form("password"),"'","''") & "'"
MM_rsUser.CursorType = 0
MM_rsUser.CursorLocation = 2
MM_rsUser.LockType = 3
MM_rsUser.Open
If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then
' username and password match - this is a valid user
Session("MM_Username") = MM_valUsername
If (MM_fldUserAuthorization <> "") Then
Session("MM_UserAuthorization") =
CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value)
Else
Session("MM_UserAuthorization") = ""
End If
if CStr(Request.QueryString("accessdenied")) <> "" And false Then
MM_redirectLoginSuccess = Request.QueryString("accessdenied")
End If
MM_rsUser.Close
Select Case [priv]
Case [value "user"]
Response.Redirect("../users/index.asp")
Case [value "subuser"]
Response.Redirect("../contribute/index.asp")
Case Else
Response.Redirect("../membersarea/index.asp")
End Select
MM_rsUser.Close
Response.Redirect(MM_redirectLoginFailed)
End If
End If

%>





Gary White

2005-07-30, 7:20 pm

Wally Kolcz wrote:

> set MM_rsUser = Server.CreateObject(MM_flag)



I rarely ever do ASP, but there is nothing in the code preceding that line
that assigns a value to the MM_flag variable. What is it you're trying to
create?


Gary
Wally Kolcz

2005-07-30, 7:22 pm

That is stock DW login code. I need to know how to split the successful
login destination based on the priv


J.S. \(UltraSuite\)

2005-07-30, 7:22 pm

I am Murray or Lionstone otherwise I would have tried to answer. :)

--
____________________________________________________________________
UltraSuite Extension Packages: http://www.ultrasuite.com/
The *most popular* Suites of DMX 2004 and DMX Server Behaviors
for ASP, ASP.Net, ColdFusion, JSP, and PHP_MySQL
____________________________________________________________________


Murray *TMM*

2005-07-30, 7:22 pm

You are? <looking at driver's license> 8)

Oh, then you must be Lionstone....

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"J.S. (UltraSuite)" <ultrasuite@nospam.com> wrote in message
news:dcg5kg$abs$1@forums.macromedia.com...
>I am Murray or Lionstone otherwise I would have tried to answer. :)
>
> --
> ____________________________________________________________________
> UltraSuite Extension Packages: http://www.ultrasuite.com/
> The *most popular* Suites of DMX 2004 and DMX Server Behaviors
> for ASP, ASP.Net, ColdFusion, JSP, and PHP_MySQL
> ____________________________________________________________________
>



Wally Kolcz

2005-07-30, 7:22 pm

Ok, now I am lost. Ok posted below is a WORKING, stock DW login code. I dont
see that line in it anywhere.

All I wanted to do is add 3 if./then or Case statements that check the
column 'priv' and say that if the login is successful and the
priv = "member" then go to ../membersarea/index.asp
priv = "user" then go to ../userarea/index.asp
priv = "subuser" then go to ../contribute/index.asp

Any ideas? Anyone know how to do that? Is there an extention that I can
buy.....

Working DW Code:
<%
' *** Validate request to log in to this site.
MM_LoginAction = Request.ServerVariables("URL")
If Request.QueryString<>"" Then MM_LoginAction = MM_LoginAction + "?" +
Server.HTMLEncode(Request.QueryString)
MM_valUsername=CStr(Request.Form("username"))
If MM_valUsername <> "" Then
MM_fldUserAuthorization="priv"
MM_redirectLoginSuccess="../membersarea/index.asp"
MM_redirectLoginFailed="index.asp?login=failed"
MM_flag="ADODB.Recordset"
set MM_rsUser = Server.CreateObject(MM_flag)
MM_rsUser.ActiveConnection = MM_projectproofing_STRING
MM_rsUser.Source = "SELECT username, password"
If MM_fldUserAuthorization <> "" Then MM_rsUser.Source = MM_rsUser.Source
& "," & MM_fldUserAuthorization
MM_rsUser.Source = MM_rsUser.Source & " FROM projectproofing.members WHERE
username='" & Replace(MM_valUsername,"'","''") &"' AND password='" &
Replace(Request.Form("password"),"'","''") & "'"
MM_rsUser.CursorType = 0
MM_rsUser.CursorLocation = 2
MM_rsUser.LockType = 3
MM_rsUser.Open
If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then
' username and password match - this is a valid user
Session("MM_Username") = MM_valUsername
If (MM_fldUserAuthorization <> "") Then
Session("MM_UserAuthorization") =
CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value)
Else
Session("MM_UserAuthorization") = ""
End If
if CStr(Request.QueryString("accessdenied")) <> "" And false Then
MM_redirectLoginSuccess = Request.QueryString("accessdenied")
End If
MM_rsUser.Close
Session.Timeout=60
Response.Redirect(MM_redirectLoginSuccess)
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginFailed)
End If
%>


J.S. \(UltraSuite\)

2005-07-30, 7:25 pm

"Murray *TMM*" <forums@HAHAgreat-web-sights.com> wrote in message
news:dcg5pb$ago$1@forums.macromedia.com...
> You are? <looking at driver's license> 8)


LOL :-) I meant I am "not" Murray or Lionstone. :)


J.S. \(UltraSuite\)

2005-07-30, 7:25 pm

I have login extensions that would do this.

--
____________________________________________________________________
UltraSuite Extension Packages: http://www.ultrasuite.com/
The *most popular* Suites of DMX 2004 and DMX Server Behaviors
for ASP, ASP.Net, ColdFusion, JSP, and PHP_MySQL
____________________________________________________________________


Wally Kolcz

2005-07-30, 7:26 pm

UltraLogin?


J.S. \(UltraSuite\)

2005-07-30, 11:14 pm

If you are using ASP/VBScript then there is a Security module in the latest
version (7.5)
http://www.ultrasuite.com/default.a...suite_75_aspvbs

If you need to modify it a little bit to get it working exactly as you want
for this purpose, I'll help you out.

--
____________________________________________________________________
UltraSuite Extension Packages: http://www.ultrasuite.com/
The *most popular* Suites of DMX 2004 and DMX Server Behaviors
for ASP, ASP.Net, ColdFusion, JSP, and PHP_MySQL
____________________________________________________________________


Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews