public class GroupAuth extends Auth
Group-based user authentication component. This component implements user access by clasifyng users in groups, this way you canrequire that the user belongs to certain group to access the script.
Auth
|
+-- GroupAuth
| Author(s): | Julio César Carrascal Urquijo <jcesar@phreaker.net> |
|---|---|
| Version: | 2.4 |
| Methods inherited from Auth | auth, startsession, forcelogin, logout, refreshinfo, _callback, _connect, _findbyusername, _findbyid, _checksession |
| Fields inherited from Auth | $user, $isidentified, $cachelevel, $dbdriver, $hostname, $username, $password, $database, $_conn, $_options |
public void GroupAuth( [ string $options ] );
Constructor.
| Parameters: | ||||||
|
||||||
Returns: void |
||||||
public void requireGroups( );
Require that the user belongs to all groups passed as parameters. Force the user to identify himself (If he hasn't do it before) andensures that he/she belongs to each specified group. You can pass all thegroups you need at once.
Returns: void |
| See Also: requireAtLeast() |
public void requireAtLeast( );
Require that the user belongs to at least to one of this groups. Force the user to identify himself (If he hasn't do it before) andensures that he belongs "at least" to one of the specified groups. Youcan pass all the groups you need at once.
Returns: void |
| See Also: requireGroups() |
private array _getGroups( int $userId );
Search the groups a user belongs to. Returns an associative array for easy access.
| Parameters: | ||||||
|
||||||
Returns: array group1 => true, group2 => true. |
||||||