XOOPS  2.6.0
XoopsMemberHandler Class Reference

Public Member Functions

 __construct (Connection $db=null)
 
 activateUser (XoopsUser &$user)
 
 addUserToGroup ($group_id, $user_id)
 
 createGroup ()
 
 createUser ()
 
 deleteGroup (XoopsGroup &$group)
 
 deleteUser (XoopsUser &$user)
 
 getGroup ($id)
 
 getGroupList (CriteriaElement $criteria=null)
 
 getGroups (CriteriaElement $criteria=null, $id_as_key=false)
 
 getGroupsByUser ($user_id, $asobject=false)
 
 getUser ($id)
 
 getUserCount (CriteriaElement $criteria=null)
 
 getUserCountByGroup ($group_id)
 
 getUserCountByGroupLink ($groups, $criteria=null)
 
 getUserList (CriteriaElement $criteria=null)
 
 getUsers (CriteriaElement $criteria=null, $id_as_key=false)
 
 getUsersByGroup ($group_id, $asobject=false, $limit=0, $start=0)
 
 getUsersByGroupLink ($groups, CriteriaElement $criteria=null, $asobject=false, $id_as_key=false)
 
 insertGroup (XoopsGroup &$group)
 
 insertUser (XoopsUser &$user, $force=false)
 
 loginUser ($uname, $pwd)
 
 loginUserMd5 ($uname, $md5pwd)
 
 removeUsersFromGroup ($group_id, $user_ids=array())
 
 updateUserByField (XoopsUser &$user, $fieldName, $fieldValue)
 
 updateUsersByField ($fieldName, $fieldValue, CriteriaElement $criteria=null)
 

Private Attributes

 $_gHandler
 
 $_members = array()
 
 $_mHandler
 
 $_uHandler
 

Detailed Description

Definition at line 34 of file member.php.

Constructor & Destructor Documentation

XoopsMemberHandler::__construct ( Connection  $db = null)

#@- Constructor

Parameters
Connection | null$dbdatabase connection

Definition at line 70 of file member.php.

References Xoops\getInstance().

Here is the call graph for this function:

Member Function Documentation

XoopsMemberHandler::activateUser ( XoopsUser $user)

activate a user

Parameters
XoopsUser&$userreference to the XoopsUser object
Returns
bool successful?

Definition at line 456 of file member.php.

References Xoops\Core\Kernel\XoopsObject\getVar(), and Xoops\Core\Kernel\XoopsObject\setVar().

Here is the call graph for this function:

XoopsMemberHandler::addUserToGroup (   $group_id,
  $user_id 
)

add a user to a group

Parameters
int$group_idID of the group
int$user_idID of the user
Returns
object XoopsMembership

Definition at line 249 of file member.php.

References $user_id.

XoopsMemberHandler::createGroup ( )

create a new group

Returns
XoopsGroup reference to the new group

Definition at line 82 of file member.php.

XoopsMemberHandler::createUser ( )

create a new user

Returns
XoopsUser reference to the new user

Definition at line 93 of file member.php.

XoopsMemberHandler::deleteGroup ( XoopsGroup $group)

delete a group

Parameters
XoopsGroup&$groupreference to the group to delete
Returns
bool FALSE if failed

Definition at line 133 of file member.php.

References Xoops\Core\Kernel\XoopsObject\getVar().

Here is the call graph for this function:

XoopsMemberHandler::deleteUser ( XoopsUser $user)

delete a user

Parameters
XoopsUser&$userreference to the user to delete
Returns
bool FALSE if failed

Definition at line 147 of file member.php.

References Xoops\Core\Kernel\XoopsObject\getVar().

Here is the call graph for this function:

XoopsMemberHandler::getGroup (   $id)

retrieve a group

Parameters
int$idID for the group
Returns
XoopsGroup reference to the group

Definition at line 106 of file member.php.

References $id.

Referenced by getGroupsByUser().

Here is the caller graph for this function:

XoopsMemberHandler::getGroupList ( CriteriaElement  $criteria = null)

get a list of groupnames and their IDs

Parameters
CriteriaElement | null$criteriaCriteriaElement object
Returns
array associative array of group-IDs and names

Definition at line 214 of file member.php.

References $criteria, $groups, and $i.

XoopsMemberHandler::getGroups ( CriteriaElement  $criteria = null,
  $id_as_key = false 
)

retrieve groups from the database

Parameters
CriteriaElement | null$criteriaCriteriaElement
bool$id_as_keyuse the group's ID as key for the array?
Returns
array array of XoopsGroup objects

Definition at line 189 of file member.php.

References $criteria.

XoopsMemberHandler::getGroupsByUser (   $user_id,
  $asobject = false 
)

get a list of groups that a user is member of

Parameters
int$user_idID of the user
bool$asobjectreturn groups as XoopsGroup objects or arrays?
Returns
array array of objects or arrays

Definition at line 314 of file member.php.

References $user_id, and getGroup().

Here is the call graph for this function:

XoopsMemberHandler::getUser (   $id)

retrieve a user

Parameters
int$idID for the user
Returns
XoopsUser

Definition at line 118 of file member.php.

References $id.

Referenced by getUsersByGroup().

Here is the caller graph for this function:

XoopsMemberHandler::getUserCount ( CriteriaElement  $criteria = null)

count users matching certain conditions

