|
| __construct () |
| Constructor.
|
|
| index ($sortfield="t.rowid", $sortorder='ASC', $limit=100, $page=0, $user_ids=0, $category=0, $sqlfilters='') |
| List Users. More...
|
|
| get ($id, $includepermissions=0) |
| Get properties of an user object. More...
|
|
| getByLogin ($login, $includepermissions=0) |
| Get properties of an user object by login. More...
|
|
| getByEmail ($email, $includepermissions=0) |
| Get properties of an user object by Email. More...
|
|
| getInfo ($includepermissions=0) |
| Get more properties of a user. More...
|
|
| post ($request_data=null) |
| Create user account. More...
|
|
| put ($id, $request_data=null) |
| Update user account. More...
|
|
| getGroups ($id) |
| List the groups of a user. More...
|
|
| setGroup ($id, $group, $entity=1) |
| Add a user into a group. More...
|
|
| listGroups ($sortfield="t.rowid", $sortorder='ASC', $limit=100, $page=0, $group_ids=0, $sqlfilters='') |
| List Groups. More...
|
|
| infoGroups ($group, $load_members=0) |
| Get properties of an group object. More...
|
|
| delete ($id) |
| Delete account/user. More...
|
|
| __construct ($db, $cachedir='', $refreshCache=false) |
| Constructor. More...
|
|
Definition at line 31 of file api_users.class.php.
◆ _cleanObjectDatas()
Users::_cleanObjectDatas |
( |
|
$object | ) |
|
|
protected |
Clean sensible object datas.
- Parameters
-
Object | $object | Object to clean |
- Returns
- Object Object with cleaned properties
Reimplemented from DolibarrApi.
Definition at line 663 of file api_users.class.php.
◆ _cleanUserGroupListDatas()
Users::_cleanUserGroupListDatas |
( |
|
$objectList | ) |
|
|
private |
Clean sensible user group list datas.
- Parameters
-
array | $objectList | Array of object to clean |
- Returns
- array Array of cleaned object properties
Definition at line 727 of file api_users.class.php.
◆ _validate()
Users::_validate |
( |
|
$data | ) |
|
|
private |
Validate fields before create or update object.
- Parameters
-
array | null | $data | Data to validate |
- Returns
- array
- Exceptions
-
Definition at line 775 of file api_users.class.php.
◆ delete()
Delete account/user.
- Parameters
-
- Returns
- array
- Exceptions
-
RestException | 401 Not allowed |
RestException | 404 User not found |
Definition at line 629 of file api_users.class.php.
◆ get()
Users::get |
( |
|
$id, |
|
|
|
$includepermissions = 0 |
|
) |
| |
Get properties of an user object.
- Parameters
-
int | $id | ID of user |
int | $includepermissions | Set this to 1 to have the array of permissions loaded (not done by default for performance purpose) |
- Returns
- array|mixed data without useless information
- Exceptions
-
RestException | 401 Insufficient rights |
RestException | 404 User or group not found |
Definition at line 153 of file api_users.class.php.
◆ getByEmail()
Users::getByEmail |
( |
|
$email, |
|
|
|
$includepermissions = 0 |
|
) |
| |
Get properties of an user object by Email.
- Parameters
-
string | $email | Email of user |
int | $includepermissions | Set this to 1 to have the array of permissions loaded (not done by default for performance purpose) |
- Returns
- array|mixed Data without useless information
@url GET email/{email}
- Exceptions
-
RestException | 400 Bad request |
RestException | 401 Insufficient rights |
RestException | 404 User or group not found |
Definition at line 231 of file api_users.class.php.
◆ getByLogin()
Users::getByLogin |
( |
|
$login, |
|
|
|
$includepermissions = 0 |
|
) |
| |
Get properties of an user object by login.
- Parameters
-
string | $login | Login of user |
int | $includepermissions | Set this to 1 to have the array of permissions loaded (not done by default for performance purpose) |
- Returns
- array|mixed Data without useless information
@url GET login/{login}
- Exceptions
-
RestException | 400 Bad request |
RestException | 401 Insufficient rights |
RestException | 404 User or group not found |
Definition at line 192 of file api_users.class.php.
◆ getGroups()
List the groups of a user.
- Parameters
-
- Returns
- array Array of group objects
- Exceptions
-
RestException | 403 Not allowed |
RestException | 404 Not found |
@url GET {id}/groups
Definition at line 435 of file api_users.class.php.
◆ getInfo()
Users::getInfo |
( |
|
$includepermissions = 0 | ) |
|
Get more properties of a user.
@url GET /info
- Parameters
-
int | $includepermissions | Set this to 1 to have the array of permissions loaded (not done by default for performance purpose) |
- Returns
- array|mixed Data without useless information
- Exceptions
-
RestException | 401 Insufficient rights |
RestException | 404 User or group not found |
Definition at line 268 of file api_users.class.php.
◆ index()
Users::index |
( |
|
$sortfield = "t.rowid" , |
|
|
|
$sortorder = 'ASC' , |
|
|
|
$limit = 100 , |
|
|
|
$page = 0 , |
|
|
|
$user_ids = 0 , |
|
|
|
$category = 0 , |
|
|
|
$sqlfilters = '' |
|
) |
| |
List Users.
Get a list of Users
- Parameters
-
string | $sortfield | Sort field |
string | $sortorder | Sort order |
int | $limit | Limit for list |
int | $page | Page number |
string | $user_ids | User ids filter field. Example: '1' or '1,2,3' {@pattern /^[0-9,]*$/i} |
int | $category | Use this param to filter list by category |
string | $sqlfilters | Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')" |
- Returns
- array Array of User objects
Definition at line 71 of file api_users.class.php.
◆ infoGroups()
Users::infoGroups |
( |
|
$group, |
|
|
|
$load_members = 0 |
|
) |
| |
Get properties of an group object.
Return an array with group informations
@url GET /groups/{group}
- Parameters
-
int | $group | ID of group |
int | $load_members | Load members list or not {@min 0} {@max 1} |
- Returns
- array Array of User objects
- Exceptions
-
RestException | 401 Not allowed |
RestException | 404 User not found |
Definition at line 601 of file api_users.class.php.
◆ listGroups()
Users::listGroups |
( |
|
$sortfield = "t.rowid" , |
|
|
|
$sortorder = 'ASC' , |
|
|
|
$limit = 100 , |
|
|
|
$page = 0 , |
|
|
|
$group_ids = 0 , |
|
|
|
$sqlfilters = '' |
|
) |
| |
List Groups.
Return an array with a list of Groups
@url GET /groups
- Parameters
-
string | $sortfield | Sort field |
string | $sortorder | Sort order |
int | $limit | Limit for list |
int | $page | Page number |
string | $group_ids | Groups ids filter field. Example: '1' or '1,2,3' {@pattern /^[0-9,]*$/i} |
string | $sqlfilters | Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')" |
- Returns
- array Array of User objects
- Exceptions
-
RestException | 404 User not found |
RestException | 503 Error |
Definition at line 524 of file api_users.class.php.
◆ post()
Users::post |
( |
|
$request_data = null | ) |
|
Create user account.
- Parameters
-
array | $request_data | New user data |
- Returns
- int
- Exceptions
-
RestException | 401 Not allowed |
Definition at line 308 of file api_users.class.php.
◆ put()
Users::put |
( |
|
$id, |
|
|
|
$request_data = null |
|
) |
| |
Update user account.
- Parameters
-
int | $id | Id of account to update |
array | $request_data | Datas |
- Returns
- array|mixed Record after update
- Exceptions
-
RestException | 401 Not allowed |
RestException | 404 Not found |
RestException | 500 System error |
Definition at line 358 of file api_users.class.php.
◆ setGroup()
Users::setGroup |
( |
|
$id, |
|
|
|
$group, |
|
|
|
$entity = 1 |
|
) |
| |
Add a user into a group.
- Parameters
-
int | $id | User ID |
int | $group | Group ID |
int | $entity | Entity ID (valid only for superadmin in multicompany transverse mode) |
- Returns
- int 1 if success
- Exceptions
-
RestException | 401 Not allowed |
RestException | 404 User not found |
RestException | 500 System error |
@url GET {id}/setGroup/{group}
Definition at line 473 of file api_users.class.php.
The documentation for this class was generated from the following file: