PDA

View Full Version : additional / secondary group check?


zetetic
04-17-2005, 01:10 PM
I've just figured out that this code:

$html_allowed=array(6); // add more by seperating each by commas in the ()'s: (6,8,19)
// ********************* REMOVE HTML CODES ***************************
if(!$dohtml && !in_array($userinfo[usergroupid],$html_allowed)&& !in_array($post[usergroupid],$html_allowed))

which is part of this mini-mod (https://vborg.vbsupport.ru/showthread.php?t=75590), will only work if the groupid's in $html_allowed are primary groups.

What would I change to make it check secondary group memberships too?

Link14716
04-17-2005, 01:42 PM
$html_allowed = array(6,X,Y);

foreach ($html_allowed as $ug) {
if (is_member_of($userinfo, $ug) {
$userinfo_sane = true;
}
if (is_member_of($post, $ug) {
$post_sane = true;
}
}
if(!$dohtml && !$usergroup_sane && !$post_sane)

zetetic
04-17-2005, 01:56 PM
$html_allowed = array(6,X,Y);

foreach ($html_allowed as $ug) {
if (is_member_of($userinfo, $ug) {
$userinfo_sane = true;
}
if (is_member_of($post, $ug) {
$post_sane = true;
}
}
if(!$dohtml && !$usergroup_sane && !$post_sane)
Except for the two missing ')'s on the end of the is_member_of's (thank god for eclipse, or i never would've noticed :)), that worked perfectly. Thanks!