Parameters
CriteriaElement | null$criteriaCriteriaElement object
Returns
int

Definition at line 400 of file member.php.

References $criteria.

XoopsMemberHandler::getUserCountByGroup (   $group_id)

count users belonging to a group

Parameters
int$group_idID of the group
Returns
int

Definition at line 412 of file member.php.

XoopsMemberHandler::getUserCountByGroupLink (   $groups,
  $criteria = null 
)

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

Parameters
array$groupsIDs of groups
CriteriaElement | null$criteriacriteria to match
Returns
int count of users

Definition at line 533 of file member.php.

References $criteria, $groups, and $result.

XoopsMemberHandler::getUserList ( CriteriaElement  $criteria = null)

get a list of usernames and their IDs

Parameters
CriteriaElement | null$criteriaCriteriaElement object
Returns
array associative array of user-IDs and names

Definition at line 231 of file member.php.

References $criteria, and $i.

XoopsMemberHandler::getUsers ( CriteriaElement  $criteria = null,
  $id_as_key = false 
)

retrieve users from the database

Parameters
CriteriaElement | null$criteriaCriteriaElement
bool$id_as_keyuse the group's ID as key for the array?
Returns
array array of XoopsUser objects

Definition at line 202 of file member.php.

References $criteria.

XoopsMemberHandler::getUsersByGroup (   $group_id,
  $asobject = false,
  $limit = 0,
  $start = 0 
)

get a list of users belonging to a group

Parameters
int$group_idID of the group
bool$asobjectreturn the users as objects?
int$limitnumber of users to return
int$startindex of the first user to return
Returns
array Array of XoopsUser objects (if $asobject is TRUE) or of associative arrays matching the record structure in the database.

Definition at line 288 of file member.php.

References $limit, $start, $user, and getUser().

Here is the call graph for this function:

XoopsMemberHandler::getUsersByGroupLink (   $groups,
CriteriaElement  $criteria = null,
  $asobject = false,
  $id_as_key = false 
)

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

Parameters
array$groupsIDs of groups
CriteriaElement$criteriaCriteriaElement object or null
bool$asobjectreturn the users as objects?
bool$id_as_keyuse 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.

Definition at line 477 of file member.php.

References $criteria, $groups, $result, $sql, and $user.

XoopsMemberHandler::insertGroup ( XoopsGroup $group)

insert a group into the database

Parameters
XoopsGroup&$groupreference to the group to insert
Returns
bool TRUE if already in database and unchanged FALSE on failure

Definition at line 162 of file member.php.

XoopsMemberHandler::insertUser ( XoopsUser $user,
  $force = false 
)

insert a user into the database

Parameters
XoopsUser | XoopsObject&$userreference to the user to insert
bool$forceforce insert
Returns
bool TRUE if already in database and unchanged FALSE on failure

Definition at line 176 of file member.php.

Referenced by updateUserByField().

Here is the caller graph for this function:

XoopsMemberHandler::loginUser (   $uname,
  $pwd 
)

log in a user

Parameters
string$unameusername as entered in the login form
string$pwdpassword entered in the login form
Returns
mixed object XoopsUser reference to the logged in user boolean FALSE if failed to log in
Todo:
  • md5 support should be completely removed eventually

Definition at line 339 of file member.php.

References $criteria, $type, $uname, and $user.

XoopsMemberHandler::loginUserMd5 (   $uname,
  $md5pwd 
)

logs in a user with an md5 encrypted password

Parameters
string$unameusername
string$md5pwdpassword encrypted with md5
Returns
object XoopsUser reference to the logged in user. FALSE if failed to log in
Deprecated:
– this does not appear to be used and should be removed

Definition at line 381 of file member.php.

References $criteria, $uname, and $user.

XoopsMemberHandler::removeUsersFromGroup (   $group_id,
  $user_ids = array() 
)

remove a list of users from a group

Parameters
int$group_idID of the group
array$user_idsarray of user-IDs
Returns
bool success?

Definition at line 265 of file member.php.

References $criteria, $criteria2, and $uid.

XoopsMemberHandler::updateUserByField ( XoopsUser $user,
  $fieldName,
  $fieldValue 
)

updates a single field in a users record

Parameters
XoopsUser&$userreference to the XoopsUser object
string$fieldNamename of the field to update
string$fieldValueupdated value for the field
Returns
bool TRUE if success or unchanged, FALSE on failure

Definition at line 426 of file member.php.

References insertUser(), and Xoops\Core\Kernel\XoopsObject\setVar().

Here is the call graph for this function:

XoopsMemberHandler::updateUsersByField (   $fieldName,
  $fieldValue,
CriteriaElement  $criteria = null 
)

updates a single field in a users record

Parameters
string$fieldNamename of the field to update
string$fieldValueupdated value for the field
CriteriaElement$criteriaCriteriaElement object or null
Returns
bool TRUE if success or unchanged, FALSE on failure

Definition at line 441 of file member.php.

References $criteria.

Member Data Documentation

XoopsMemberHandler::$_gHandler
private

Definition at line 42 of file member.php.

XoopsMemberHandler::$_members = array()
private

holds temporary user objects

Definition at line 61 of file member.php.

XoopsMemberHandler::$_mHandler
private

Definition at line 56 of file member.php.

XoopsMemberHandler::$_uHandler
private

Definition at line 49 of file member.php.


The documentation for this class was generated from the following file: