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

Home » FUDforum Development » FUDforum 3.0+ » getting the GLOBALS needed for fudapi
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
getting the GLOBALS needed for fudapi [message #35513] Wed, 17 January 2007 19:40 Go to next message
maarten is currently offline  maarten   United States
Messages: 7
Registered: January 2007
Karma: 0
Junior Member
I'm using fudforum_login.php and fudapi.inc.php in a context where I'm confined into function scope, so I'm relying on the technique in __fud_login_common() to read GLOBALS.php, eval it, and then export the ones that matter.

Catch is: the variables exported don't cover all the ones needed by fudapi.inc.php.

For example, when fud_add_user() copies $vals['login'] to the alias, it relies on $GLOBALS['MAX_LOGIN_SHOW'] and will fail if that's not set, and the alias field will stay blank.

I searched fudapi for uses of globals and added these to be exported:
'SERVER_TZ', 'MAX_LOGIN_SHOW', 'POSTS_PER_PAGE',
'WWW_ROOT', 'LOGEDIN_TIMEOUT', 'TMP'


There may be other ones in code called from fudapi? For easier future integration, it'd be great if there was a fool-proof way to get all globals exported correctly.

Simply including GLOBALS.php at the top of fudapi.inc.php won't work for me because fudapi.inc.php is being included inside a function and I have no control over that.
Re: getting the GLOBALS needed for fudapi [message #35520 is a reply to message #35513] Thu, 18 January 2007 00:05 Go to previous message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
The export list was expanded.

FUDforum Core Developer
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: fud_delete_user() produces SQL error?
Next Topic: show last ten topic
Goto Forum:
  

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

Current Time: Wed Dec 18 01:42:52 GMT 2024

Total time taken to generate the page: 0.04434 seconds