1
dasdan
Xoops sitemap module blank page error
  • 2005/7/13 17:40

  • dasdan

  • Just popping in

  • Posts: 29

  • Since: 2005/1/22


Last week I installed the XOOPS sitemap module on this site.
http://www.dasdan.be

I 've noticed a problem while viewing the sitemap as registered user / admin. The page was blank.
Guests could see the sitemap.

I 've activated the php "debug-mode" in the xoops-cpanel.

There was an error on line 36
xoopsUser->isAdmin() method called on a non-object.

(I activated the 'All-time guest mode' for the sitemap) so there is a backup_uid stored while building the sitemap.
When done the original uid is restored.

I solved the problem storing the original uid and isAdmin in the $backup_uid and $backup_isadmin variables

strange enough the memberHandler->getUser($backup_uid); returns an empty object.
someone who can tell me why?
I have register_globals of in my php.ini, and think this is the problem.

le="color: #000000"><?php // for All-time guest mode (backup uid & set as Guest) $backup_uid=''; $backup_isadmin=''; if( is_object( $xoopsUser ) && ! empty( $xoopsModuleConfig['alltime_guest'] ) ) { $backup_uid = $xoopsUser->getVar('uid') ; $backup_isadmin = $xoopsUser->isAdmin('uid'); $xoopsUser = '' ; $xoopsUserIsAdmin = false ; $xoopsTpl->assign(array('xoops_isuser' => false, 'xoops_userid' => 0, 'xoops_uname' => '', 'xoops_isadmin' => false)); } $sitemap = sitemap_show(); // for All-time guest mode (restore $xoopsUser*) if( ! empty( $backup_uid ) && ! empty( $xoopsModuleConfig['alltime_guest'] ) ) { $member_handler =& xoops_gethandler('member'); $xoopsUser =& $member_handler->getUser( $backup_uid ) ; $xoopsUserIsAdmin = $backup_isadmin; }


This topic is also posted here:
Here

Login

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits