mgd_is_member

(Midgard 1.4.2 'Bifrost')

mgd_is_member -- Check group membership

Description

bool mgd_is_member (int group_id, int [user_id])

Minimum version: Midgard 1.2.4 -- unknown for the optional second argument user_id

Checks whether the authenticated user (or user_id, if set) is a member of the group with id group_id.

Returns TRUE if successful. Returns FALSE on failure.


<?php
 $group_id = 6;  // Must exist, of course.
 echo "You are ", ( mgd_is_member($group_id) ? '' : 'not ' ), "a member.\n";
?>