× Joomla Facebook Connect support forum

Topic-icon JFBC forwarding to a php

Active Subscriptions:

None
11 years 5 months ago #28202 by dididounet
Hi
Got a strange problem with aJFBC login : I forward to an article with a php script on it stating this:
if($lastvisitdate == "0000-00-00 00:00:00" && substr($username,0,3) != "fb_"){
header("Location: /reset-password");
} else {

so I want the other users to reset the password but facebook users to continue.
Now when someone logs in with facebook, I get a server error
Server error
The website encountered an error while retrieving www.soslostpets.com/index.php?option=com...WVu&cb=1354211844233. It may be down for maintenance or configured incorrectly.
Here are some suggestions:
Reload this webpage later.
HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.
clicking on reload I go ahead and it works fine, but I try to understand why I get this internal error transaition page...can you help?
The topic has been locked.
Support Specialist
11 years 5 months ago #28207 by alzander
Replied by alzander on topic JFBC forwarding to a php
You shouldn't use the header PHP command. You should implement it like:
$app = JFactory::getApplication();
$app->redirect(JRoute::_('index.php?option=com_users&task=profile.edit'));
With PHP, using header can cause errors as the page may have already begun rendering. Joomla takes care of that with the redirect command. Another benefit is that you can add a message to the page, like:
$app = JFactory::getApplication();
$app->enqueueMessage('Thanks for coming back! You'll need to change your password before you can continue');
$app->redirect(JRoute::_('index.php?option=com_users&task=profile.edit'));
Hope that helps, but if not, let us know where you're adding that code as the location in the flow of registration may also be a problem.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
11 years 5 months ago #28210 by dididounet
Replied by dididounet on topic JFBC forwarding to a php
Mmmmm interesting. ok let me try that
The topic has been locked.
Active Subscriptions:

None
11 years 5 months ago #28212 by dididounet
Replied by dididounet on topic JFBC forwarding to a php
OK now: the problem is before I reach this file:
I have started with:
if(substr($username,0,3) == "fb_"){echo "you are now logged in";exit;}
and got same error, when reloading I ended up with (as excpected) : you are now logged in and a blank page...
Any idea where I could look ?
The topic has been locked.
Support Specialist
11 years 5 months ago #28225 by alzander
Replied by alzander on topic JFBC forwarding to a php
Best thing to do now, if you're getting an internal server error message, is go to Joomla's Global Config:
* Disable GZip
* Set Error Reporting to Maximum
* Disable any "optimization" plugins you have enabled

That will hopefully display a prettier PHP error instead of a generic server error message. With that, you should be able to track down the issue.

Keep us posted on how it goes, and best of luck,
Alex
The topic has been locked.
Active Subscriptions:

None
11 years 5 months ago #28238 by dididounet
Replied by dididounet on topic JFBC forwarding to a php
OK This is what I get...Strangely no "fatal error" only a buncg a warnings. and If I reload the page a ga ahead without problem... Does it make sense to you?

Warning: strtotime() [function.strtotime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EST/-5.0/no DST' instead in ...../public_html/libraries/joomla/utilities/date.php on line 56

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EST/-5.0/no DST' instead in ...../public_html/libraries/joomla/utilities/date.php on line 198

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EST/-5.0/no DST' instead in ..../public_html/libraries/joomla/utilities/date.php on line 198

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EST/-5.0/no DST' instead in ..../public_html/libraries/joomla/utilities/date.php on line 198

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EST/-5.0/no DST' instead in ....public_html/libraries/joomla/utilities/date.php on line 198

Warning: require_once(...public_html/components/com_virtuemart/virtuemart_parser.php) [function.require-once]: failed to open stream: No such file or directory in ..../public_html/plugins/jfbcprofiles/virtuemart.php on line 152
The topic has been locked.
Support Specialist
11 years 5 months ago #28245 by alzander
Replied by alzander on topic JFBC forwarding to a php
That last one is the key. Not sure why the fatal error isn't showing up afterwards, but if a require_once is called on a file that doesn't exist, PHP explodes.

It sounds like you have the Virtuemart Profile plugin enabled, but don't have Virtuemart installed. Can you disable that plugin, and any other profile plugins that are enabled for extensions you don't have? That should fix you up!

Thanks,
Alex
The topic has been locked.