Open Journal Systems  2.4.4
 All Classes Namespaces Functions Variables Groups Pages
PKPUserGroupDAO.inc.php
1 <?php
2 
21 import('lib.pkp.classes.security.UserGroup');
22 
23 class PKPUserGroupDAO extends DAO {
25  var $userDao;
26 
28  var $userGroupAssignmentDao;
29 
33  function PKPUserGroupDAO() {
34  parent::DAO();
35  $this->userDao =& DAORegistry::getDAO('UserDAO');
36  $this->userGroupAssignmentDao =& DAORegistry::getDAO('UserGroupAssignmentDAO');
37  }
38 
43  function &newDataObject() {
44  $dataObject = new UserGroup();
45  return $dataObject;
46  }
47 
53  function &_returnFromRow(&$row) {
54  $userGroup =& $this->newDataObject();
55  $userGroup->setId($row['user_group_id']);
56  $userGroup->setRoleId($row['role_id']);
57  $userGroup->setContextId($row['context_id']);
58  $userGroup->setPath($row['path']);
59  $userGroup->setDefault($row['is_default']);
60 
61  $this->getDataObjectSettings('user_group_settings', 'user_group_id', $row['user_group_id'], $userGroup);
62 
63  HookRegistry::call('PKPUserGroupDAO::_returnFromRow', array(&$userGroup, &$row));
64 
65  return $userGroup;
66  }
67 
72  function insertUserGroup(&$userGroup) {
73  $returner = $this->update(
74  'INSERT INTO user_groups
75  (role_id, path, context_id, is_default)
76  VALUES
77  (?, ?, ?, ?)',
78  array(
79  (int) $userGroup->getRoleId(),
80  $userGroup->getPath(),
81  (int) $userGroup->getContextId(),
82  ($userGroup->getDefault()?1:0)
83  )
84  );
85 
86  $userGroup->setId($this->getInsertUserGroupId());
87  $this->updateLocaleFields($userGroup);
88  return $this->getInsertUserGroupId();
89  }
90 
97  function deleteById($contextId, $userGroupId) {
98  $ret1 = $this->userGroupAssignmentDao->deleteAssignmentsByUserGroupId($userGroupId);
99  $ret2 = $this->update('DELETE FROM user_group_settings WHERE user_group_id = ?', (int) $userGroupId);
100  $ret3 = $this->update('DELETE FROM user_groups WHERE user_group_id = ?', (int) $userGroupId);
101  $ret4 = $this->removeAllStagesFromGroup($contextId, $userGroupId);
102  return $ret1 && $ret2 && $ret3 && $ret4;
103  }
104 
110  function deleteUserGroup(&$userGroup) {
111  return $this->deleteById($userGroup->getContextId(), $userGroup->getId());
112  }
113 
114 
119  function deleteByContextId($contextId) {
120  $result =& $this->retrieve('SELECT user_group_id FROM user_groups WHERE context_id = ?', (int) $contextId);
121 
122  $returner = true;
123  for ($i=1; !$result->EOF; $i++) {
124  list($userGroupId) = $result->fields;
125 
126  $ret1 = $this->update('DELETE FROM user_group_stage WHERE user_group_id = ?', (int) $userGroupId);
127  $ret2 = $this->update('DELETE FROM user_group_settings WHERE user_group_id = ?', (int) $userGroupId);
128  $ret3 = $this->update('DELETE FROM user_groups WHERE user_group_id = ?', (int) $userGroupId);
129 
130  $returner = $returner && $ret1 && $ret2 && $ret3;
131  $result->MoveNext();
132  }
133 
134  return $returner;
135  }
136 
141  function getInsertUserGroupId() {
142  return $this->getInsertId('user_groups', 'user_group_id');
143  }
144 
149  function getLocaleFieldNames() {
150  return array('name', 'abbrev');
151  }
152 
157  function updateLocaleFields(&$userGroup) {
158  $this->updateDataObjectSettings('user_group_settings', $userGroup, array(
159  'user_group_id' => (int) $userGroup->getId()
160  ));
161  }
162 
168  function getById($userGroupId, $contextId = null) {
169  $params = array((int) $userGroupId);
170  if ($contextId !== null) $params[] = (int) $contextId;
171  $result =& $this->retrieve(
172  'SELECT user_group_id, context_id, role_id, path, is_default
173  FROM user_groups
174  WHERE user_group_id = ?' . ($contextId !== null?' AND context_id = ?':''),
175  $params
176  );
177 
178  return $this->_returnFromRow($result->GetRowAssoc(false));
179  }
180 
187  function &getDefaultByRoleId($contextId, $roleId) {
188  $returner = false;
189  $allDefaults =& $this->getByRoleId($contextId, $roleId, true);
190  if ( $allDefaults->eof() ) return $returner;
191  $returner =& $allDefaults->next();
192  return $returner;
193  }
194 
202  function &getByRoleId($contextId, $roleId, $default = false) {
203  $params = array((int) $contextId, (int) $roleId);
204  if ($default) $params[] = 1; // true
205  $result =& $this->retrieve(
206  'SELECT *
207  FROM user_groups
208  WHERE context_id = ? AND
209  role_id = ?' . ($default?' AND is_default = ?':''),
210  $params
211  );
212 
213  $returner = new DAOResultFactory($result, $this, '_returnFromRow');
214  return $returner;
215  }
216 
222  function &getUserGroupIdsByRoleId($roleId, $contextId = null) {
223  $sql = 'SELECT user_group_id FROM user_groups WHERE role_id = ?';
224  $params = array((int) $roleId);
225 
226  if ($contextId) {
227  $sql .= ' AND context_id = ?';
228  $params[] = (int) $contextId;
229  }
230 
231  $result =& $this->retrieve($sql, $params);
232 
233  $userGroupIds = array();
234  while (!$result->EOF) {
235  $userGroupIds[] = (int) $result->fields[0];
236  $result->MoveNext();
237  }
238 
239  $result->Close();
240  unset($result);
241 
242  return $userGroupIds;
243  }
244 
252  function userInGroup($userId, $userGroupId) {
253  $result =& $this->retrieve(
254  'SELECT count(*)
255  FROM user_groups ug
256  JOIN user_user_groups uug ON ug.user_group_id = uug.user_group_id
257  WHERE
258  uug.user_id = ? AND
259  ug.user_group_id = ?',
260  array((int) $userId, (int) $userGroupId)
261  );
262 
263  // > 0 because user could belong to more than one user group with this role
264  $returner = isset($result->fields[0]) && $result->fields[0] > 0 ? true : false;
265 
266  $result->Close();
267  unset($result);
268 
269  return $returner;
270  }
271 
278  function userInAnyGroup($userId, $contextId = null) {
279  $params = array((int) $userId);
280  if ($contextId) $params[] = (int) $contextId;
281 
282  $result =& $this->retrieve(
283  'SELECT count(*)
284  FROM user_groups ug
285  JOIN user_user_groups uug ON ug.user_group_id = uug.user_group_id
286  WHERE uug.user_id = ?' . ($contextId?' AND ug.context_id = ?':''),
287  $params
288  );
289 
290  $returner = isset($result->fields[0]) && $result->fields[0] > 0 ? true : false;
291 
292  $result->Close();
293  unset($result);
294 
295  return $returner;
296  }
297 
304  function &getByUserId($userId, $contextId = null){
305  $params = array((int) $userId);
306  if ($contextId) {
307  $params[] = (int) $contextId;
308  }
309  $result =& $this->retrieve(
310  'SELECT ug.*
311  FROM user_groups ug
312  JOIN user_user_groups uug ON ug.user_group_id = uug.user_group_id
313  WHERE uug.user_id = ?' . ($contextId?' AND ug.context_id = ?':''),
314  $params
315  );
316 
317  $returner = new DAOResultFactory($result, $this, '_returnFromRow');
318  return $returner;
319  }
320 
327  function contextHasGroup($contextId, $userGroupId) {
328  $result =& $this->retrieve(
329  'SELECT count(*)
330  FROM user_groups ug
331  WHERE ug.user_group_id = ?
332  AND ug.context_id = ?',
333  array (
334  (int) $userGroupId,
335  (int) $contextId
336  )
337  );
338 
339  $returner = isset($result->fields[0]) && $result->fields[0] == 0 ? false : true;
340 
341  $result->Close();
342  unset($result);
343 
344  return $returner;
345  }
346 
351  function &getByContextId($contextId = null) {
352  $params = array();
353  if ($contextId) $params[] = (int) $contextId;
354  $result =& $this->retrieve(
355  'SELECT ug.*
356  FROM user_groups ug' .
357  ($contextId?' WHERE ug.context_id = ?':''),
358  $params);
359 
360  $returner = new DAOResultFactory($result, $this, '_returnFromRow');
361  return $returner;
362  }
363 
369  function getContextUsersCount($contextId, $userGroupId = null, $roleId = null) {
370  $params = array((int) $contextId);
371  if ($userGroupId) $params[] = (int) $userGroupId;
372  if ($roleId) $params[] = (int) $roleId;
373  $result =& $this->retrieve(
374  'SELECT COUNT(DISTINCT(uug.user_id))
375  FROM user_groups ug
376  JOIN user_user_groups uug ON ug.user_group_id = uug.user_group_id
377  WHERE context_id = ?' . ($userGroupId?' AND ug.user_group_id = ?':'') . ($roleId?' AND ug.role_id = ?':''),
378  $params
379  );
380 
381  $returner = $result->fields[0];
382 
383  $result->Close();
384  unset($result);
385 
386  return $returner;
387  }
388 
397  function &getUsersByContextId($contextId = null, $searchType = null, $search = null, $searchMatch = null, $dbResultRange = null) {
398  return $this->getUsersById(null, $contextId, $searchType, $search, $searchMatch, $dbResultRange);
399  }
400 
407  function &getUsersNotInRole($roleId, $contextId = null, $search = null) {
408  $params = array((int) $roleId);
409  if ($contextId) $params[] = (int) $contextId;
410  if(isset($search)) $params = array_merge($params, array_pad(array(), 5, '%' . $search . '%'));
411 
412  $result =& $this->retrieve(
413  'SELECT DISTINCT u.*
414  FROM users u, user_groups ug, user_user_groups uug
415  WHERE ug.user_group_id = uug.user_group_id AND
416  u.user_id = uug.user_id AND
417  ug.role_id <> ?' .
418  ($contextId?' AND ug.context_id = ?':'') .
419  (isset($search) ? ' AND (u.first_name LIKE ? OR u.middle_name LIKE ? OR u.last_name LIKE ? OR u.email LIKE ? OR u.username LIKE ?)':''),
420  $params
421  );
422 
423  $returner = new DAOResultFactory($result, $this->userDao, '_returnUserFromRowWithData');
424  return $returner;
425  }
426 
436  function &getUsersById($userGroupId = null, $contextId = null, $searchType = null, $search = null, $searchMatch = null, $dbResultRange = null) {
437  $paramArray = array();
438 
439  if (isset($userGroupId)) $paramArray[] = (int) $userGroupId;
440  if (isset($contextId)) $paramArray[] = (int) $contextId;
441 
442  // For security / resource usage reasons, a user group or context ID
443  // must be specified. Don't allow calls supplying neither.
444  if ($contextId === null && $userGroupId === null) return null;
445 
446  $searchSql = $this->_getSearchSql($searchType, $search, $searchMatch, $paramArray);
447 
448  $sql = 'SELECT DISTINCT u.*
449  FROM users AS u
450  LEFT JOIN user_settings us ON (us.user_id = u.user_id AND us.setting_name = "affiliation")
451  LEFT JOIN user_interests ui ON (u.user_id = ui.user_id)
452  LEFT JOIN controlled_vocab_entry_settings cves ON (ui.controlled_vocab_entry_id = cves.controlled_vocab_entry_id)
453  LEFT JOIN user_user_groups uug ON (uug.user_id = u.user_id)
454  LEFT JOIN user_groups ug ON (ug.user_group_id = uug.user_group_id) WHERE';
455 
456 
457  $sql .= (isset($userGroupId) ? ' ug.user_group_id = ? ' . (isset($contextId) ? 'AND ' : '') : ' ');
458  $sql .= (isset($contextId) ? ' ug.context_id = ? ' : ' ') . $searchSql;
459 
460  $result =& $this->retrieveRange(
461  $sql,
462  $paramArray,
463  $dbResultRange
464  );
465 
466  $returner = new DAOResultFactory($result, $this->userDao, '_returnUserFromRowWithData');
467  return $returner;
468  }
469 
477  function &getUsersWithNoUserGroupAssignments($filter = null, $allowDisabled = true, $dbResultRange = null) {
478 
479  $sql = 'SELECT DISTINCT u.*
480  FROM users AS u
481  LEFT JOIN user_settings us ON (us.user_id = u.user_id AND us.setting_name = "affiliation")
482  LEFT JOIN user_interests ui ON (u.user_id = ui.user_id)
483  LEFT JOIN controlled_vocab_entry_settings cves ON (ui.controlled_vocab_entry_id = cves.controlled_vocab_entry_id)
484  LEFT JOIN user_user_groups uug ON u.user_id=uug.user_id WHERE uug.user_group_id IS NULL ';
485 
486  $sql .= ($allowDisabled?'':' AND u.disabled = 0');
487 
488  $searchSql = '';
489  $paramArray = array();
490 
491  if (isset($filter)) {
492  $searchType = isset($filter['searchType']) ? $filter['searchType'] : null;
493  $search = isset($filter['search']) ? $filter['search'] : null;
494  $searchMatch = isset($filter['searchMatch']) ? $filter['searchMatch'] : null;
495 
496  $searchSql = $this->_getSearchSql($searchType, $search, $searchMatch, $paramArray);
497  $sql .= $searchSql;
498  }
499 
500  $result =& $this->retrieveRange($sql, $paramArray, $dbResultRange);
501  $returner = new DAOResultFactory($result, $this->userDao, '_returnUserFromRowWithData');
502  return $returner;
503  }
504 
505  //
506  // UserGroupAssignment related
507  //
512  function deleteAssignmentsByUserId($userId, $userGroupId = null) {
513  $this->userGroupAssignmentDao->deleteByUserId($userId, $userGroupId);
514  }
515 
520  function deleteAssignmentsByUserGroupId($userGroupId) {
521  $this->userGroupAssignmentDao->deleteAssignmentsByUserGroupId($userGroupId);
522  }
523 
529  function deleteAssignmentsByContextId($contextId, $userId = null) {
530  $this->userGroupAssignmentDao->deleteAssignmentsByContextId($contextId, $userId);
531  }
532 
538  function assignUserToGroup($userId, $groupId) {
539  $assignment =& $this->userGroupAssignmentDao->newDataObject();
540  $assignment->setUserId($userId);
541  $assignment->setUserGroupId($groupId);
542  return $this->userGroupAssignmentDao->insertAssignment($assignment);
543  }
544 
551  function removeUserFromGroup($userId, $groupId, $contextId) {
552  $assignments =& $this->userGroupAssignmentDao->getByUserId($userId, $contextId);
553  while ($assignment =& $assignments->next()) {
554  if ($assignment->getUserGroupId() == $groupId) {
555  $this->userGroupAssignmentDao->deleteAssignment($assignment);
556  }
557  unset($assignment);
558  }
559  }
560 
566  function removeAllStagesFromGroup($contextId, $userGroupId) {
567  $assignedStages = $this->getAssignedStagesByUserGroupId($contextId, $userGroupId);
568  foreach($assignedStages as $stageId => $stageLocaleKey) {
569  $this->removeGroupFromStage($contextId, $userGroupId, $stageId);
570  }
571  }
572 
573 
574  //
575  // Extra settings (not handled by rest of Dao)
576  //
585  function updateSetting($userGroupId, $name, $value, $type = null, $isLocalized = false) {
586  $keyFields = array('setting_name', 'locale', 'user_group_id');
587 
588  if (!$isLocalized) {
589  $value = $this->convertToDB($value, $type);
590  $this->replace('user_group_settings',
591  array(
592  'user_group_id' => (int) $userGroupId,
593  'setting_name' => $name,
594  'setting_value' => $value,
595  'setting_type' => $type,
596  'locale' => ''
597  ),
598  $keyFields
599  );
600  } else {
601  if (is_array($value)) foreach ($value as $locale => $localeValue) {
602  $this->update('DELETE FROM user_group_settings WHERE user_group_id = ? AND setting_name = ? AND locale = ?', array((int) $userGroupId, $name, $locale));
603  if (empty($localeValue)) continue;
604  $type = null;
605  $this->update('INSERT INTO user_group_settings
606  (user_group_id, setting_name, setting_value, setting_type, locale)
607  VALUES (?, ?, ?, ?, ?)',
608  array(
609  $userGroupId, $name, $this->convertToDB($localeValue, $type), $type, $locale
610  )
611  );
612  }
613  }
614  }
615 
616 
624  function &getSetting($userGroupId, $name, $locale = null) {
625  $params = array((int) $userGroupId, $name);
626  if ($locale) $params[] = $locale;
627  $result =& $this->retrieve(
628  'SELECT setting_name, setting_value, setting_type, locale
629  FROM user_group_settings
630  WHERE user_group_id = ? AND
631  setting_name = ?' .
632  ($locale?' AND locale = ?':''),
633  $params
634  );
635 
636  $recordCount = $result->RecordCount();
637  $returner = false;
638  if ($recordCount == 1) {
639  $row =& $result->getRowAssoc(false);
640  $returner =& $this->convertFromDB($row['setting_value'], $row['setting_type']);
641  } elseif ($recordCount > 1) {
642  $returner = array();
643  while (!$result->EOF) {
644  $returner[$row['locale']] = $this->convertFromDB($row['setting_value'], $row['setting_type']);
645  $result->MoveNext();
646  }
647  $result->Close();
648  unset($result);
649  }
650  return $returner;
651  }
652 
653  //
654  // Install/Defaults with settings
655  //
656 
662  function installSettings($contextId, $filename) {
663  $xmlParser = new XMLParser();
664  $tree = $xmlParser->parse($filename);
665 
666  if (!$tree) {
667  $xmlParser->destroy();
668  return false;
669  }
670 
671  foreach ($tree->getChildren() as $setting) {
672  $roleId = hexdec($setting->getAttribute('roleId'));
673  $nameKey = $setting->getAttribute('name');
674  $abbrevKey = $setting->getAttribute('abbrev');
675  $defaultStages = explode(",", $setting->getAttribute('stages'));
676  $userGroup =& $this->newDataObject();
677 
678  // create a role associated with this user group
679  $role = new Role($roleId);
680  $userGroup =& $this->newDataObject();
681  $userGroup->setRoleId($roleId);
682  $userGroup->setPath($role->getPath());
683  $userGroup->setContextId($contextId);
684  $userGroup->setDefault(true);
685 
686  // insert the group into the DB
687  $userGroupId = $this->insertUserGroup($userGroup);
688 
689  // Install default groups for each stage
690  foreach ($defaultStages as $stageId) {
691  if (!empty($stageId) && $stageId <= WORKFLOW_STAGE_ID_PRODUCTION && $stageId >= WORKFLOW_STAGE_ID_SUBMISSION) {
692  $this->assignGroupToStage($contextId, $userGroupId, $stageId);
693  }
694  }
695 
696  // add the i18n keys to the settings table so that they
697  // can be used when a new locale is added/reloaded
698  $this->updateSetting($userGroup->getId(), 'nameLocaleKey', $nameKey);
699  $this->updateSetting($userGroup->getId(), 'abbrevLocaleKey', $abbrevKey);
700 
701  // install the settings in the current locale for this context
702  $this->installLocale(AppLocale::getLocale(), $contextId);
703  }
704  }
705 
711  function installLocale($locale, $contextId = null) {
712  $userGroups =& $this->getByContextId($contextId);
713  while (!$userGroups->eof()) {
714  $userGroup =& $userGroups->next();
715  $nameKey = $this->getSetting($userGroup->getId(), 'nameLocaleKey');
716  $this->updateSetting($userGroup->getId(),
717  'name',
718  array($locale => __($nameKey, null, $locale)),
719  'string',
720  $locale,
721  true
722  );
723 
724  $abbrevKey = $this->getSetting($userGroup->getId(), 'abbrevLocaleKey');
725  $this->updateSetting($userGroup->getId(),
726  'abbrev',
727  array($locale => __($abbrevKey, null, $locale)),
728  'string',
729  $locale,
730  true
731  );
732  unset($userGroup);
733  }
734  }
735 
740  function deleteSettingsByLocale($locale) {
741  $result = $this->update('DELETE FROM user_group_settings WHERE locale = ?', $locale);
742  return $result;
743  }
744 
752  function _getSearchSql($searchType, $search, $searchMatch, &$paramArray) {
753 
754  $searchTypeMap = array(
755  USER_FIELD_FIRSTNAME => 'u.first_name',
756  USER_FIELD_LASTNAME => 'u.last_name',
757  USER_FIELD_USERNAME => 'u.username',
758  USER_FIELD_EMAIL => 'u.email',
759  USER_FIELD_AFFILIATION => 'us.setting_value'
760  );
761 
762  $searchSql = '';
763 
764  if (!empty($search)) {
765 
766  if (!isset($searchTypeMap[$searchType])) {
767  $concatFields = ' ( LOWER(CONCAT(' . join(', ', $searchTypeMap) . ')) LIKE ? OR LOWER(cves.setting_value) LIKE ? ) ';
768 
769  $search = strtolower($search);
770 
771  $words = preg_split('{\s+}', $search);
772  $searchFieldMap = array();
773 
774  foreach ($words as $word) {
775  $searchFieldMap[] = $concatFields;
776  $term = '%' . $word . '%';
777  array_push($paramArray, $term, $term);
778  }
779 
780  $searchSql .= ' AND ( ' . join(' AND ', $searchFieldMap) . ' ) ';
781  } else {
782  $fieldName = $searchTypeMap[$searchType];
783  switch ($searchMatch) {
784  case 'is':
785  $searchSql = "AND LOWER($fieldName) = LOWER(?)";
786  $paramArray[] = $search;
787  break;
788  case 'contains':
789  $searchSql = "AND LOWER($fieldName) LIKE LOWER(?)";
790  $paramArray[] = '%' . $search . '%';
791  break;
792  case 'startsWith':
793  $searchSql = "AND LOWER($fieldName) LIKE LOWER(?)";
794  $paramArray[] = $search . '%';
795  break;
796  }
797  }
798  } else {
799  switch ($searchType) {
800  case USER_FIELD_USERID:
801  $searchSql = 'AND u.user_id = ?';
802  break;
803  case USER_FIELD_INITIAL:
804  $searchSql = 'AND LOWER(u.last_name) LIKE LOWER(?)';
805  break;
806  }
807  }
808 
809  $searchSql .= ' ORDER BY u.last_name, u.first_name'; // FIXME Add "sort field" parameter?
810 
811  return $searchSql;
812  }
813 }
814 
815 ?>
& getUsersWithNoUserGroupAssignments($filter=null, $allowDisabled=true, $dbResultRange=null)
Operations for retrieving and modifying objects from a database.
Definition: DAO.inc.php:29
userInAnyGroup($userId, $contextId=null)
getContextUsersCount($contextId, $userGroupId=null, $roleId=null)
removeUserFromGroup($userId, $groupId, $contextId)
deleteByContextId($contextId)
& retrieve($sql, $params=false, $callHooks=true)
Definition: DAO.inc.php:83
getInsertId($table= '', $id= '', $callHooks=true)
Definition: DAO.inc.php:252
& getUsersByContextId($contextId=null, $searchType=null, $search=null, $searchMatch=null, $dbResultRange=null)
updateDataObjectSettings($tableName, &$dataObject, $idArray)
Definition: DAO.inc.php:460
& getByUserId($userId, $contextId=null)
Describes user roles within the system and the associated permissions.
Definition: Role.inc.php:30
& retrieveRange($sql, $params=false, $dbResultRange=null, $callHooks=true)
Definition: DAO.inc.php:176
userInGroup($userId, $userGroupId)
& getDefaultByRoleId($contextId, $roleId)
& getUsersNotInRole($roleId, $contextId=null, $search=null)
deleteAssignmentsByContextId($contextId, $userId=null)
contextHasGroup($contextId, $userGroupId)
Describes user groups.
removeAllStagesFromGroup($contextId, $userGroupId)
Wrapper around ADORecordSet providing &quot;factory&quot; features for generating objects from DAOs...
convertFromDB($value, $type)
Definition: DAO.inc.php:338
deleteUserGroup(&$userGroup)
Generic class for parsing an XML document into a data structure.
Operations for retrieving and modifying User Groups and user group assignments FIXME: Some of the con...
& getDAO($name, $dbconn=null)
installSettings($contextId, $filename)
& getUserGroupIdsByRoleId($roleId, $contextId=null)
updateLocaleFields(&$userGroup)
& getByContextId($contextId=null)
insertUserGroup(&$userGroup)
deleteAssignmentsByUserId($userId, $userGroupId=null)
convertToDB($value, &$type)
Definition: DAO.inc.php:394
& getSetting($userGroupId, $name, $locale=null)
_getSearchSql($searchType, $search, $searchMatch, &$paramArray)
call($hookName, $args=null)
deleteAssignmentsByUserGroupId($userGroupId)
installLocale($locale, $contextId=null)
assignUserToGroup($userId, $groupId)
& getByRoleId($contextId, $roleId, $default=false)
replace($table, $arrFields, $keyCols)
Definition: DAO.inc.php:240
getById($userGroupId, $contextId=null)
update($sql, $params=false, $callHooks=true, $dieOnError=true)
Definition: DAO.inc.php:211
deleteById($contextId, $userGroupId)
updateSetting($userGroupId, $name, $value, $type=null, $isLocalized=false)
& getUsersById($userGroupId=null, $contextId=null, $searchType=null, $search=null, $searchMatch=null, $dbResultRange=null)