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
Return to the default flat view Create a new topic Submit Reply
getting the GLOBALS needed for fudapi [message #35513] Wed, 17 January 2007 19:40 Go to previous message
maarten is currently offline  maarten   United States
Messages: 7
Registered: January 2007
Karma:
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.
[Message index]
 
Read Message
Read Message
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: Fri Dec 27 02:34:47 GMT 2024

Total time taken to generate the page: 0.06469 seconds