Topic: [Question] Extending moderate.php
I'm trying to extend a function in moderate.php but I can't make it work.
I want a specific user to bypass the permission check at line 92-93.
if ($forum_user['g_id'] != FORUM_ADMIN && ($forum_user['g_moderator'] != '1' || !array_key_exists($forum_user['username'], $mods_array)))
message($lang_common['No permission']);
So far I tried to:
1) Pushing and unshifting the username of said user into the moderators array at line 88.
$mods_array = ($cur_forum['moderators'] != '') ? unserialize($cur_forum['moderators']) : array();
2) Setting $forum_user['g_moderator'] == '1' if user matches an if statement.
3) Setting the user group id to 1 (admin) to pretend the user is an admin and therefore succeed the permission check.
4) Changing the if statement entirely using the hooks before and after the statement (both hooks together and one at time).
These attempts were all unsuccessful. Can anyone help?
Thanks in advance.