Overview

Namespaces

  • None
  • Xmf
    • Database
    • Module
      • Helper
    • Template
  • Xoops
    • Auth
    • Core
      • Cache
      • Database
        • Logging
        • Schema
      • Exception
      • Handler
        • Scheme
      • Kernel
        • Dtype
        • Handlers
        • Model
      • Lists
      • Locale
        • Punic
      • Service
        • Contract
      • Session
      • Text
        • Sanitizer
          • Extensions
      • Theme
        • Plugins
    • Form
    • Html
    • Locale
    • Module
      • Helper
      • Plugin

Classes

  • XoopsBlock
  • XoopsBlockHandler
  • XoopsBlockModuleLink
  • XoopsBlockModuleLinkHandler
  • XoopsConfigHandler
  • XoopsConfigItem
  • XoopsConfigItemHandler
  • XoopsConfigOption
  • XoopsConfigOptionHandler
  • XoopsGroup
  • XoopsGroupHandler
  • XoopsGroupPerm
  • XoopsGroupPermHandler
  • XoopsMemberHandler
  • XoopsMembership
  • XoopsMembershipHandler
  • XoopsModule
  • XoopsModuleHandler
  • XoopsOnline
  • XoopsOnlineHandler
  • XoopsPrivateMessage
  • XoopsPrivateMessageHandler
  • XoopsTplFile
  • XoopsTplFileHandler
  • XoopsTplSet
  • XoopsTplSetHandler
  • XoopsUser
  • XoopsUserHandler
  • Overview
  • Namespace
  • Class
  • Tree

Class XoopsMemberHandler

XOOPS member handler class. This class provides simple interface (a facade class) for handling groups/users/ membership data.

Direct known subclasses

