function verify_user_gacl_group($user) { global $phpgacl_location; if (isset($phpgacl_location)) { if (acl_get_group_titles($user) == 0) { newEvent('login', $user, $provider, 0, "failure: {$ip}. user not in any phpGACL groups. (bad username?)"); return false; } } return true; }
} ?> <?php // Collect the access control group of user if (isset($phpgacl_location) && acl_check('admin', 'acl')) { ?> <tr> <td class='text'><?php xl('Access Control', 'e'); ?> :</td> <td><select id="access_group_id" name="access_group[]" multiple style="width:150px;" > <?php $list_acl_groups = acl_get_group_title_list(); $username_acl_groups = acl_get_group_titles($iter["username"]); foreach ($list_acl_groups as $value) { if ($username_acl_groups && in_array($value, $username_acl_groups)) { // Modified 6-2009 by BM - Translate group name if applicable echo " <option value='{$value}' selected>" . xl_gacl_group($value) . "</option>\n"; } else { // Modified 6-2009 by BM - Translate group name if applicable echo " <option value='{$value}'>" . xl_gacl_group($value) . "</option>\n"; } } ?> </select></td> <td><span class=text><?php xl('Additional Info', 'e'); ?> :</span></td>
function user_group_listings_xml($username, $err) { $list_acl_groups = acl_get_group_title_list(); $username_acl_groups = acl_get_group_titles($username); //note acl_get_group_titles() returns a 0 if user in no groups $message = "<?xml version=\"1.0\"?>\n" . "<response>\n" . "\t<inactive>\n"; foreach ($list_acl_groups as $value) { if (!$username_acl_groups || !in_array($value, $username_acl_groups)) { $message .= "\t\t<group>\n"; $message .= "\t\t\t<value>" . $value . "</value>\n"; // Modified 6-2009 by BM - Translate gacl group name if applicable $message .= "\t\t\t<label>" . xl_gacl_group($value) . "</label>\n"; $message .= "\t\t</group>\n"; } } $message .= "\t</inactive>\n" . "\t<active>\n"; if ($username_acl_groups) { foreach ($username_acl_groups as $value) { $message .= "\t\t<group>\n"; $message .= "\t\t\t<value>" . $value . "</value>\n"; // Modified 6-2009 by BM - Translate gacl group name if applicable $message .= "\t\t\t<label>" . xl_gacl_group($value) . "</label>\n"; $message .= "\t\t</group>\n"; } } $message .= "\t</active>\n"; if (isset($err)) { foreach ($err as $value) { $message .= "\t<error>" . $value . "</error>\n"; } } $message .= "</response>\n"; return $message; }