dolibarr  16.0.5
api_users.class.php
1 <?php
2 /* Copyright (C) 2015 Jean-Fran├žois Ferry <jfefe@aternatik.fr>
3  * Copyright (C) 2020 Thibault FOUCART <support@ptibogxiv.net>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <https://www.gnu.org/licenses/>.
17  */
18 
19 use Luracast\Restler\RestException;
20 
21 require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
22 require_once DOL_DOCUMENT_ROOT.'/user/class/usergroup.class.php';
23 
24 
31 class Users extends DolibarrApi
32 {
36  static $FIELDS = array(
37  'login',
38  );
39 
43  public $useraccount;
44 
48  public function __construct()
49  {
50  global $db, $conf;
51 
52  $this->db = $db;
53  $this->useraccount = new User($this->db);
54  }
55 
56 
71  public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $user_ids = 0, $category = 0, $sqlfilters = '')
72  {
73  global $conf;
74 
75  if (empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin)) {
76  throw new RestException(401, "You are not allowed to read list of users");
77  }
78 
79  $obj_ret = array();
80 
81  // case of external user, $societe param is ignored and replaced by user's socid
82  //$socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $societe;
83 
84  $sql = "SELECT t.rowid";
85  $sql .= " FROM ".$this->db->prefix()."user as t";
86  if ($category > 0) {
87  $sql .= ", ".$this->db->prefix()."categorie_user as c";
88  }
89  $sql .= ' WHERE t.entity IN ('.getEntity('user').')';
90  if ($user_ids) {
91  $sql .= " AND t.rowid IN (".$this->db->sanitize($user_ids).")";
92  }
93 
94  // Select products of given category
95  if ($category > 0) {
96  $sql .= " AND c.fk_categorie = ".((int) $category);
97  $sql .= " AND c.fk_user = t.rowid";
98  }
99 
100  // Add sql filters
101  if ($sqlfilters) {
102  $errormessage = '';
103  if (!DolibarrApi::_checkFilters($sqlfilters, $errormessage)) {
104  throw new RestException(503, 'Error when validating parameter sqlfilters -> '.$errormessage);
105  }
106  $regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^\(\)]+)\)';
107  $sql .= " AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
108  }
109 
110  $sql .= $this->db->order($sortfield, $sortorder);
111  if ($limit) {
112  if ($page < 0) {
113  $page = 0;
114  }
115  $offset = $limit * $page;
116 
117  $sql .= $this->db->plimit($limit + 1, $offset);
118  }
119 
120  $result = $this->db->query($sql);
121 
122  if ($result) {
123  $i = 0;
124  $num = $this->db->num_rows($result);
125  $min = min($num, ($limit <= 0 ? $num : $limit));
126  while ($i < $min) {
127  $obj = $this->db->fetch_object($result);
128  $user_static = new User($this->db);
129  if ($user_static->fetch($obj->rowid)) {
130  $obj_ret[] = $this->_cleanObjectDatas($user_static);
131  }
132  $i++;
133  }
134  } else {
135  throw new RestException(503, 'Error when retrieve User list : '.$this->db->lasterror());
136  }
137  if (!count($obj_ret)) {
138  throw new RestException(404, 'No User found');
139  }
140  return $obj_ret;
141  }
142 
153  public function get($id, $includepermissions = 0)
154  {
155  if (empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin) && $id != 0 && DolibarrApiAccess::$user->id != $id) {
156  throw new RestException(401, 'Not allowed');
157  }
158 
159  if ($id == 0) {
160  $result = $this->useraccount->initAsSpecimen();
161  } else {
162  $result = $this->useraccount->fetch($id);
163  }
164  if (!$result) {
165  throw new RestException(404, 'User not found');
166  }
167 
168  if ($id > 0 && !DolibarrApi::_checkAccessToResource('user', $this->useraccount->id, 'user')) {
169  throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
170  }
171 
172  if ($includepermissions) {
173  $this->useraccount->getRights();
174  }
175 
176  return $this->_cleanObjectDatas($this->useraccount);
177  }
178 
192  public function getByLogin($login, $includepermissions = 0)
193  {
194  if (empty($login)) {
195  throw new RestException(400, 'Bad parameters');
196  }
197 
198  if (empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin) && DolibarrApiAccess::$user->login != $login) {
199  throw new RestException(401, 'Not allowed');
200  }
201 
202  $result = $this->useraccount->fetch('', $login);
203  if (!$result) {
204  throw new RestException(404, 'User not found');
205  }
206 
207  if (!DolibarrApi::_checkAccessToResource('user', $this->useraccount->id, 'user')) {
208  throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
209  }
210 
211  if ($includepermissions) {
212  $this->useraccount->getRights();
213  }
214 
215  return $this->_cleanObjectDatas($this->useraccount);
216  }
217 
231  public function getByEmail($email, $includepermissions = 0)
232  {
233  if (empty($email)) {
234  throw new RestException(400, 'Bad parameters');
235  }
236 
237  if (empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin) && DolibarrApiAccess::$user->email != $email) {
238  throw new RestException(401, 'Not allowed');
239  }
240 
241  $result = $this->useraccount->fetch('', '', '', 0, -1, $email);
242  if (!$result) {
243  throw new RestException(404, 'User not found');
244  }
245 
246  if (!DolibarrApi::_checkAccessToResource('user', $this->useraccount->id, 'user')) {
247  throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
248  }
249 
250  if ($includepermissions) {
251  $this->useraccount->getRights();
252  }
253 
254  return $this->_cleanObjectDatas($this->useraccount);
255  }
256 
268  public function getInfo($includepermissions = 0)
269  {
270  if (empty(DolibarrApiAccess::$user->rights->user->self->creer) && empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin)) {
271  throw new RestException(401, 'Not allowed');
272  }
273 
274  $apiUser = DolibarrApiAccess::$user;
275 
276  $result = $this->useraccount->fetch($apiUser->id);
277  if (!$result) {
278  throw new RestException(404, 'User not found');
279  }
280 
281  if (!DolibarrApi::_checkAccessToResource('user', $this->useraccount->id, 'user')) {
282  throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
283  }
284 
285  if ($includepermissions) {
286  $this->useraccount->getRights();
287  }
288 
289  $usergroup = new UserGroup($this->db);
290  $userGroupList = $usergroup->listGroupsForUser($apiUser->id, false);
291  if (!is_array($userGroupList)) {
292  throw new RestException(404, 'User group not found');
293  }
294 
295  $this->useraccount->user_group_list = $this->_cleanUserGroupListDatas($userGroupList);
296 
297  return $this->_cleanObjectDatas($this->useraccount);
298  }
299 
308  public function post($request_data = null)
309  {
310  // Check user authorization
311  if (empty(DolibarrApiAccess::$user->rights->user->creer) && empty(DolibarrApiAccess::$user->admin)) {
312  throw new RestException(401, "User creation not allowed for login ".DolibarrApiAccess::$user->login);
313  }
314 
315  // check mandatory fields
316  /*if (!isset($request_data["login"]))
317  throw new RestException(400, "login field missing");
318  if (!isset($request_data["password"]))
319  throw new RestException(400, "password field missing");
320  if (!isset($request_data["lastname"]))
321  throw new RestException(400, "lastname field missing");*/
322 
323  //assign field values
324  foreach ($request_data as $field => $value) {
325  if (in_array($field, array('pass_crypted', 'pass_indatabase', 'pass_indatabase_crypted', 'pass_temp', 'api_key'))) {
326  // This properties can't be set/modified with API
327  throw new RestException(401, 'The property '.$field." can't be set/modified using the APIs");
328  }
329  /*if ($field == 'pass') {
330  if (empty(DolibarrApiAccess::$user->rights->user->user->password)) {
331  throw new RestException(401, 'You are not allowed to modify/set password of other users');
332  continue;
333  }
334  }
335  */
336 
337  $this->useraccount->$field = $value;
338  }
339 
340  if ($this->useraccount->create(DolibarrApiAccess::$user) < 0) {
341  throw new RestException(500, 'Error creating', array_merge(array($this->useraccount->error), $this->useraccount->errors));
342  }
343  return $this->useraccount->id;
344  }
345 
346 
358  public function put($id, $request_data = null)
359  {
360  // Check user authorization
361  if (empty(DolibarrApiAccess::$user->rights->user->user->creer) && empty(DolibarrApiAccess::$user->admin)) {
362  throw new RestException(401, "User update not allowed");
363  }
364 
365  $result = $this->useraccount->fetch($id);
366  if (!$result) {
367  throw new RestException(404, 'Account not found');
368  }
369 
370  if (!DolibarrApi::_checkAccessToResource('user', $this->useraccount->id, 'user')) {
371  throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
372  }
373 
374  foreach ($request_data as $field => $value) {
375  if ($field == 'id') {
376  continue;
377  }
378  if (in_array($field, array('pass_crypted', 'pass_indatabase', 'pass_indatabase_crypted', 'pass_temp', 'api_key'))) {
379  // This properties can't be set/modified with API
380  throw new RestException(401, 'The property '.$field." can't be set/modified using the APIs");
381  }
382  if ($field == 'pass') {
383  if ($this->useraccount->id != DolibarrApiAccess::$user->id && empty(DolibarrApiAccess::$user->rights->user->user->password)) {
384  throw new RestException(401, 'You are not allowed to modify password of other users');
385  }
386  if ($this->useraccount->id == DolibarrApiAccess::$user->id && empty(DolibarrApiAccess::$user->rights->user->self->password)) {
387  throw new RestException(401, 'You are not allowed to modify your own password');
388  }
389  }
390  if (DolibarrApiAccess::$user->admin) { // If user for API is admin
391  if ($field == 'admin' && $value != $this->useraccount->admin && empty($value)) {
392  throw new RestException(401, 'Reseting the admin status of a user is not possible using the API');
393  }
394  } else {
395  if ($field == 'admin' && $value != $this->useraccount->admin) {
396  throw new RestException(401, 'Only an admin user can modify the admin status of another user');
397  }
398  }
399  if ($field == 'entity' && $value != $this->useraccount->entity) {
400  throw new RestException(401, 'Changing entity of a user using the APIs is not possible');
401  }
402  // The status must be updated using setstatus() because it
403  // is not handled by the update() method.
404  if ($field == 'statut') {
405  $result = $this->useraccount->setstatus($value);
406  if ($result < 0) {
407  throw new RestException(500, 'Error when updating status of user: '.$this->useraccount->error);
408  }
409  } else {
410  $this->useraccount->$field = $value;
411  }
412  }
413 
414  // If there is no error, update() returns the number of affected
415  // rows so if the update is a no op, the return value is zezo.
416  if ($this->useraccount->update(DolibarrApiAccess::$user) >= 0) {
417  return $this->get($id);
418  } else {
419  throw new RestException(500, $this->useraccount->error);
420  }
421  }
422 
423 
435  public function getGroups($id)
436  {
437  if (empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin)) {
438  throw new RestException(403);
439  }
440 
441  $obj_ret = array();
442 
443  $user = new User($this->db);
444  $result = $user->fetch($id);
445  if (!$result) {
446  throw new RestException(404, 'user not found');
447  }
448 
449  $usergroup = new UserGroup($this->db);
450  $groups = $usergroup->listGroupsForUser($id, false);
451  $obj_ret = array();
452  foreach ($groups as $group) {
453  $obj_ret[] = $this->_cleanObjectDatas($group);
454  }
455  return $obj_ret;
456  }
457 
458 
473  public function setGroup($id, $group, $entity = 1)
474  {
475  global $conf;
476 
477  if (empty(DolibarrApiAccess::$user->rights->user->user->creer) && empty(DolibarrApiAccess::$user->admin)) {
478  throw new RestException(401);
479  }
480 
481  $result = $this->useraccount->fetch($id);
482  if (!$result) {
483  throw new RestException(404, 'User not found');
484  }
485 
486  if (!DolibarrApi::_checkAccessToResource('user', $this->useraccount->id, 'user')) {
487  throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
488  }
489 
490  if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && !empty(DolibarrApiAccess::$user->admin) && empty(DolibarrApiAccess::$user->entity)) {
491  $entity = (!empty($entity) ? $entity : $conf->entity);
492  } else {
493  // When using API, action is done on entity of logged user because a user of entity X with permission to create user should not be able to
494  // hack the security by giving himself permissions on another entity.
495  $entity = (DolibarrApiAccess::$user->entity > 0 ? DolibarrApiAccess::$user->entity : $conf->entity);
496  }
497 
498  $result = $this->useraccount->SetInGroup($group, $entity);
499  if (!($result > 0)) {
500  throw new RestException(500, $this->useraccount->error);
501  }
502 
503  return 1;
504  }
505 
524  public function listGroups($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $group_ids = 0, $sqlfilters = '')
525  {
526  global $conf;
527 
528  $obj_ret = array();
529 
530  if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin)) ||
531  !empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty(DolibarrApiAccess::$user->rights->user->group_advance->read) && empty(DolibarrApiAccess::$user->admin)) {
532  throw new RestException(401, "You are not allowed to read groups");
533  }
534 
535  // case of external user, $societe param is ignored and replaced by user's socid
536  //$socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $societe;
537 
538  $sql = "SELECT t.rowid";
539  $sql .= " FROM ".$this->db->prefix()."usergroup as t";
540  $sql .= ' WHERE t.entity IN ('.getEntity('user').')';
541  if ($group_ids) {
542  $sql .= " AND t.rowid IN (".$this->db->sanitize($group_ids).")";
543  }
544  // Add sql filters
545  if ($sqlfilters) {
546  $errormessage = '';
547  if (!DolibarrApi::_checkFilters($sqlfilters, $errormessage)) {
548  throw new RestException(503, 'Error when validating parameter sqlfilters -> '.$errormessage);
549  }
550  $regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^\(\)]+)\)';
551  $sql .= " AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
552  }
553 
554  $sql .= $this->db->order($sortfield, $sortorder);
555  if ($limit) {
556  if ($page < 0) {
557  $page = 0;
558  }
559  $offset = $limit * $page;
560 
561  $sql .= $this->db->plimit($limit + 1, $offset);
562  }
563 
564  $result = $this->db->query($sql);
565 
566  if ($result) {
567  $i = 0;
568  $num = $this->db->num_rows($result);
569  $min = min($num, ($limit <= 0 ? $num : $limit));
570  while ($i < $min) {
571  $obj = $this->db->fetch_object($result);
572  $group_static = new UserGroup($this->db);
573  if ($group_static->fetch($obj->rowid)) {
574  $obj_ret[] = $this->_cleanObjectDatas($group_static);
575  }
576  $i++;
577  }
578  } else {
579  throw new RestException(503, 'Error when retrieve Group list : '.$this->db->lasterror());
580  }
581  if (!count($obj_ret)) {
582  throw new RestException(404, 'No Group found');
583  }
584  return $obj_ret;
585  }
586 
601  public function infoGroups($group, $load_members = 0)
602  {
603  global $db, $conf;
604 
605  if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin)) ||
606  !empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty(DolibarrApiAccess::$user->rights->user->group_advance->read) && empty(DolibarrApiAccess::$user->admin)) {
607  throw new RestException(401, "You are not allowed to read groups");
608  }
609 
610  $group_static = new UserGroup($this->db);
611  $result = $group_static->fetch($group, '', $load_members);
612 
613  if (!$result) {
614  throw new RestException(404, 'Group not found');
615  }
616 
617  return $this->_cleanObjectDatas($group_static);
618  }
619 
629  public function delete($id)
630  {
631  if (empty(DolibarrApiAccess::$user->rights->user->user->supprimer) && empty(DolibarrApiAccess::$user->admin)) {
632  throw new RestException(401, 'Not allowed');
633  }
634  $result = $this->useraccount->fetch($id);
635  if (!$result) {
636  throw new RestException(404, 'User not found');
637  }
638 
639  if (!DolibarrApi::_checkAccessToResource('user', $this->useraccount->id, 'user')) {
640  throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
641  }
642  $this->useraccount->oldcopy = clone $this->useraccount;
643 
644  if (!$this->useraccount->delete(DolibarrApiAccess::$user)) {
645  throw new RestException(500);
646  }
647 
648  return array(
649  'success' => array(
650  'code' => 200,
651  'message' => 'Ticket deleted'
652  )
653  );
654  }
655 
656  // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
663  protected function _cleanObjectDatas($object)
664  {
665  // phpcs:enable
666  global $conf;
667 
668  $object = parent::_cleanObjectDatas($object);
669 
670  unset($object->default_values);
671  unset($object->lastsearch_values);
672  unset($object->lastsearch_values_tmp);
673 
674  unset($object->total_ht);
675  unset($object->total_tva);
676  unset($object->total_localtax1);
677  unset($object->total_localtax2);
678  unset($object->total_ttc);
679 
680  unset($object->label_incoterms);
681  unset($object->location_incoterms);
682 
683  unset($object->fk_delivery_address);
684  unset($object->fk_incoterms);
685  unset($object->all_permissions_are_loaded);
686  unset($object->shipping_method_id);
687  unset($object->nb_rights);
688  unset($object->search_sid);
689  unset($object->ldap_sid);
690  unset($object->clicktodial_loaded);
691 
692  // List of properties never returned by API, whatever are permissions
693  unset($object->pass);
694  unset($object->pass_indatabase);
695  unset($object->pass_indatabase_crypted);
696  unset($object->pass_temp);
697  unset($object->api_key);
698  unset($object->clicktodial_password);
699  unset($object->openid);
700 
701  unset($object->lines);
702  unset($object->model_pdf);
703 
704  unset($object->skype);
705  unset($object->twitter);
706  unset($object->facebook);
707  unset($object->linkedin);
708 
709  $canreadsalary = ((!empty($conf->salaries->enabled) && !empty(DolibarrApiAccess::$user->rights->salaries->read)) || (empty($conf->salaries->enabled)));
710 
711  if (!$canreadsalary) {
712  unset($object->salary);
713  unset($object->salaryextra);
714  unset($object->thm);
715  unset($object->tjm);
716  }
717 
718  return $object;
719  }
720 
727  private function _cleanUserGroupListDatas($objectList)
728  {
729  $cleanObjectList = array();
730 
731  foreach ($objectList as $object) {
732  $cleanObject = parent::_cleanObjectDatas($object);
733 
734  unset($cleanObject->default_values);
735  unset($cleanObject->lastsearch_values);
736  unset($cleanObject->lastsearch_values_tmp);
737 
738  unset($cleanObject->total_ht);
739  unset($cleanObject->total_tva);
740  unset($cleanObject->total_localtax1);
741  unset($cleanObject->total_localtax2);
742  unset($cleanObject->total_ttc);
743 
744  unset($cleanObject->libelle_incoterms);
745  unset($cleanObject->location_incoterms);
746 
747  unset($cleanObject->fk_delivery_address);
748  unset($cleanObject->fk_incoterms);
749  unset($cleanObject->all_permissions_are_loaded);
750  unset($cleanObject->shipping_method_id);
751  unset($cleanObject->nb_rights);
752  unset($cleanObject->search_sid);
753  unset($cleanObject->ldap_sid);
754  unset($cleanObject->clicktodial_loaded);
755 
756  unset($cleanObject->datec);
757  unset($cleanObject->datem);
758  unset($cleanObject->members);
759  unset($cleanObject->note);
760  unset($cleanObject->note_private);
761 
762  $cleanObjectList[] = $cleanObject;
763  }
764 
765  return $cleanObjectList;
766  }
767 
775  private function _validate($data)
776  {
777  $account = array();
778  foreach (Users::$FIELDS as $field) {
779  if (!isset($data[$field])) {
780  throw new RestException(400, "$field field missing");
781  }
782  $account[$field] = $data[$field];
783  }
784  return $account;
785  }
786 }
Users\post
post($request_data=null)
Create user account.
Definition: api_users.class.php:308
db
$conf db
API class for accounts.
Definition: inc.php:41
Users\put
put($id, $request_data=null)
Update user account.
Definition: api_users.class.php:358
Users\setGroup
setGroup($id, $group, $entity=1)
Add a user into a group.
Definition: api_users.class.php:473
UserGroup
Class to manage user groups.
Definition: usergroup.class.php:39
Users\_cleanObjectDatas
_cleanObjectDatas($object)
Clean sensible object datas.
Definition: api_users.class.php:663
Users\__construct
__construct()
Constructor.
Definition: api_users.class.php:48
DolibarrApi\_checkAccessToResource
static _checkAccessToResource($resource, $resource_id=0, $dbtablename='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid')
Check access by user to a given resource.
Definition: api.class.php:283
DolibarrApi
Class for API REST v1.
Definition: api.class.php:30
Users\_cleanUserGroupListDatas
_cleanUserGroupListDatas($objectList)
Clean sensible user group list datas.
Definition: api_users.class.php:727
Users\listGroups
listGroups($sortfield="t.rowid", $sortorder='ASC', $limit=100, $page=0, $group_ids=0, $sqlfilters='')
List Groups.
Definition: api_users.class.php:524
Users\getGroups
getGroups($id)
List the groups of a user.
Definition: api_users.class.php:435
Users\getByEmail
getByEmail($email, $includepermissions=0)
Get properties of an user object by Email.
Definition: api_users.class.php:231
Users\getByLogin
getByLogin($login, $includepermissions=0)
Get properties of an user object by login.
Definition: api_users.class.php:192
DolibarrApi\_checkFilters
_checkFilters($sqlfilters, &$error='')
Return if a $sqlfilters parameter is valid.
Definition: api.class.php:310
User
Class to manage Dolibarr users.
Definition: user.class.php:44
Users\getInfo
getInfo($includepermissions=0)
Get more properties of a user.
Definition: api_users.class.php:268
Users\_validate
_validate($data)
Validate fields before create or update object.
Definition: api_users.class.php:775
Users\index
index($sortfield="t.rowid", $sortorder='ASC', $limit=100, $page=0, $user_ids=0, $category=0, $sqlfilters='')
List Users.
Definition: api_users.class.php:71
Users\infoGroups
infoGroups($group, $load_members=0)
Get properties of an group object.
Definition: api_users.class.php:601
Users
Definition: api_users.class.php:31