473,395 Members | 1,647 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Manipulating the Dreamweaver Login Behaviour

Hi Guys,

I'm using dreamweavers login behaviour to log people in, I've managed to
manipulate it a little as I have many sites using the same database, but I'd
like to manipulate it a little more, the behaviour so far is -

<%
' *** 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
Dim MM_fldUserAuthorization
Dim MM_redirectLoginSuccess
Dim MM_redirectLoginFailed
Dim MM_loginSQL
Dim MM_rsUser
Dim MM_rsUser_cmd

MM_fldUserAuthorization = "JBACASiteID"
MM_redirectLoginSuccess = "jobseeker/afterlogin.asp"
MM_redirectLoginFailed = "jobseeker/PasswordRequest.asp"

MM_loginSQL = "SELECT JBACAUsername, JBACAPassword, JBACASiteID"
If MM_fldUserAuthorization <"" Then MM_loginSQL = MM_loginSQL & "," &
MM_fldUserAuthorization
MM_loginSQL = MM_loginSQL & " FROM dbo.JBACandidate WHERE JBACAUsername =
? AND JBACAPassword = ? AND JBACASiteID = '31'"
Set MM_rsUser_cmd = Server.CreateObject ("ADODB.Command")
MM_rsUser_cmd.ActiveConnection = MM_recruta2_STRING
MM_rsUser_cmd.CommandText = MM_loginSQL
MM_rsUser_cmd.Parameters.Append MM_rsUser_cmd.CreateParameter("param1",
200, 1, 50, MM_valUsername) ' adVarChar
MM_rsUser_cmd.Parameters.Append MM_rsUser_cmd.CreateParameter("param2",
200, 1, 50, Request.Form("password")) ' adVarChar
MM_rsUser_cmd.Prepared = true
Set MM_rsUser = MM_rsUser_cmd.Execute

If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then
' username and password match - this is a valid user
Session("JOBSEEKERID") = MM_valUsername
If (MM_fldUserAuthorization <"") Then
Session("SITEID") =
CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization ).Value)
Else
Session("SITEID") = ""
End If
if CStr(Request.QueryString("accessdenied")) <"" And false Then
MM_redirectLoginSuccess = Request.QueryString("accessdenied")
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginSuccess)
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginFailed)
End If
%>

You will see that at the moment I am selecting the following from the
database, JBACAUsername, JBACAPassword, JBACASiteID and producing the
following Sessions - Session("JOBSEEKERID") Session("SITEID") I'm then
sending the browser to an afterlogin page, where I produce a recordset based
on the two sessions -

<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "0"
If (Session("JOBSEEKERID") <"") Then
Recordset1__MMColParam = Session("JOBSEEKERID")
End If
%>
<%
Dim Recordset1__MMColParam2
Recordset1__MMColParam2 = "0"
If (Session("SITEID") <"") Then
Recordset1__MMColParam2 = Session("SITEID")
End If
%>
<%
Dim Recordset1
Dim Recordset1_cmd
Dim Recordset1_numRows

Set Recordset1_cmd = Server.CreateObject ("ADODB.Command")
Recordset1_cmd.ActiveConnection = MM_recruta2_STRING
Recordset1_cmd.CommandText = "SELECT JBACASiteID, JBACAUsername, JBACAName,
JBACAID FROM dbo.JBACandidate WHERE JBACAUsername = ? AND JBACASiteID = ?"
Recordset1_cmd.Prepared = true
Recordset1_cmd.Parameters.Append Recordset1_cmd.CreateParameter("param1",
200, 1, 255, Recordset1__MMColParam) ' adVarChar
Recordset1_cmd.Parameters.Append Recordset1_cmd.CreateParameter("param2", 5,
1, -1, Recordset1__MMColParam2) ' adDouble

Set Recordset1 = Recordset1_cmd.Execute
Recordset1_numRows = 0
%>

This recordset is querying the same table that was queried for the login.
Following this i create the following sessions -

<%Session("JOBSEEKERNAME") = Recordset1.Fields.Item("JBACAName").Value%>
<%Session("CANDID") = Recordset1.Fields.Item("JBACAID").Value%>

What I would like to do, is get all of this information in one go, rather
than having to use an afterlogin page,.. is this possible?

Many thanks
Jul 4 '08 #1
2 2653
This line in the login code:

MM_loginSQL = "SELECT JBACAUsername, JBACAPassword, JBACASiteID"

Change to

MM_loginSQL = "SELECT JBACAUsername, JBACAPassword, JBACASiteID,
JBACAName, JBACAID"

Then where it says this:

If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then
' username and password match - this is a valid user
Session("JOBSEEKERID") = MM_valUsername

Add
Session("JOBSEEKERNAME") = MM_rsUser.Fields.Item("JBACAName").Value
Session("CANDID") = MM_rsUser.Fields.Item("JBACAID").Value

Dooza
Jul 4 '08 #2
Thank you

"Dooza" wrote:
This line in the login code:

MM_loginSQL = "SELECT JBACAUsername, JBACAPassword, JBACASiteID"

Change to

MM_loginSQL = "SELECT JBACAUsername, JBACAPassword, JBACASiteID,
JBACAName, JBACAID"

Then where it says this:

If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then
' username and password match - this is a valid user
Session("JOBSEEKERID") = MM_valUsername

Add
Session("JOBSEEKERNAME") = MM_rsUser.Fields.Item("JBACAName").Value
Session("CANDID") = MM_rsUser.Fields.Item("JBACAID").Value

Dooza
Jul 4 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: middletree | last post by:
I've been doing ASP by hand-coding in either Homesite or Interdev for years. I have been using Dreamwever for static sites that I make on the side. I recently was asked to make a form which will...
3
by: Tom B | last post by:
I've finally got a helper, so I set up VSS. My Interdev works fine, but he can't seem to use dreamweaver. The files open ok, and they save to VSS, but don't show up on the site. Is there...
1
by: John | last post by:
Hello, I'm working with Dreamweaver MX and we started to develop our website with Javascript too. However, unlike "Eclipse" for Java developement I don't have the support for Javascript code...
5
by: I.P. Freely | last post by:
Hi, I've been using Visual Studio.NET for a while to design WinForms and Console apps and love it. Recently I had to a WebForms app. Because I have no artistic skill whatsoever, I enlisted the...
2
by: robert | last post by:
I've made a gallery site for an artist and it works well -- the gallery page has a central large image which is swapped when thumbnail images are clicked. I'm using Dreamweaver's "SwapImage"...
14
by: clintonG | last post by:
This is an appeal for peer support sent to Microsoft as will be noted in closing. The Login control does not include a Cancel button. The only option is to convert the Login control to a...
4
by: cool84 | last post by:
neeeed help. i want help how to use session in the dreamweaver. I have 2 form. first is the login form and the second is welcome user page. I want the login user page appear at the welcome user...
4
by: bombsquadxi | last post by:
can some1 plz help me I am following a dreamwear guide in adding a login and register page for ASP, however i just dont seem to have the option to insert a record set, anybody got any...
2
by: jmartmem | last post by:
Greetings, I have an ASP page that contains a form (form_login) with a Log In User server behavior. I used Dreamweaver CS3 to design the page. What I want to do upon a user's log in is to populate...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.