Thank you for logging out. Please visit again soon query db SELECT FullName, Password FROM jobportal WHERE email = user xists error -----------------------questionscheck.cfm------------------------------------ SELECT * FROM jobportal WHERE email = The answer you have given is not correct. Please try again or regesitor. ss #getauthuser()# [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => Mattastic [ip] => webforumsuser@m [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 1 [islastshown] => [isfirstshown] => 1 [attachments] => [allattachments] => ) --> SELECT memID, memFirstName, memLastName, memUserName, memPassword, RoleName FROM Member WHERE memUserName = '#cflogin.name#' and memPassword = '#cflogin.password#' I don't know why I can't get it to work. Can someone tell me what I am doing wrong. I am trying to authenticate from a database. Please, Help!!!! Thank you for your response If you have a working code, can you email it to me? [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => cliffy2009 [ip] => webforumsuser@m [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 4 [islastshown] => [isfirstshown] => [attachments] => [allattachments] => ) --> cflogin - Macromedia ColdFusion

cflogin - Macromedia ColdFusion

Hi, I'm using cflogin to build a simple application. If a user forgets their password, then they get asked a security question and if they answer it correctly they get logged in and sent to index.cfm. The problem is when the user in logged with the questioncheck.cfm, the login promp keeps appearing when I use cflocation to send them back to the index page. I cant understand this as the user is logged in, I thought the code between the cflogin tags was ignored, therefore displaying the index.cfm Here is my code below, hope you can help -----------------------application.cfm------------------------------------ <CFSET DataSource ...

