84 $inst = $this->_gHandler->create();
95 $inst = $this->_uHandler->create();
108 return $this->_gHandler->get(
$id);
120 if (!isset($this->_members[
$id])) {
121 $this->_members[
$id] = $this->_uHandler->get($id);
123 return $this->_members[
$id];
135 $this->_gHandler->delete($group);
136 $this->_mHandler->deleteAll(
new Criteria(
'groupid', $group->
getVar(
'groupid')));
149 $this->_uHandler->delete($user);
150 $this->_mHandler->deleteAll(
new Criteria(
'uid', $user->
getVar(
'uid')));
164 return $this->_gHandler->insert($group);
178 return $this->_uHandler->insert($user, $force);
191 return $this->_gHandler->getObjects(
$criteria, $id_as_key);
204 return $this->_uHandler->getObjects(
$criteria, $id_as_key);
233 $users = $this->_uHandler->getObjects(
$criteria,
true);
235 foreach (array_keys($users) as
$i) {
236 $ret[
$i] = $users[
$i]->getVar(
'uname');
251 $mship = $this->_mHandler->create();
252 $mship->setVar(
'groupid', $group_id);
254 return $this->_mHandler->insert($mship);
270 foreach ($user_ids as
$uid) {
274 return $this->_mHandler->deleteAll(
$criteria);
290 $user_ids = $this->_mHandler->getUsersByGroup($group_id,
$limit,
$start);
295 foreach ($user_ids as $u_id) {
297 if (is_object(
$user)) {
317 $group_ids = $this->_mHandler->getGroupsByUser(
$user_id);
321 foreach ($group_ids as $g_id) {
348 $hash =
$user[0]->pass();
352 if (!password_verify($pwd, $hash)) {
356 $rehash = password_needs_rehash($hash, PASSWORD_DEFAULT);
358 if ($hash!=md5($pwd)) {
365 $user[0]->setVar(
'pass', password_hash($pwd, PASSWORD_DEFAULT));
366 $this->_uHandler->insert(
$user[0]);
402 return $this->_uHandler->getCount(
$criteria);
414 return $this->_mHandler->getCount(
new Criteria(
'groupid', $group_id));
428 $user->
setVar($fieldName, $fieldValue);
446 return $this->_uHandler->updateAll($fieldName, $fieldValue,
$criteria);
458 if ($user->
getVar(
'level') != 0) {
461 $user->
setVar(
'level', 1);
462 return $this->_uHandler->insert($user,
true);
484 $qb = $this->_uHandler->db2->createXoopsQueryBuilder();
487 $qb ->select(
'DISTINCT ' . ($asobject ?
'u.*' :
'u.uid'))
488 ->fromPrefix(
'users',
'u')
489 ->leftJoinPrefix(
'u',
'groups_users_link',
'm',
'm.uid = u.uid');
493 $qb->where($eb->in(
'm.groupid',
$groups));
497 $whereMode = $where ?
'AND' :
'';
503 if (!
$result = $qb->execute()) {
507 while ($myrow =
$result->fetch(PDO::FETCH_ASSOC)) {
510 $user->assignVars($myrow);
514 $ret[$myrow[
'uid']] =
$user;
518 $ret[] = $myrow[
'uid'];
535 $qb = $this->_uHandler->db2->createXoopsQueryBuilder();
538 $qb ->select(
'COUNT(DISTINCT u.uid)')
539 ->fromPrefix(
'users',
'u')
540 ->leftJoinPrefix(
'u',
'groups_users_link',
'm',
'm.uid = u.uid');
544 $qb->where($eb->in(
'm.groupid',
$groups));
548 $whereMode = $where ?
'AND' :
'';
553 $ret =
$result->fetchColumn(0);
getUserList(CriteriaElement $criteria=null)
getUserCountByGroupLink($groups, $criteria=null)
getGroupsByUser($user_id, $asobject=false)
deleteGroup(XoopsGroup &$group)
getGroups(CriteriaElement $criteria=null, $id_as_key=false)
insertUser(XoopsUser &$user, $force=false)
removeUsersFromGroup($group_id, $user_ids=array())
activateUser(XoopsUser &$user)
loginUserMd5($uname, $md5pwd)
addUserToGroup($group_id, $user_id)
insertGroup(XoopsGroup &$group)
getVar($key, $format= 's')
updateUsersByField($fieldName, $fieldValue, CriteriaElement $criteria=null)
getUserCount(CriteriaElement $criteria=null)
getUsersByGroupLink($groups, CriteriaElement $criteria=null, $asobject=false, $id_as_key=false)
getUsersByGroup($group_id, $asobject=false, $limit=0, $start=0)
getUsers(CriteriaElement $criteria=null, $id_as_key=false)
if(!$xoops->isUser()) $uid
deleteUser(XoopsUser &$user)
__construct(Connection $db=null)
getGroupList(CriteriaElement $criteria=null)
updateUserByField(XoopsUser &$user, $fieldName, $fieldValue)
setVar($key, $value, $not_gpc=false)
getUserCountByGroup($group_id)