Attached is the file. Rename it user_auth.inc.php and throw it in the includes directory of your forums.
Then just require the file and use it as follows
$userob = new user_auth();
if( $userob->is_logged_in ) {
}
if( $userob->in_group( 3 ) ) {
}
if( $userob->check_access( 7, "read" ) ) {
}
if( $userob->fields['USER_MEMBERSHIP_LEVEL'] == "Administrator" ) {
}
if( $userob->is_logged_in ) {
if( $userob->is_banned ) {
echo "Go away, " . $userob->fields['USER_DISPLAY_NAME'];
} else {
echo "Welcome, " . $userob->fields['USER_DISPLAY_NAME'];
}
} else {
echo "Please register";
}
Note that $userob->fields is the same as the $user you've been using before, just wanted to not have two different variables hanging around
If you have any problems, it could be due to some paths being off, but the php error will explain that