FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Bug Reports » pdo_concat() declared in both index.php and db.inc
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
pdo_concat() declared in both index.php and db.inc [message #39148] Wed, 03 October 2007 16:52 Go to next message
pgregg is currently offline  pgregg   United Kingdom
Messages: 14
Registered: July 2006
Karma: 0
Junior Member
I've building out a new website with FUDforum using the API to automate the login and user creation with our single sign on. How this works is that you click on the login button from any page in the site and it takes you out to a SSO website which bounces you back to the page you were on upon successful login.

Everything is working so far with one exception - if I login on a page outside of the forums then browse into the forum, no problem.
However, if I am on a forum page and login - my redirect back goes into the forum and the forum processing happens first and I get the following error:

Fatal error: Cannot redeclare pdo_concat() (previously declared in E:\web\support\production\community\index.php:68) in E:\web\support\FUDforum_data\include\theme\default\db.inc on line 67

The index.php page contains the same code as db.inc file so to fix on my end, I have wrapped the top half of index.php down to and including function _esc declaration in a if !function_exists('pdo_concat'
when I did this, the error message swapped saying previously declared in db.inc - so I had to make the same change in db.inc and db.inc.t
I just wonder if I rebuild the theme, will my main forum index.php get blown away (coudn't find the template for that).

The reason this is happening is because in my template header, I call my site's global login handler, which because it is the first time the user has authed to the site, pulls in fudapi/forum_login (and so db.inc) in order to setup/login the user.

Thanks,
PG
Re: pdo_concat() declared in both index.php and db.inc [message #39150 is a reply to message #39148] Wed, 03 October 2007 18:56 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
The order of inclusion needs to be such that fudapi.inc.php is included before forum_login.php if you are including both files.

FUDforum Core Developer
Re: pdo_concat() declared in both index.php and db.inc [message #39151 is a reply to message #39148] Wed, 03 October 2007 20:32 Go to previous message
pgregg is currently offline  pgregg   United Kingdom
Messages: 14
Registered: July 2006
Karma: 0
Junior Member
Yep, I'm already doing that - see attached image.

index.php?t=getfile&id=3750&private=0

[edit]
I suppose as a workaround, in the login handler, check if the current url is the forum and, instead of letting execution drop through to the rest of the forum code, issue a header redirect to REQUEST_URI - the subsequent call will have authentication all set and my login handler won't pull in the fudapi files and so there will be no conflict.

Regards,
PG
  • Attachment: fud.jpg
    (Size: 88.22KB, Downloaded 1178 times)

[Updated on: Wed, 03 October 2007 20:38]

Report message to a moderator

  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Odd bit of code...
Next Topic: FUDforum extremely slow with Geo-Location enabled
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Dec 05 02:20:41 GMT 2024

Total time taken to generate the page: 0.02460 seconds