It works! 

:)

It was shownig a white page, I think, because of the use of Iframes on
the website.

The index.cfm page contains about three iframes that each load a
different .cfm page.

The login.cfm page was not a page containing Iframes and opened all on
its own, and not within any of the other pages.

I am thinking that the use of Iframes messed up Coldfusion's
..uhh...Page Flow from application.cfm to index.cfm which would normally
have occurred?

Anyways..once I stuck a Window.location = 'index.cfm' right after the
CFLOGINUSER statement, it displays a white page for a second...then
redirects to index.cfm 

I would be happier if it never displayed the white page...but say what
:-\

And although I got it to behave the way I wanted it to..I STILL do not
understand why I am seeing that white page in the first place since this
is CFINCLUDEd in the application.cfm file

Here's the final forceduserlogin.cfm:
<CFLOGIN>
  
  <!--- If the user hasn't gotten the login form yet, display it --->  
  <CFIF NOT (IsDefined("FORM.Username") AND IsDefined("FORM.password"))>
    <CFINCLUDE TEMPLATE="Login.cfm">
    <CFABORT> 

  <CFELSE>     
        
    <!--- Find record with this Username/Password --->
    <!--- If no rows returned, password not valid --->
    <CFQUERY NAME="GetUser" DATASOURCE="#application.dsn#">
      SELECT userid,username,fname,lname, roles
      FROM tblusers 
      WHERE Username = '#Form.username#'
        AND Password = '#Form.password#'
    </CFQUERY>
    
    <!--- If the username and password are correct... --->
    <CFIF GetUser.RecordCount EQ 1>
        
       <CFLOGINUSER NAME="#GetUser.userid#" PASSWORD="#FORM.Password#"
ROLES="#GetUser.Roles#">        

                <!--- Update user table lastlogin field with current
date and time --->       
                <CFSET form.lastlogin = #Now()#>
                <cfset form.userid = #getuser.userid#>
                
                <CFUPDATE datasource="#application.dsn#"
tablename="tblusers" formfields="userid,Lastlogin">
                        
                <script language="javascript">

                        window.location='index.cfm';

                </script>
                
                <!--- Otherwise, re-prompt for a valid username and
password --->
    <CFELSE>    
      Sorry, that username and password are not recognized.
      Please try again.
      <CFINCLUDE TEMPLATE="Login.cfm">
      <CFABORT>
    </CFIF>


  </CFIF>  
</CFLOGIN>

-Gel


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=5
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=5

This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
http://www.cfhosting.com

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.5
                                

Reply via email to