Class for doing user related functions. Maybe of the User object functions are just wrappers around these.
package |
CMS |
---|---|
license |
GPL |
since | 0.6.1 |
get_instance() : \UserOperations
LoadUsers(integer $limit = 10000, integer $offset)
integer
$limitThe maximum number of users to return
integer
$offsetThe offset
LoadUsersInGroup(mixed $groupid) : array
mixed
$groupidGroup for the loaded users
array
An array of User objects
LoadUserByUsername(mixed $username, mixed $password = '', mixed $activeonly = true, mixed $adminaccessonly = false) : mixed
Does not use a cache, so use sparingly.
mixed
$usernameUsername to load
mixed
$passwordPassword to check against
mixed
$activeonlyOnly load the user if they are active
mixed
$adminaccessonlyOnly load the user if they have admin access
mixed
If successful, the filled User object. If it fails, it returns false.
LoadUserByID(mixed $id) : mixed
mixed
$idUser id to load
mixed
If successful, the filled User object. If it fails, it returns false.
InsertUser(mixed $user) : mixed
mixed
$userUser object to save
mixed
The new user id. If it fails, it returns -1.
UpdateUser(mixed $user) : mixed
mixed
$userUser object to save
mixed
If successful, true. If it fails, false.
DeleteUserByID(mixed $id)
mixed
$idId of the user to delete
CountPageOwnershipByID(mixed $id) : mixed
mixed
$idId of the user to count
mixed
Number of pages they own. 0 if any problems.
GetList() : array
array
GenerateDropdown(integer $currentuserid = null, string $name = 'ownerid')
integer
$currentuseridstring
$nameThe HTML element name.
UserInGroup(integer $uid, integer $gid) : true
integer
$uidUser ID to test
integer
$gidGroup ID to test
true
if test passes, false otherwise
IsSuperuser(integer $uid) : boolean
integer
$uid boolean
GetMemberGroups(integer $uid) : array
integer
$uid array
AddMemberGroup(integer $uid, integer $gid)
integer
$uidinteger
$gidCheckPermission(integer $userid, string $permname) : boolean
Given the users member groups, test if any of those groups have the specified permission.
integer
$useridstring
$permname boolean