Code:
// Check whether user belongs to certain usergroup 5 for supermoderators 6 for admins
$sql = "SELECT * FROM user WHERE username = '$PHP_AUTH_USER' AND (usergroupid = '6' or usergroupid = '5') "; $result = mysql_query( $sql ) or die ( 'Unable to execute query.' ); $num = mysql_numrows( $result ); if ( $num != 0 ) { $auth = true; }
anyone have a way to make this check for secondary groups like
(membergroupids = '5' or membergroupids ='16')
the above seems to work ONLY if the user is in 5 or 16 as their only secondary group, ie, if users secondary groups are = 5,11,13 then it fails