Guest User

Untitled

a guest
Sep 8th, 2018
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. Change the Session Variable Output
  2. <cfif IsDefined("FORM.username")>
  3. <cfset MM_redirectLoginSuccess="members_page.cfm">
  4. <cfset MM_redirectLoginFailed="sorry.cfm">
  5. <cfquery name="MM_rsUser" datasource="Access">
  6. SELECT FullName, Username,Password,AccessLevels FROM Logininfo WHERE Username=<cfqueryparam value="#FORM.username#" cfsqltype="cf_sql_clob" maxlength="50"> AND Password=<cfqueryparam value="#FORM.password#" cfsqltype="cf_sql_clob" maxlength="50">
  7. </cfquery>
  8. <cfif MM_rsUser.RecordCount NEQ 0>
  9. <cftry>
  10. <cflock scope="Session" timeout="30" type="Exclusive">
  11. <cfset Session.MM_Username=FORM.username>
  12. <cfset Session.MM_UserAuthorization=MM_rsUser.AccessLevels[1]>
  13. </cflock>
  14. <cfif IsDefined("URL.accessdenied") AND false>
  15. <cfset MM_redirectLoginSuccess=URL.accessdenied>
  16. </cfif>
  17. <cflocation url="#MM_redirectLoginSuccess#" addtoken="no">
  18. <cfcatch type="Lock">
  19. <!--- code for handling timeout of cflock --->
  20. </cfcatch>
  21. </cftry>
  22. </cfif>
  23. <cflocation url="#MM_redirectLoginFailed#" addtoken="no">
  24. <cfelse>
  25. <cfset MM_LoginAction=CGI.SCRIPT_NAME>
  26. <cfif CGI.QUERY_STRING NEQ "">
  27. <cfset MM_LoginAction=MM_LoginAction & "?" & XMLFormat(CGI.QUERY_STRING)>
  28. </cfif>
  29. </cfif>
  30.  
  31. <cflock scope="Session" timeout="30" type="Exclusive">
  32. <cfset Session.MM_Username=FORM.username>
  33. <cfset Session.MM_UserAuthorization=MM_rsUser.AccessLevels[1]>
  34. <cfset Session.FullName=MM_rsUser.FullName[1]>
  35. </cflock>
Add Comment
Please, Sign In to add comment