Skip to content

5) Group Operations

Emre Akay edited this page Jul 4, 2014 · 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)

creates a group and returns 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)

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)

Aauth Version 2 has been released

Some functions has changed. Dont forget to scan the new features and functions from Wiki

Clone this wiki locally