|
dolibarr
13.0.2
|
Inheritance diagram for Users:
Collaboration diagram for Users:Public Member Functions | |
| __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 properties of user connected. More... | |
| post ($request_data=null) | |
| Create user account. More... | |
| put ($id, $request_data=null) | |
| Update 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. More... | |
Public Member Functions inherited from DolibarrApi | |
| __construct ($db, $cachedir= '', $refreshCache=false) | |
| Constructor. More... | |
Protected Member Functions | |
| _cleanObjectDatas ($object) | |
| Clean sensible object datas. More... | |
Protected Member Functions inherited from DolibarrApi | |
| _cleanObjectDatas ($object) | |
| Executed method when API is called without parameter. More... | |
| _checkFilters ($sqlfilters) | |
| Return if a $sqlfilters parameter is valid. More... | |
Private Member Functions | |
| _cleanUserGroupListDatas ($objectList) | |
| Clean sensible user group list datas. More... | |
| _validate ($data) | |
| Validate fields before create or update object. More... | |
Additional Inherited Members | |
Static Protected Member Functions inherited from DolibarrApi | |
| static | _checkAccessToResource ($resource, $resource_id=0, $dbtablename= '', $feature2= '', $dbt_keyfield= 'fk_soc', $dbt_select= 'rowid') |
| Check user access to a resource. More... | |
| static | _forge_criteria_callback ($matches) |
| Function to forge a SQL criteria. More... | |
Definition at line 30 of file api_users.class.php.
|
protected |
Clean sensible object datas.
| Object | $object | Object to clean |
Definition at line 579 of file api_users.class.php.
Referenced by get(), getByEmail(), getByLogin(), getGroups(), getInfo(), index(), infoGroups(), and listGroups().
|
private |
Clean sensible user group list datas.
| array | $objectList | Array of object to clean |
Definition at line 643 of file api_users.class.php.
Referenced by getInfo().
|
private |
Validate fields before create or update object.
| array | null | $data | Data to validate |
| RestException |
Definition at line 691 of file api_users.class.php.
| Users::delete | ( | $id | ) |
Delete account.
| int | $id | Account ID |
Definition at line 555 of file api_users.class.php.
References DolibarrApi\_checkAccessToResource().
| Users::get | ( | $id, | |
$includepermissions = 0 |
|||
| ) |
Get properties of an user object.
| 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) |
| RestException | 401 Insufficient rights |
| RestException | 404 User or group not found |
Definition at line 151 of file api_users.class.php.
References DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
| Users::getByEmail | ( | $email, | |
$includepermissions = 0 |
|||
| ) |
Get properties of an user object by Email.
| string | Email of user | |
| int | $includepermissions | Set this to 1 to have the array of permissions loaded (not done by default for performance purpose) |
GET email/{email}
| RestException | 401 Insufficient rights |
| RestException | 404 User or group not found |
Definition at line 222 of file api_users.class.php.
References DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
| Users::getByLogin | ( | $login, | |
$includepermissions = 0 |
|||
| ) |
Get properties of an user object by login.
| 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) |
GET login/{login}
| RestException | 401 Insufficient rights |
| RestException | 404 User or group not found |
Definition at line 188 of file api_users.class.php.
References DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
| Users::getGroups | ( | $id | ) |
List the groups of a user.
| int | $id | Id of user |
| RestException | 403 Not allowed |
| RestException | 404 Not found |
GET {id}/groups
Definition at line 377 of file api_users.class.php.
References _cleanObjectDatas(), and db.
| Users::getInfo | ( | $includepermissions = 0 | ) |
Get properties of user connected.
GET /info
| int | $includepermissions | Set this to 1 to have the array of permissions loaded (not done by default for performance purpose) |
| RestException | 401 Insufficient rights |
| RestException | 404 User or group not found |
Definition at line 255 of file api_users.class.php.
References DolibarrApi\_checkAccessToResource(), _cleanObjectDatas(), _cleanUserGroupListDatas(), and db.
| Users::index | ( | $sortfield = "t.rowid", |
|
$sortorder = 'ASC', |
|||
$limit = 100, |
|||
$page = 0, |
|||
$user_ids = 0, |
|||
$category = 0, |
|||
$sqlfilters = '' |
|||
| ) |
List Users.
Get a list of Users
| 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' { /^[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')" |
Definition at line 70 of file api_users.class.php.
References DolibarrApi\_checkFilters(), _cleanObjectDatas(), and db.
| Users::infoGroups | ( | $group, | |
$load_members = 0 |
|||
| ) |
Get properties of an group object.
Return an array with group informations
GET /groups/{group}
| int | $group | ID of group |
| int | $load_members | Load members list or not { 0} { 1} |
Definition at line 531 of file api_users.class.php.
References _cleanObjectDatas(), and db.
| 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
GET /groups
| 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' { /^[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')" |
Definition at line 459 of file api_users.class.php.
References DolibarrApi\_checkFilters(), _cleanObjectDatas(), and db.
| Users::post | ( | $request_data = null | ) |
Create user account.
| array | $request_data | New user data |
Definition at line 289 of file api_users.class.php.
| Users::put | ( | $id, | |
$request_data = null |
|||
| ) |
Update account.
| int | $id | Id of account to update |
| array | $request_data | Datas |
| RestException | 401 Not allowed |
| RestException | 404 Not found |
| RestException | 500 System error |
Definition at line 325 of file api_users.class.php.
References DolibarrApi\_checkAccessToResource().
| Users::setGroup | ( | $id, | |
| $group, | |||
$entity = 1 |
|||
| ) |
Add a user into a group.
| int | $id | User ID |
| int | $group | Group ID |
| int | $entity | Entity ID (valid only for superadmin in multicompany transverse mode) |
GET {id}/setGroup/{group}
Definition at line 411 of file api_users.class.php.
References DolibarrApi\_checkAccessToResource().