10
not sure James, i've tried it on my site and it works fine (xoops 2.0.15 currently) but it also worked fine on 2.0.13.2 & 2.0.14..
here's the lines from m y userinfo.php
$uid = intval($_GET['uid']);
if ($uid <= 0) {
redirect_header('index.php', 3, _US_SELECTNG);
exit();
}
if (!is_object($xoopsUser)) {
redirect_header('index.php',3,_NOPERM);
exit();
}
$gperm_handler = & xoops_gethandler( 'groupperm' );
$groups = is_object($xoopsUser) ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS;
you can checkout at
http://72.29.82.174/~wwcncom/test2010/ if anonymous, it will say u have no permission, if logged on, it will let u view the profile.. :S
if having 'is_object' doesn't work for you, i dunno why, but if it works as you are using it without, then leave it as is being as it works :), but it is better to actually use is_object than not.. (i can't say why it's better, just that I was always told to use that instead of just !$xoopsUser), as it's the proper way of doing it. so i kept with doing it as a matter of practice..
maybe a more experienced coder can say why it's better to use is_object($xoopsUser) than just $xooopsUser??? i'd be curious to remember y too.. (i was told but i've forgotten the reasons..) i know 'is_object' will check if the variable in this case $xoopsUser is actually an object, but in this situation i can't actually remember why is_object($xoopsUser) is better than just $xoopsUser..