Sponsored Links
  1. #1

    Default cflogin

    Hi, I'm using cflogin to build a simple application. If a user forgets their
    password, then they get asked a security question and if they answer it
    correctly they get logged in and sent to index.cfm. The problem is when the
    user in logged with the questioncheck.cfm, the login promp keeps appearing when
    I use cflocation to send them back to the index page. I cant understand this
    as the user is logged in, I thought the code between the cflogin tags was
    ignored, therefore displaying the index.cfm Here is my code below, hope you
    can help

    -----------------------application.cfm------------------------------------

    <CFSET DataSource = "website">
    <cfset application.AdminEmail = "webmasterhalesowen.ac.uk">
    <!--- Name our app, and enable Session variables --->
    <CFAPPLICATION
    NAME="jobportal"
    SESSIONMANAGEMENT="Yes">
    <cfif IsDefined("URL.Logout")>
    <!--- Log out the user or CGI.script_name neq "/portal/registration.cfm"--->
    <cflogout>
    Thank you for logging out. Please visit again soon
    </cfif>
    <cflogin>
    <cfif CGI.script_name neq "/portal/registration.cfm">
    <cfif CGI.script_name neq "/portal/UserLoginForm.cfm" >
    <cfif CGI.script_name neq "/portal/questioncheck.cfm" >
    <cfif CGI.script_name neq "/portal/question.cfm" >
    <cfif not isdefined("email") or not isdefined("password") >
    <cfset URL.Message = "Please enter a username and a password">
    <CFINCLUDE TEMPLATE="UserLoginForm.cfm">
    <CFABORT>
    <!--- Otherwise, the user is submitting the login form --->
    <!--- This code decides whether the username and password are valid
    --->
    <cfelse>
    query db
    <CFQUERY NAME="GetUser" DATASOURCE="#DataSource#">
    SELECT FullName, Password FROM jobportal WHERE email =
    <cfqueryparam value="#email#" cfsqltype="CF_SQL_VARCHAR"
    maxlength="255">
    </CFQUERY>
    <CFIF GetUser.RecordCount EQ 1 and hash(password) eq
    GetUser.password>
    user xists
    <!--- Tell ColdFusion to consider the user "logged in" --->
    <!--- For the NAME attribute, we will provide the user's --->
    <!--- ContactID number and first name, separated by commas --->
    <!--- Later, we can access the NAME value via GetAuthUser() --->
    <CFLOGINUSER
    NAME="#GetUser.fullname#"
    PASSWORD="#Password#" roles="user">
    <!--- Otherwise, re-prompt for a valid username and password --->
    <CFELSE>
    error
    <cfset URL.Message = " Sorry, that username and password are not
    recognized.
    Please try again.">
    <CFINCLUDE TEMPLATE="UserLoginForm.cfm">
    <CFABORT>
    </CFIF>
    </cfif>
    </cfif>
    </cfif>
    </cfif>
    </cfif>
    </cflogin>
    -----------------------questionscheck.cfm------------------------------------
    <CFQUERY NAME="GetUser" DATASOURCE="#DataSource#">
    SELECT * FROM jobportal WHERE email =
    <cfqueryparam value="#email#" cfsqltype="CF_SQL_VARCHAR" maxlength="255">
    </CFQUERY>

    <CFIF GetUser.answer neq form.Answer>
    The answer you have given is not correct. Please try again or regesitor.
    <cfelse>ss
    <CFLOGINUSER
    NAME="#GetUser.fullname#" password="#GetUser.password#"
    roles="user">
    #getauthuser()#<cflocation url="index.cfm">
    </cfif>

    Sponsored Links
    Mattastic Guest

  2. #2

    Default cflogin

    I use <cflogin> tag to authenticate users on my application. After a user
    submit his information from the login form, I see the values for cflogin.name,
    cflogin.password, and a role from database query. Then I assign those values
    into <cfloginuser> tag.
    The problem is that when I use getAuthUser() and isUserInRole functions, I see
    nothing. Do you have any idea why I don't see anything from getAuthUser() and
    isUserInRole functions?

    <cfoutput>
    <cflogin>
    <cfif NOT ISDEFINED("cflogin")>
    <cfinclude template="/cmd/login/frm_login.cfm">
    <cfabort>
    </cfif>
    <cfif cflogin.name IS "" OR cflogin.password IS "">
    <cfinclude template="/cmd/login/frm_login.cfm">
    <cfabort>
    <cfelse>
    <cfinvoke component="cmd.cfc.appCFC" method="checkLogin"
    returnvariable="loginQuery">
    <cfinvokeargument name="login_id" value="#cflogin.name#"/>
    <cfinvokeargument name="password" value="#cflogin.password#"/>
    </cfinvoke>
    <cfif loginQuery.recordcount IS 1>
    <cfloginuser name="#cflogin.name#" Password = "#cflogin.password#"
    roles="#loginQuery.role#">

    <cfinclude template="/cmd/index.cfm">
    <cfabort>
    <cfelse>
    <cfinclude template="/cmd/login/frm_login.cfm">
    <cfabort>
    </cfif>
    </cfif>
    </cflogin>
    #getAuthUser()#<br>
    <cfif isUserInRole("rw")>rw role</cfif>
    </cfoutput>

    Choumphol Guest

  3. #3

    Default Re: cflogin

    I am having the same problem! I have found that if I refresh the page i then get my values in getAuthUser.

    Annoying me a great deal at the moment!
    Heapster Guest

  4. #4

    Default CFLOGIN

    Hey guys,
    I have been working on this all weekend and I can get the CFLOGIN to work.
    This is my code:
    <cfcomponent>

    <cffunction name="loginuser" access="remote" returntype="struct">
    <cfset var person = StructNew()>
    <cfset person.login = "false">
    <cfset person.name = "none">
    <cfset person.role= "none">

    <cflogin idletimeout="0"> <!---user will be logged out automatically after
    3 minutes of inactivity--->

    <cfif isDefined("cflogin.name") AND isDefined("cflogin.password")>

    <cfif cflogin.name EQ "admin" AND cflogin.password EQ "admin">

    <cfloginuser name="#cflogin.name#" password="#cflogin.password#"
    roles="admin">

    <cfset person.login = "true">
    <cfset person.role = "admin">

    </cfif>

    <cfif cflogin.name EQ "user" AND cflogin.password EQ "user">

    <cfloginuser name="#cflogin.name#" password="#cflogin.password#"
    roles="user">

    <cfset person.login = "true">
    <cfset person.role = "user">

    </cfif>


    <cfif person.login EQ "true">

    <cfset person.name = getPersonName(cflogin.name, cflogin.password)>

    </cfif>

    </cfif>

    </cflogin>

    <cfreturn person>

    </cffunction>

    <cffunction name="logoutuser" access="public">
    <cflogout>
    </cffunction>

    <cffunction name="getAdminData" access="public" roles="admin"
    returntype="string">
    <cfreturn "Some Secure Admin Data!">
    </cffunction>

    <cffunction name="getUserData" access="public" roles="user,admin"
    returntype="string">
    <cfreturn "Some Secure User Data">
    </cffunction>





    <cffunction name="getPersonName" access="private" returnType="String">

    <cfargument name="loginName" type="string" required="true">
    <cfargument name="password" type="string" required="true">

    <cfset personName = "none">

    <!---hard coded for now, TODO look up in database--->

    <CFQUERY NAME="qSecurity" DATASOURCE="Student_IS">
    SELECT memID, memFirstName, memLastName, memUserName, memPassword,
    RoleName FROM Member
    WHERE memUserName = '#cflogin.name#' and memPassword =
    '#cflogin.password#'</CFQUERY>
    <cfif qSecurity.recordCount EQ 1>
    <CFLOGINUSER NAME = "#cflogin.name#"
    PASSWORD = "#cflogin.password#"
    ROLES = "#trim(qSecurity.RoleName)#">
    </cfif>




    <!--- <cfif arguments.loginName EQ "admin" AND arguments.password EQ
    "admin">

    <cfset personName = "Bruce">


    <cfelseif arguments.loginName EQ "user" AND arguments.password EQ "user">

    <cfset personName = "Mary">

    </cfif>--->

    <cfreturn QSecurity>

    </cffunction>

    </cfcomponent>

    I don't know why I can't get it to work. Can someone tell me what I am doing
    wrong. I am trying to authenticate from a database. Please, Help!!!!

    Thank you for your response

    If you have a working code, can you email it to me?

    cliffy2009 Guest

  5. #5

    Default Re: CFLOGIN

    Can someone pls help me?
    cliffy2009 Guest

  6. #6

    Default Re: CFLOGIN

    Read this post:
    [url]http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=60&catid=585&threadid=1360 931&messageid=4952845[/url]
    mab_bond Guest

Similar Threads

  1. Using <cflogin>
    By ckainc in forum Coldfusion - Getting Started
    Replies: 1
    Last Post: June 22nd, 01:35 PM
  2. cflogin problem
    By prabin_sh in forum Coldfusion - Advanced Techniques
    Replies: 4
    Last Post: May 11th, 04:36 PM
  3. Doesn't ANYBODY know anything about cflogin???
    By nckgb in forum Coldfusion - Getting Started
    Replies: 8
    Last Post: March 24th, 06:51 PM
  4. cflogin confusion
    By nckgb in forum Macromedia ColdFusion
    Replies: 2
    Last Post: March 18th, 07:08 PM
  5. cflogin HELP
    By nckgb in forum Coldfusion - Getting Started
    Replies: 0
    Last Post: March 15th, 03:00 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •