Skip to content

5) Group Operations

Raphael Jackstadt edited this page Dec 8, 2016 · 4 revisions

Groups are most important part of Aauth
First you must know groups settings can be changed from Aauth config file (we recomend not to change) 'admin_group' => 'Admin' is group name of admin
'default_group' => 'Default' is for new users
'public_group' => 'Public' for whom not logged in

In Aauth, Users can have more than one group.
Admin has all rights

lets look at functions

create_group($group_name, $definition='')

creates a group with the given group name and an optional description and returns the new group id.

update_group($group_id, $group_name)

updates group using group_id

delete_group($group_id)

deletes group

add_member($user_id, $group_par)

adds member to a group. group_par can be group id or group name

remove_member($user_id, $group_par)

get given user out of given group.

is_member($group_par, $user_id=FALSE)

returns true if current user member of given group, orherwise false

is_admin()

returns true if current user is admin
Remember! you can change admin's group from Aauth config file

list_groups()

returns list of groups as an object

get_group_name($group_id)

returns name of a group

get_group_id($group_par)

returns id of group by taking group_par(id or name of group)