Reply to topic
Problem with User Authentication
good0dog


Joined: 18 Nov 2006
Posts: 2
Reply with quote
Okay, just starting out and I can't jump the first hurdle. I following several tutorials and books but run into a wall. My login should be working, but isn't. Guess I missed something.

I have a phpbb up and running. I decide to restrict other sections of the site by a standard login page using coldfusion. I'm trying to use the phpbb database for authentication: username, user_password, so users have only one name/password, even if they have to use it twice.

DSN and mysql database have been verified to work by running live CF queries. Application.cfm was written and added to site. Dreamweaver reconizes the database, and the login in server behavior.

The Login always fails and sends me to my failed login page. I have enabled debugging, but since the cf sends me to the failed page if there a problem, it works properly. So I verified that my username/password combo was correct, which it was. Added my own password field to the database, to see if there was an encryption problem, but no effect. And refreshed everthing to no avail.

Any suggestions would be welcome!
Jason101
Forum Regular

Joined: 14 Mar 2006
Posts: 550
Location: Harrisburg, PA
Reply with quote
Hello,

Sorry to hear about your problems. Don't use Dreamwaver's login server behavior. I love Dreamweaver, but tend to stay away from their built in behaviors because of the sometimes cumbersome and troublesome code.

CF Security can sometimes be tricky. A good tutorial with excellent documentation and source files can be found here: (This will only work for Coldfusion 7!)

http://www.trajiklyhip.com/tutorials/loginSecurityCF7/index.cfm

I've used this many times and it works great. I had to modify it to suite my needs but I think it will be a good solution for you out of the box. It comes complete with the database and source files. However, you can modify the SQL to accommodate your existing MySQL table structure. If you continue to have a problem, post your code here and I'll have a look at it.

Good Luck! Very Happy
Login Turtorial
good0dog


Joined: 18 Nov 2006
Posts: 2
Reply with quote
Jason,

Thanks for the help. I've downloaded the files and will start walking through the tutorial. One question, my DSN uses a username and password. I would like to use the Request.DSN function. I have tried to use variations to input the two variables, ie

<cfset Request.DSN=' "DSNname" username="xxxxx" password="yyyyy" '>

single quoting the entire string, but to no effect. I wrote my login pages without using the Request.DSN function to elimenate it as a source of the problem, but would like to use it in the future.

Anyways I have a new tutorial to work through. I haven't played with .cfc's yet. Always something new!!! Thanks again! Matt
Jason101
Forum Regular

Joined: 14 Mar 2006
Posts: 550
Location: Harrisburg, PA
Reply with quote
what you need to do is, in the "On Request Start" function of the Application.cfc you would do the following:


Code:

<cffunction name="onRequestStart" returntype="boolean">
   <!--- Set up request variables here. --->
   <cfset Request.DataSource = "CMS">
   <cfset Request.DBUserName = "">
   <cfset Request.DBPassword = "">
      

</cffunction>



And then, for all of your queries:

Code:

<cfquery name="GetPage" datasource="#Request.DataSource#" username="#Request.DBUserName#" password="#Request.DBPassword#">

SQL HERE

</cfquery>


Give that a shot!
Problem with User Authentication
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 1 of 1  

  
  
 Reply to topic