[FX.php List] Authenticate via External Server
Kevin Becker
kbecker at treca.org
Thu Feb 28 11:04:09 MST 2008
Thanks Chris,
It made perfect sense and all is well. I also had to move
"$errorCode=$Result['errorCode'];" inside the IF statement in case others
here are learning from my mistakes.
Kevin Becker
fx.php_list at mail.iviking.org on Thursday, February 28, 2008 at 12:10 PM
-0500 wrote:
>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
>> 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
More information about the FX.php_List
mailing list