ElkArte Community

Project Support => Support => Topic started by: CrimeS on May 08, 2016, 04:14:18 pm

Title: Error on the home page
Post by: CrimeS on May 08, 2016, 04:14:18 pm
As few people noticed, I'm getting an error on the home page. I'm not able to recreate this, as I've never seen the error it happens for any user that isn't a moderator:

(http://i.imgur.com/erEpQml.png)

I only have 1.0.6 and 1.0.7 security patches, no modifications installed. Recently I've been adding Bad Behaviour to the forum. Did anyone else ever had a similar problem?

This is the line:
Code: [Select]
$user_info['is_moderator'] = $user_info['is_mod'] || allowedTo('moderate_board');



After looking into this, it seems like an issue with integration on the home page, weird to only happen recently. Only normal users can see this. I can provide the code of home page by PM.
Title: Re: Error on the home page
Post by: emanuele on May 08, 2016, 06:08:19 pm
Yep, that was my idea as well.
Now that I look at it more in details, I realized it's a bug.
I'd try to fix it by changing:
Code: [Select]
		'is_admin' => in_array(1, $user_info['groups']),
to:
Code: [Select]
		'is_mod' => false,
'is_admin' => in_array(1, $user_info['groups']),
in Load.php.

The issue is that is_mod is set only in loadBoard, but the function is not (always) called when using SSI.
So move the set of is_mod to loadUserSettings I think makes most sense.
Title: Re: Error on the home page
Post by: CrimeS on May 09, 2016, 12:59:58 pm
That solved the issue. Nice to be catching bugs :)
Title: Re: Error on the home page
Post by: emanuele on May 09, 2016, 01:07:36 pm
Tracked. :)