MyBB Community Forums

Full Version: Make forum password bypass by usergroup
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i see the feature Forum Password : To protect this forum further, you can choose a password that must be entered for access. Note: User groups still need permissions to access this forum.
that can make forum protected by password to access, how to make some usergroup can access the forum without input the password on it like admin?

thanks for help
I guess Yaldaram had this or something similar. Confused
(2011-04-18, 05:18 PM)crazy4cs Wrote: [ -> ]I guess Yaldaram had this or something similar. Confused

No, I've not.
Ah, thats why I said a guess, but am sure, you might like to include this in a long term project. Wink
up ! up ! up !
If you want to make selective Usergroups to ByPass Password Protected Forums, then here is how;

Open ./inc/functions.php file and find;
function check_forum_password($fid, $pid=0)
{
	global $mybb, $header, $footer, $headerinclude, $theme, $templates, $lang, $forum_cache;
	
	$showform = true;
and Change it to;
function check_forum_password($fid, $pid=0)
{
	global $mybb, $header, $footer, $headerinclude, $theme, $templates, $lang, $forum_cache;
	
	$showform = true;

	$groups = array(3,4,6,8);
	if (!in_array($mybb->user['usergroup'],$groups))
	{

Now within the same file, find;
			$_SERVER['REQUEST_URI'] = htmlspecialchars_uni($_SERVER['REQUEST_URI']);
			eval("\$pwform = \"".$templates->get("forumdisplay_password")."\";");
			output_page($pwform);
		}
		exit;
	}
}

and add a single } at the end of the string, like that;
			$_SERVER['REQUEST_URI'] = htmlspecialchars_uni($_SERVER['REQUEST_URI']);
			eval("\$pwform = \"".$templates->get("forumdisplay_password")."\";");
			output_page($pwform);
		}
		exit;
	}
}
}

Now Change 3,4,6,8 in the above array() to the Usergroup IDs you wish to allow them to ByPass pasword protected forums Wink
working like a charm! thank you very much Yaldaram!
Most welcome Wink