[FX.php List] Authenticate via External Server

Chris Hansen chris at iViking.org
Thu Feb 28 09:53:44 MST 2008


Kevin,

Just use if/else.  If an FX Error Object is returned, you SHOULD NOT  
attempt to step through it with foreach().  Attempting to step through  
an object with foreach() results in a fatal error.  So, if login is  
successful, then work with the returned data; but if credentials fail  
(else), display an error with a login page.  One way to do this is to  
have your login page as an include, and then add an 'exit' after that  
so that nothing else is displayed.  Does that all make sense?

Best,

--Chris Hansen
   FileMaker 8 Certified Developer
   FileMaker 7 Certified Developer
   Creator of FX.php
   "The best way from FileMaker to the Web."
   www.iViking.org

On Feb 28, 2008, at 9:17 AM, Kevin Becker wrote:

> My company is switching to Active Directory for our local login  
> methods,
> and we are also looking to use those accounts to log into some of  
> our web
> sites that are using FX.php and FileMaker.
>
> I have been successful at making a web page where the user logs in  
> with an
> External Server account, but my problem is with how to handle when  
> their
> login fails.  As you would expect, I get the "Fatal error: Cannot use
> object of type FX_Error as array" message.  I searched the FX.php  
> archives
> and found how to use "if (FX::isError($Result)) { echo("<pre>\n");  
> etc..."
> to capture and display the error.
>
> Is there any way to allow the page to display as usual with an error
> message that their login failed?  You know, like every normal login  
> page
> works on the web... As it is, using  "if (FX::isError($Result)) {
> echo("<pre>\n"); etc..." will allow me to display an error message and
> nothing else. The fatal error prevents the normal page from loading.
>
> Kevin Becker
>
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
>





More information about the FX.php_List mailing list