1
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.
// 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