Forum - Beitrag anzeigen

CF-Basics - RE: application.cfm

Icon Pfeil Startseite Icon Pfeil Kategorie Icon Pfeil Suche

Icon Forum Beitrag vom 16.11.2001 10:41 (388 Aufrufe)
Name: Claus
Titel: RE: application.cfm
Inhalt:
Nicht alles vertauschen die eine Version geht so :

------------------------------------
Application.cfm
------------------------------------

<CFSETTING ENABLECFOUTPUTONLY="yes">

<cfapplication name="myApp"
sessionmanagement="yes"
sessiontimeout="#CreateTimeSpan(0,0,0,10)#">

<cfif NOT IsDefined("Session.LoggedIn")>
<cflocation url="../login.cfm">
</cfif>

<CFSETTING ENABLECFOUTPUTONLY="No">


---------------------
login_action.cfm
--------------------

<html>
<head>
<title>xxx</title>
</head>
<body bgcolor="00005a" text="dedede" link="00cc00" alink="009900" vlink="009900" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<CFQUERY NAME="user_login" DATASOURCE="mvbdb">
SELECT * Count(*) AS Login_Match
FROM Mitarbeiter
WHERE Benutzername = '#form.bn#' AND Passwort = '#form.pw#'
</CFQUERY>

<cfif user_Login.Login_Match IS "0">
<!---Wenn Passwort falsch --->
<cflocation url="pass_falsch.cfm" addtoken="No">



<cfelse>
<cfoutput>
<cfset Session.LoggedIn ="1">
<!--- Wenn Passwort richtig ist dann gehts dort hin --->
<cflocation url="../Intranet.cfm?log=#log_id.gastro_id#" addtoken="No"> (eigene URL)
</cfoutput>
</cfif>


Die Zweite Version geht so :

Der unterschied die Session Variable wir nach dem Login vergeben

---------------------
Application cfm
---------------------

<CFAPPLICATION NAME="HRApp"
SESSIONMANAGEMENT="Yes"
SETCLIENTCOOKIES="Yes">

-----------------------
login_action.cfm
-----------------------



<!--- If we didn't come from the login page, send the user there --->
<CFIF NOT IsDefined("Form.Login") OR NOT IsDefined("Form.Password")>
<CFLOCATION URL="login.cfm">
</CFIF>

<!----------------------------------------------------------
Lookup the login in the database,
---------------------------------------------------------->
<CFQUERY NAME="IsValidLogin" DATASOURCE="#DSN#">
SELECT Employees.Employee_ID, Employees.FirstName, Employees.Department_ID
FROM Employees
WHERE Employees.FirstName = '#Form.Login#'
AND Employees.LastName = '#Form.Password#'
</CFQUERY>
<!---If it was an invalid login, send them back to the login page --->

<CFIF IsValidLogin.RecordCount IS "0">
<CFLOCATION URL="login.cfm">
</cfif>

<!---Otherwise setup personalization parameters and send the user on --->

<!-------------------------------------------
set Session variables
-------------------------------------------->
<CFSCRIPT>
Session.Employee_ID = IsValidLogin.Employee_ID;
Session.FirstName = IsValidLogin.FirstName;
Session.Department_ID = IsValidLogin.Department_ID;
</CFSCRIPT>

<!---Go to the home page --->
<CFLOCATION URL="../index.cfm">

Entweder das eine oder das andere

Gruß
Claus



Antworten
Icon Forum application.cfm (kall, 15.11.2001 14:40)
   Icon Forum RE: application.cfm (frank26, 15.11.2001 14:50)
     Icon Forum RE: application.cfm (kall, 15.11.2001 15:09)
       Icon Forum RE: application.cfm (frank26, 15.11.2001 15:31)
         Icon Forum RE: application.cfm (kall, 15.11.2001 15:58)
           Icon Forum RE: application.cfm (frank26, 15.11.2001 16:24)
             Icon Forum RE: application.cfm (kall, 15.11.2001 16:43)
             Icon Forum RE: application.cfm (Claus, 15.11.2001 16:43)
               Icon Forum RE: application.cfm (kall, 15.11.2001 17:26)
                 Icon Forum RE: application.cfm (Claus, 15.11.2001 18:36)
                   Icon Forum RE: application.cfm (kall, 16.11.2001 10:16)
                     Icon Forum RE: application.cfm (Claus, 16.11.2001 10:41)
                       Icon Forum RE: application.cfm (kall, 16.11.2001 11:34)
                         Icon Forum RE: application.cfm (Claus, 16.11.2001 11:51)
                           Icon Forum RE: application.cfm (kall, 16.11.2001 12:15)
                             Icon Forum RE: application.cfm (Claus, 16.11.2001 12:26)
                               Icon Forum RE: application.cfm (kall, 16.11.2001 13:38)
                                 Icon Forum RE: application.cfm (Claus, 16.11.2001 14:17)
                                   Icon Forum RE: application.cfm (kall, 16.11.2001 14:28)
                                     Icon Forum RE: application.cfm (Claus, 16.11.2001 14:35)
   Icon Forum RE: application.cfm (martin janssen, 15.11.2001 16:20)
     Icon Forum RE: application.cfm (kall, 15.11.2001 16:22)
   Icon Forum RE: application.cfm (martin janssen, 16.11.2001 11:30)

Bitte melden Sie sich kostenlos an, um eine Antwort auf diesen Beitrag zu erstellen.


Das deutsche ColdFusion-Forum cfml.de ist das Portal für Einsteiger und Experten zum Thema ColdFusion und der ColdFusion Markup Language (CFML).

© 2017 Webdesign & Hosting: CHC ONLINE Kassel | SOLVA Content-Management-System CMS
Urlaub-Angebote.de - Urlaub mit Bestpreis-Garantie buchen