|
[x]
Posted via EE Mobile
|
||
Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
||
| Question |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: |
APPLICATION.CFC
<cfcomponent output="no">
<cfset this.name="Frederico">
<cfset this.sessionManagement="true">
<cffunction name="onApplicationStart" output="false" returnType="void">
<cfset APPLICATION.datasource = "salons">
<cfset APPLICATION.companyName = "Frederico Beauty Institute">
<cfset sessionTimeout = #CreateTimeSpan(0, 0, 01, 0)#>
<cfif not isDefined("SESSION.auth.isLoggedIn")>
<cfif isDefined("FORM.userLogin")>
<cfinclude template="admin_LoginCheck.cfm">
</cfif>
<cfinclude template="index.cfm">
<cfabort>
</cfif>
</cffunction>
</cfcomponent>
ADMIN_LOGINCHECK.CFM
<!--- Begin Login Script --->
<cflogin idletimeout="1800">
<cfif CGI.QUERY_STRING IS "">
<cfset FormAction = #CGI.SCRIPT_NAME#>
<!--- IF there IS a Query String passed in the URL, it is added to the requested page name. --->
<cfelse>
<cfset FormAction = "#CGI.SCRIPT_NAME#?#CGI.QUERY_STRING#">
</cfif>
<!--- IF the Username and Password are not present, then the user has not logged in and the login form is displayed and all further processing stops. --->
<cfif NOT (IsDefined ("Form.UserLogin") AND IsDefined ("Form.UserPassword"))>
<cfinclude template="index.cfm">
<cfabort>
<!--- Else, If the username and password ARE present, the login is processed. --->
<cfelse>
<!---Check For super user --->
<CFQUERY NAME="loginsuper" DATASOURCE="salons">
SELECT *
FROM superuser
WHERE (superuname = <cfqueryparam value="#Form.UserLogin#" cfsqltype="CF_SQL_VARCHAR">
AND superpword = <cfqueryparam value="#Form.UserPassword#" cfsqltype="CF_SQL_VARCHAR">)
</CFQUERY>
</cfif>
<cfset comparison = Compare(FORM.UserLogin, loginsuper.superuname)>
<cfif comparison eq 0>
<cfset comparison = Compare(FORM.UserPassword, loginsuper.superpword)>
</cfif>
<cfif comparison eq 0>
<!--- IF there was a matching login record, the user is logged in --->
<cfif loginsuper.RecordCount EQ '1'>
</cfif>
<cfloginuser name="#loginsuper.userID#" password="#Form.UserPassword#" roles="#trim(loginsuper.role)#">
<cfset userID = ListFirst(GetAuthUser())>
<cfset SESSION.auth = structNew()>
<cfset SESSION.auth.isLoggedIn = "Yes">
<cfset SESSION.auth.userID = loginsuper.userID>
<cfif loginsuper.userID EQ "1">
<cflocation url="admin/admin_main.cfm?userID=#login.userID#">
</cfif>
<cfelse>
<!--- Query gets the information from the database matching the login provided. --->
<CFQUERY NAME="login" DATASOURCE="salons">
SELECT *
FROM users
WHERE (db_username = <cfqueryparam value="#Form.UserLogin#" cfsqltype="CF_SQL_VARCHAR">
AND db_userpword = <cfqueryparam value="#Form.UserPassword#" cfsqltype="CF_SQL_VARCHAR">)
</CFQUERY>
<cfset comparison = Compare(FORM.UserLogin, login.db_username)>
<cfif comparison eq 0>
<cfset comparison = Compare(FORM.UserPassword, login.db_userpword)>
</cfif>
<cfif comparison eq 0>
<!--- IF there was a matching login record, the user is logged in --->
<cfif login.RecordCount EQ '1'>
</cfif>
<cfloginuser name="#login.userID#" password="#Form.UserPassword#" roles="#trim(login.role)#">
<cfset userID = ListFirst(GetAuthUser())>
<cfset SESSION.auth = structNew()>
<cfset SESSION.auth.isLoggedIn = "Yes">
<cfset SESSION.auth.userID = login.userID>
<cfif login.userID EQ "1">
<cflocation url="admin/admin_main.cfm?userID=#login.userID#">
<cfelse>
<cflocation url="admin/admin_edit.cfm?userID=#login.userID#&salonID=#login.userID#">
</cfif>
<!--- IF there WAS NOT a matching record, an "Invalid Login" message is shown and the user is prompted to login again. --->
<cfelse>
<!--- Creates the Variable "Invalid" to instruct Login page to display "Invalid Login" Message. --->
<cfset Invalid = "Yes">
<cfinclude template="index.cfm">
<cfabort>
</cfif>
</cfif>
</cflogin>
|
Advertisement
| Hall of Fame |