XoopsMemberHandler
Namespace: Xoops\Core\Kernel\Handlers
Package: Xoops\Core\Kernel
Category: Xoops\Core\Kernel\Handlers\XoopsMemberHandler
Copyright: 2000-2015 XOOPS Project (http://xoops.org)
License: GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
Author: Kazumi Ono onokazu@xoops.org
Link: http://xoops.org
Located at oops_lib/Xoops/Core/Kernel/Handlers/XoopsMemberHandler.php
Methods summary
public
# __construct( Xoops\Core\Database\Connection $db = null )

Constructor

Constructor

Parameters

$db
database connection
public Xoops\Core\Kernel\Handlers\XoopsGroup
# createGroup( )

create a new group

create a new group

Returns

Xoops\Core\Kernel\Handlers\XoopsGroup
reference to the new group
public Xoops\Core\Kernel\Handlers\XoopsUser
# createUser( )

create a new user

create a new user

Returns

Xoops\Core\Kernel\Handlers\XoopsUser
reference to the new user
public Xoops\Core\Kernel\Handlers\XoopsGroup
# getGroup( integer $id )

retrieve a group

retrieve a group

Parameters

$id
ID for the group

Returns

Xoops\Core\Kernel\Handlers\XoopsGroup
reference to the group
public Xoops\Core\Kernel\Handlers\XoopsUser
# getUser( integer $id )

retrieve a user

retrieve a user

Parameters

$id
ID for the user

Returns

Xoops\Core\Kernel\Handlers\XoopsUser
public boolean
# deleteGroup( Xoops\Core\Kernel\Handlers\XoopsGroup $group )

delete a group

delete a group

Parameters

$group
the group to delete

Returns

boolean
FALSE if failed
public boolean
# deleteUser( Xoops\Core\Kernel\Handlers\XoopsUser $user )

delete a user

delete a user

Parameters

$user
reference to the user to delete

Returns

boolean
FALSE if failed
public boolean
# insertGroup( Xoops\Core\Kernel\Handlers\XoopsGroup $group )

insert a group into the database

insert a group into the database

Parameters

$group
the group to insert

Returns

boolean
TRUE if already in database and unchanged, FALSE on failure
public boolean
# insertUser( Xoops\Core\Kernel\Handlers\XoopsUser $user, boolean $force = false )

insert a user into the database

insert a user into the database

Parameters

$user
the user to insert
$force
force insert

Returns

boolean
TRUE if already in database and unchanged, FALSE on failure
public Xoops\Core\Kernel\Handlers\XoopsGroup[]
# getGroups( Xoops\Core\Kernel\CriteriaElement $criteria = null, boolean $id_as_key = false )

retrieve groups from the database

retrieve groups from the database

Parameters

$criteria
criteria to match
$id_as_key
use the group's ID as key for the array?

Returns

Xoops\Core\Kernel\Handlers\XoopsGroup[]
public Xoops\Core\Kernel\Handlers\XoopsUser[]
# getUsers( Xoops\Core\Kernel\CriteriaElement $criteria = null, boolean $id_as_key = false )

retrieve users from the database

retrieve users from the database

Parameters

$criteria
criteria to match
$id_as_key
use the group's ID as key for the array?

Returns

Xoops\Core\Kernel\Handlers\XoopsUser[]
public array
# getGroupList( Xoops\Core\Kernel\CriteriaElement $criteria = null )

get a list of groupnames and their IDs

get a list of groupnames and their IDs

Parameters

$criteria
criteria to match

Returns

array
associative array of group-IDs and names
public array
# getUserList( Xoops\Core\Kernel\CriteriaElement $criteria = null )

get a list of usernames and their IDs

get a list of usernames and their IDs

Parameters

$criteria
criteria to match

Returns

array
associative array of user-IDs and names
public Xoops\Core\Kernel\Handlers\XoopsMembership
# addUserToGroup( integer $group_id, integer $user_id )

add a user to a group

add a user to a group

Parameters

$group_id
ID of the group
$user_id
ID of the user

Returns

Xoops\Core\Kernel\Handlers\XoopsMembership
public boolean
# removeUsersFromGroup( integer $group_id, array $user_ids = array() )

remove a list of users from a group

remove a list of users from a group

Parameters

$group_id
ID of the group
$user_ids
array of user-IDs

Returns

boolean
success?
public array
# getUsersByGroup( integer $group_id, boolean $asobject = false, integer $limit = 0, integer $start = 0 )

get a list of users belonging to a group

get a list of users belonging to a group

Parameters

$group_id
ID of the group
$asobject
return the users as objects?
$limit
number of users to return
$start
index of the first user to return

Returns

array

Array of XoopsUser objects (if $asobject is TRUE) or of associative arrays matching the record structure

public array
# getGroupsByUser( integer $user_id, boolean $asobject = false )

get a list of groups that a user is member of

get a list of groups that a user is member of

Parameters

$user_id
ID of the user
$asobject
return groups as XoopsGroup objects or arrays?

Returns

array
array of objects or arrays
public mixed
# loginUser( string $uname, string $pwd )

log in a user

log in a user

Parameters

$uname
username as entered in the login form
$pwd
password entered in the login form

Returns

mixed

object XoopsUser reference to the logged in user boolean FALSE if failed to log in

public integer
# getUserCount( Xoops\Core\Kernel\CriteriaElement $criteria = null )

count users matching certain conditions

count users matching certain conditions

Parameters

$criteria
criteria to match

Returns

integer
public integer
# getUserCountByGroup( integer $group_id )

count users belonging to a group

count users belonging to a group

Parameters

$group_id
ID of the group

Returns

integer
public boolean
# updateUserByField( Xoops\Core\Kernel\Handlers\XoopsUser $user, string $fieldName, string $fieldValue )

updates a single field in a users record

updates a single field in a users record

Parameters

$user
user object to update
$fieldName
name of the field to update
$fieldValue
updated value for the field

Returns

boolean
TRUE if success or unchanged, FALSE on failure
public boolean
# updateUsersByField( string $fieldName, string $fieldValue, Xoops\Core\Kernel\CriteriaElement $criteria = null )

updates a single field in a users record

updates a single field in a users record

Parameters

$fieldName
name of the field to update
$fieldValue
updated value for the field
$criteria
criteria to match

Returns

boolean
TRUE if success or unchanged, FALSE on failure
public boolean
# activateUser( Xoops\Core\Kernel\Handlers\XoopsUser $user )

activate a user

activate a user

Parameters

$user
the user object

Returns

boolean
successful?
public array
# getUsersByGroupLink( array $groups, Xoops\Core\Kernel\CriteriaElement $criteria = null, boolean $asobject = false, boolean $id_as_key = false )

Get a list of users belonging to certain groups and matching criteria Temporary solution

Get a list of users belonging to certain groups and matching criteria Temporary solution

Parameters

$groups
IDs of groups
$criteria
criteria to match
$asobject
return the users as objects?
$id_as_key
use the UID as key for the array if $asobject is TRUE

Returns

array

Array of XoopsUser objects (if $asobject is TRUE) or of associative arrays matching the record structure in the database.

public integer
# getUserCountByGroupLink( array $groups, CriteriaElement|null $criteria = null )

Get count of users belonging to certain groups and matching criteria Temporary solution

Get count of users belonging to certain groups and matching criteria Temporary solution

Parameters

$groups
IDs of groups
$criteria
criteria to match

Returns

integer
count of users
API documentation generated by ApiGen