22use Luracast\Restler\RestException;
24require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
25require_once DOL_DOCUMENT_ROOT.
'/user/class/usergroup.class.php';
26require_once DOL_DOCUMENT_ROOT.
'/core/class/notify.class.php';
42 public static $FIELDS = array(
59 $this->useraccount =
new User($this->db);
84 public function index($sortfield =
"t.rowid", $sortorder =
'ASC', $limit = 100, $page = 0, $user_ids =
'0', $category = 0, $sqlfilters =
'', $properties =
'')
86 if (!DolibarrApiAccess::$user->hasRight(
'user',
'user',
'lire') && empty(DolibarrApiAccess::$user->admin)) {
87 throw new RestException(403,
"You are not allowed to read list of users");
95 $sql =
"SELECT t.rowid";
96 $sql .=
" FROM ".MAIN_DB_PREFIX.
"user AS t LEFT JOIN ".MAIN_DB_PREFIX.
"user_extrafields AS ef ON (ef.fk_object = t.rowid)";
98 $sql .=
", ".$this->db->prefix().
"categorie_user as c";
100 $sql .=
' WHERE t.entity IN ('.getEntity(
'user').
')';
102 $sql .=
" AND t.rowid IN (".$this->db->sanitize($user_ids).
")";
107 $sql .=
" AND c.fk_categorie = ".((int) $category);
108 $sql .=
" AND c.fk_user = t.rowid";
116 throw new RestException(400,
'Error when validating parameter sqlfilters -> '.$errormessage);
120 $sql .= $this->db->order($sortfield, $sortorder);
125 $offset = $limit * $page;
127 $sql .= $this->db->plimit($limit + 1, $offset);
130 $result = $this->db->query($sql);
134 $num = $this->db->num_rows($result);
135 $min = min($num, ($limit <= 0 ? $num : $limit));
137 $obj = $this->db->fetch_object($result);
138 $user_static =
new User($this->db);
139 if ($user_static->fetch($obj->rowid)) {
145 throw new RestException(503,
'Error when retrieve User list : '.$this->db->lasterror());
165 public function get(
$id, $includepermissions = 0)
167 if (!DolibarrApiAccess::$user->hasRight(
'user',
'user',
'lire') && empty(DolibarrApiAccess::$user->admin) &&
$id != 0 && DolibarrApiAccess::$user->id !=
$id) {
168 throw new RestException(403,
'Not allowed');
172 $result = $this->useraccount->initAsSpecimen();
174 $result = $this->useraccount->fetch(
$id);
177 throw new RestException(404,
'User not found');
181 throw new RestException(403,
'Access not allowed for login '.DolibarrApiAccess::$user->login);
184 if ($includepermissions) {
185 $this->useraccount->loadRights();
211 throw new RestException(400,
'Bad parameters');
214 if (!DolibarrApiAccess::$user->hasRight(
'user',
'user',
'lire') && empty(DolibarrApiAccess::$user->admin) && DolibarrApiAccess::$user->login != $login) {
215 throw new RestException(403,
'Not allowed');
218 $result = $this->useraccount->fetch(0, $login);
220 throw new RestException(404,
'User not found');
224 throw new RestException(403,
'Access not allowed for login '.DolibarrApiAccess::$user->login);
227 if ($includepermissions) {
228 $this->useraccount->loadRights();
254 throw new RestException(400,
'Bad parameters');
257 if (!DolibarrApiAccess::$user->hasRight(
'user',
'user',
'lire') && empty(DolibarrApiAccess::$user->admin) && DolibarrApiAccess::$user->
email != $email) {
258 throw new RestException(403,
'Not allowed');
261 $result = $this->useraccount->fetch(0,
'',
'', 0, -1, $email);
263 throw new RestException(404,
'User not found');
267 throw new RestException(403,
'Access not allowed for login '.DolibarrApiAccess::$user->login);
270 if ($includepermissions) {
271 $this->useraccount->loadRights();
290 public function getInfo($includepermissions = 0)
292 if (!DolibarrApiAccess::$user->hasRight(
'user',
'self',
'creer') && !DolibarrApiAccess::$user->hasRight(
'user',
'user',
'lire') && empty(DolibarrApiAccess::$user->admin)) {
293 throw new RestException(403,
'Not allowed');
296 $apiUser = DolibarrApiAccess::$user;
298 $result = $this->useraccount->fetch($apiUser->id);
300 throw new RestException(404,
'User not found');
304 throw new RestException(403,
'Access not allowed for login '.DolibarrApiAccess::$user->login);
307 if ($includepermissions) {
308 $this->useraccount->loadRights();
312 $userGroupList = $usergroup->listGroupsForUser($apiUser->id,
false);
313 if (!is_array($userGroupList)) {
314 throw new RestException(404,
'User group not found');
334 public function post($request_data =
null)
337 if (!DolibarrApiAccess::$user->hasRight(
'user',
'user',
'creer') && empty(DolibarrApiAccess::$user->admin)) {
338 throw new RestException(403,
"User creation not allowed for login ".DolibarrApiAccess::$user->login);
350 foreach ($request_data as $field => $value) {
351 if (in_array($field, array(
'pass_crypted',
'pass_indatabase',
'pass_indatabase_crypted',
'pass_temp',
'api_key'))) {
353 throw new RestException(405,
'The property '.$field.
" can't be set/modified using the APIs");
355 if ($field ===
'caller') {
357 $this->useraccount->context[
'caller'] =
sanitizeVal($request_data[
'caller'],
'aZ09');
368 $this->useraccount->$field = $this->
_checkValForAPI($field, $value, $this->useraccount);
371 if ($this->useraccount->create(DolibarrApiAccess::$user) < 0) {
372 throw new RestException(500,
'Error creating', array_merge(array($this->useraccount->error), $this->useraccount->errors));
374 return $this->useraccount->id;
393 public function put(
$id, $request_data =
null)
396 if (!DolibarrApiAccess::$user->hasRight(
'user',
'user',
'creer') && empty(DolibarrApiAccess::$user->admin)) {
397 throw new RestException(403,
"User update not allowed");
400 $result = $this->useraccount->fetch(
$id);
402 throw new RestException(404,
'Account not found');
406 throw new RestException(403,
'Access not allowed for login '.DolibarrApiAccess::$user->login);
409 foreach ($request_data as $field => $value) {
410 if (in_array($field, array(
'pass_crypted',
'pass_indatabase',
'pass_indatabase_crypted',
'pass_temp',
'api_key'))) {
412 throw new RestException(405,
'The property '.$field.
" can't be set/modified using the APIs");
414 if ($field ==
'id') {
417 if ($field ==
'pass') {
418 if ($this->useraccount->id != DolibarrApiAccess::$user->id && !DolibarrApiAccess::$user->hasRight(
'user',
'user',
'password')) {
419 throw new RestException(403,
'You are not allowed to modify password of other users');
421 if ($this->useraccount->id == DolibarrApiAccess::$user->id && !DolibarrApiAccess::$user->hasRight(
'user',
'self',
'password')) {
422 throw new RestException(403,
'You are not allowed to modify your own password');
425 if ($field ===
'caller') {
427 $this->useraccount->context[
'caller'] =
sanitizeVal($request_data[
'caller'],
'aZ09');
430 if ($field ==
'array_options' && is_array($value)) {
431 foreach ($value as $index => $val) {
432 $this->useraccount->array_options[$index] = $this->
_checkValForAPI($field, $val, $this->useraccount);
437 if (DolibarrApiAccess::$user->admin) {
438 if ($field ==
'admin' && $value != $this->useraccount->admin && empty($value)) {
439 throw new RestException(403,
'Reseting the admin status of a user is not possible using the API');
442 if ($field ==
'admin' && $value != $this->useraccount->admin) {
443 throw new RestException(403,
'Only an admin user can modify the admin status of another user');
446 if ($field ==
'entity' && $value != $this->useraccount->entity) {
447 throw new RestException(403,
'Changing entity of a user using the APIs is not possible');
452 if ($field ==
'statut' || $field ==
'status') {
453 $result = $this->useraccount->setstatus($value);
455 throw new RestException(500,
'Error when updating status of user: '.$this->useraccount->error);
458 $this->useraccount->$field = $this->
_checkValForAPI($field, $value, $this->useraccount);
464 if ($this->useraccount->update(DolibarrApiAccess::$user) >= 0) {
465 return $this->
get(
$id);
467 throw new RestException(500, $this->useraccount->error);
490 throw new RestException(403,
"Error: login and password reset APIs are disabled. You can get access token from the backoffice to get access permission but permission and password manipulation from APIs are forbidden.");
495 throw new RestException(403,
"Error: password reset APIs are disabled by default. To allow this, the option API_ALLOW_PASSWORD_RESET must be set.");
498 if (!DolibarrApiAccess::$user->hasRight(
'user',
'user',
'creer') && empty(DolibarrApiAccess::$user->admin)) {
499 throw new RestException(403,
"setPassword on user not allowed for login ".DolibarrApiAccess::$user->login);
502 $result = $this->useraccount->fetch(
$id);
504 throw new RestException(404,
'User not found, no password changed');
508 throw new RestException(403,
'Access on this object not allowed for login '.DolibarrApiAccess::$user->login);
511 $newpassword = $this->useraccount->setPassword($this->useraccount,
'');
512 if (is_int($newpassword) && $newpassword < 0) {
513 throw new RestException(500,
'ErrorFailedToSetNewPassword'.$this->useraccount->error);
516 if ($send_password) {
517 if ($this->useraccount->send_password($this->useraccount, $newpassword) > 0) {
520 throw new RestException(500,
'ErrorFailedSendingNewPassword - '.$this->useraccount->error);
545 if (!DolibarrApiAccess::$user->hasRight(
'user',
'user',
'lire') && empty(DolibarrApiAccess::$user->admin)) {
546 throw new RestException(403);
549 $user =
new User($this->db);
550 $result = $user->fetch(
$id);
552 throw new RestException(404,
'user not found');
556 $groups = $usergroup->listGroupsForUser(
$id,
false);
558 foreach ($groups as $group) {
585 if (!DolibarrApiAccess::$user->hasRight(
'user',
'user',
'creer') && empty(DolibarrApiAccess::$user->admin)) {
586 throw new RestException(403,
'setGroup on users not allowed for login '.DolibarrApiAccess::$user->login);
589 $result = $this->useraccount->fetch(
$id);
591 throw new RestException(404,
'User not found');
595 throw new RestException(403,
'Access not allowed for login '.DolibarrApiAccess::$user->login);
598 if (isModEnabled(
'multicompany') &&
getDolGlobalString(
'MULTICOMPANY_TRANSVERSE_MODE') && !empty(DolibarrApiAccess::$user->admin) && empty(DolibarrApiAccess::$user->entity)) {
599 $entity = (!empty($entity) ? $entity :
$conf->entity);
603 $entity = (DolibarrApiAccess::$user->entity > 0 ? DolibarrApiAccess::$user->entity :
$conf->entity);
606 $result = $this->useraccount->SetInGroup($group, $entity);
607 if (!($result > 0)) {
608 throw new RestException(500, $this->useraccount->error);
638 public function listGroups($sortfield =
"t.rowid", $sortorder =
'ASC', $limit = 100, $page = 0, $group_ids =
'0', $sqlfilters =
'', $properties =
'')
642 if ((!
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') && !DolibarrApiAccess::$user->hasRight(
'user',
'user',
'lire') && empty(DolibarrApiAccess::$user->admin)) ||
643 getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') && !DolibarrApiAccess::$user->hasRight(
'user',
'group_advance',
'read') && empty(DolibarrApiAccess::$user->admin)) {
644 throw new RestException(403,
"You are not allowed to read groups");
650 $sql =
"SELECT t.rowid";
651 $sql .=
" FROM ".MAIN_DB_PREFIX.
"usergroup AS t LEFT JOIN ".MAIN_DB_PREFIX.
"usergroup_extrafields AS ef ON (ef.fk_object = t.rowid)";
652 $sql .=
' WHERE t.entity IN ('.getEntity(
'user').
')';
654 $sql .=
" AND t.rowid IN (".$this->db->sanitize($group_ids).
")";
661 throw new RestException(400,
'Error when validating parameter sqlfilters -> '.$errormessage);
665 $sql .= $this->db->order($sortfield, $sortorder);
670 $offset = $limit * $page;
672 $sql .= $this->db->plimit($limit + 1, $offset);
675 $result = $this->db->query($sql);
679 $num = $this->db->num_rows($result);
680 $min = min($num, ($limit <= 0 ? $num : $limit));
682 $obj = $this->db->fetch_object($result);
683 $group_static =
new UserGroup($this->db);
684 if ($group_static->fetch($obj->rowid)) {
690 throw new RestException(503,
'Error when retrieve Group list : '.$this->db->lasterror());
714 if ((!
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') && !DolibarrApiAccess::$user->hasRight(
'user',
'user',
'lire') && empty(DolibarrApiAccess::$user->admin)) ||
715 getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') && !DolibarrApiAccess::$user->hasRight(
'user',
'group_advance',
'read') && empty(DolibarrApiAccess::$user->admin)) {
716 throw new RestException(403,
"You are not allowed to read groups");
719 $group_static =
new UserGroup($this->db);
720 $result = $group_static->fetch($group,
'', (
bool) $load_members);
723 throw new RestException(404,
'Group not found');
726 if ($load_members > 0 && is_array($group_static->members) && count($group_static->members) > 0) {
727 foreach ($group_static->members as &$member) {
748 public function delete(
$id)
750 if (!DolibarrApiAccess::$user->hasRight(
'user',
'user',
'supprimer') && empty(DolibarrApiAccess::$user->admin)) {
751 throw new RestException(403,
'Not allowed');
753 $result = $this->useraccount->fetch(
$id);
755 throw new RestException(404,
'User not found');
759 throw new RestException(403,
'Access not allowed for login '.DolibarrApiAccess::$user->login);
762 if ($this->useraccount->admin && empty(DolibarrApiAccess::$user->admin)) {
763 throw new RestException(403,
'Only admin users can delete admin users');
765 if ($this->useraccount->admin && empty($this->useraccount->entity) && !empty(DolibarrApiAccess::$user->entity)) {
766 throw new RestException(403,
'Only superadmin users can delete superadmin users');
769 $this->useraccount->oldcopy = clone $this->useraccount;
771 if (!$this->useraccount->delete(DolibarrApiAccess::$user)) {
772 throw new RestException(500);
778 'message' =>
'Ticket deleted'
801 throw new RestException(400,
'user ID is mandatory');
803 if (!DolibarrApiAccess::$user->hasRight(
'user',
'user',
'lire') && empty(DolibarrApiAccess::$user->admin)) {
804 throw new RestException(403);
807 throw new RestException(403,
'Access not allowed for login '.DolibarrApiAccess::$user->login);
814 $sql =
"SELECT rowid as id, fk_action as event, fk_user, type, datec, tms";
815 $sql .=
" FROM ".MAIN_DB_PREFIX.
"notify_def";
816 $sql .=
" WHERE fk_user = ".((int)
$id);
818 $result = $this->db->query($sql);
819 if ($this->db->num_rows($result) == 0) {
820 throw new RestException(404,
'Notification not found');
825 $notifications = array();
828 $num = $this->db->num_rows($result);
830 $obj = $this->db->fetch_object($result);
831 $notifications[] = $obj;
835 throw new RestException(404,
'No notifications found');
838 $fields = array(
'id',
'fk_user',
'event',
'datec',
'tms',
'type');
840 $returnNotifications = array();
842 foreach ($notifications as $notification) {
844 foreach ($notification as $key => $value) {
845 if (in_array($key, $fields)) {
849 $returnNotifications[] =
$object;
853 return $returnNotifications;
874 if (!DolibarrApiAccess::$user->hasRight(
'user',
'user',
'creer')) {
875 throw new RestException(403,
"User has no right to update users");
877 if ($this->useraccount->fetch(
$id) <= 0) {
878 throw new RestException(404,
'Error creating User Notification, User doesn\'t exists');
880 $notification =
new Notify($this->db);
882 $notification->fk_user =
$id;
884 foreach ($request_data as $field => $value) {
885 $notification->$field = $value;
888 $event = $notification->event;
890 throw new RestException(500,
'Error creating User Notification, request_data missing event');
892 $fk_user = $notification->fk_user;
894 $exists_sql =
"SELECT rowid, fk_action as event, fk_user, type, datec, tms as datem";
895 $exists_sql .=
" FROM ".MAIN_DB_PREFIX.
"notify_def";
896 $exists_sql .=
" WHERE fk_action = '".$this->db->escape((
string) $event).
"'";
897 $exists_sql .=
" AND fk_user = '".$this->db->escape((
string) $fk_user).
"'";
899 $exists_result = $this->db->query($exists_sql);
900 if ($this->db->num_rows($exists_result) > 0) {
901 throw new RestException(403,
'Notification already exists');
904 if ($notification->create(DolibarrApiAccess::$user) < 0) {
905 throw new RestException(500,
'Error creating User Notification');
908 if ($notification->update(DolibarrApiAccess::$user) < 0) {
909 throw new RestException(500,
'Error updating values');
935 if (!DolibarrApiAccess::$user->hasRight(
'user',
'user',
'creer')) {
936 throw new RestException(403,
"User has no right to update users");
938 if ($this->useraccount->fetch(
$id) <= 0) {
939 throw new RestException(404,
'Error creating User Notification, User doesn\'t exists');
941 $notification =
new Notify($this->db);
942 $notification->fk_user =
$id;
944 $sql =
"SELECT t.rowid as id FROM ".MAIN_DB_PREFIX.
"c_action_trigger as t";
945 $sql .=
" WHERE t.code = '".$this->db->escape($code).
"'";
947 $result = $this->db->query($sql);
948 if ($this->db->num_rows($result) == 0) {
949 throw new RestException(404,
'Action Trigger code not found');
952 $notification->event = $this->db->fetch_row($result)[0];
953 foreach ($request_data as $field => $value) {
954 if ($field ===
'event') {
955 throw new RestException(500,
'Error creating User Notification, request_data contains event key');
957 if ($field ===
'fk_action') {
958 throw new RestException(500,
'Error creating User Notification, request_data contains fk_action key');
960 $notification->$field = $value;
963 $event = $notification->event;
964 $fk_user = $notification->fk_user;
966 $exists_sql =
"SELECT rowid, fk_action as event, fk_user, type, datec, tms as datem";
967 $exists_sql .=
" FROM ".MAIN_DB_PREFIX.
"notify_def";
968 $exists_sql .=
" WHERE fk_action = '".$this->db->escape((
string) $event).
"'";
969 $exists_sql .=
" AND fk_user = '".$this->db->escape((
string) $fk_user).
"'";
971 $exists_result = $this->db->query($exists_sql);
972 if ($this->db->num_rows($exists_result) > 0) {
973 throw new RestException(403,
'Notification already exists');
976 if ($notification->create(DolibarrApiAccess::$user) < 0) {
977 throw new RestException(500,
'Error creating User Notification, are request_data well formed?');
980 if ($notification->update(DolibarrApiAccess::$user) < 0) {
981 throw new RestException(500,
'Error updating values');
1003 if (!DolibarrApiAccess::$user->hasRight(
'user',
'user',
'creer')) {
1004 throw new RestException(403,
"User has no right to update users");
1007 $notification =
new Notify($this->db);
1009 $notification->fetch($notification_id);
1011 $fk_user = (int) $notification->fk_user;
1013 if ($fk_user ==
$id) {
1014 return $notification->delete(DolibarrApiAccess::$user);
1016 throw new RestException(403,
"Not allowed due to bad consistency of input data");
1039 if (!DolibarrApiAccess::$user->hasRight(
'user',
'user',
'creer')) {
1040 throw new RestException(403,
"User has no right to update users");
1042 if ($this->useraccount->fetch(
$id) <= 0) {
1043 throw new RestException(404,
'Error creating Notification, User doesn\'t exists');
1045 $notification =
new Notify($this->db);
1048 $notification->fetch($notification_id,
$id);
1050 if ($notification->fk_user !=
$id) {
1051 throw new RestException(403,
"Not allowed due to bad consistency of input data");
1054 foreach ($request_data as $field => $value) {
1055 $notification->$field = $value;
1058 if ($notification->update(DolibarrApiAccess::$user) < 0) {
1059 throw new RestException(500,
'Error updating values');
1077 unset(
$object->default_values);
1078 unset(
$object->lastsearch_values);
1079 unset(
$object->lastsearch_values_tmp);
1083 unset(
$object->total_localtax1);
1084 unset(
$object->total_localtax2);
1087 unset(
$object->label_incoterms);
1088 unset(
$object->location_incoterms);
1090 unset(
$object->fk_delivery_address);
1092 unset(
$object->all_permissions_are_loaded);
1093 unset(
$object->shipping_method_id);
1097 unset(
$object->clicktodial_loaded);
1101 unset(
$object->pass_indatabase);
1102 unset(
$object->pass_indatabase_crypted);
1105 unset(
$object->clicktodial_password);
1111 $canreadsalary = ((isModEnabled(
'salaries') && DolibarrApiAccess::$user->hasRight(
'salaries',
'read')) || !isModEnabled(
'salaries'));
1113 if (!$canreadsalary) {
1131 $cleanObjectList = array();
1133 foreach ($objectList as
$object) {
1134 $cleanObject = parent::_cleanObjectDatas(
$object);
1136 unset($cleanObject->default_values);
1137 unset($cleanObject->lastsearch_values);
1138 unset($cleanObject->lastsearch_values_tmp);
1140 unset($cleanObject->total_ht);
1141 unset($cleanObject->total_tva);
1142 unset($cleanObject->total_localtax1);
1143 unset($cleanObject->total_localtax2);
1144 unset($cleanObject->total_ttc);
1146 unset($cleanObject->libelle_incoterms);
1147 unset($cleanObject->location_incoterms);
1149 unset($cleanObject->fk_delivery_address);
1150 unset($cleanObject->fk_incoterms);
1151 unset($cleanObject->all_permissions_are_loaded);
1152 unset($cleanObject->shipping_method_id);
1153 unset($cleanObject->nb_rights);
1154 unset($cleanObject->search_sid);
1155 unset($cleanObject->ldap_sid);
1156 unset($cleanObject->clicktodial_loaded);
1158 unset($cleanObject->datec);
1159 unset($cleanObject->tms);
1160 unset($cleanObject->members);
1161 unset($cleanObject->note);
1162 unset($cleanObject->note_private);
1164 $cleanObjectList[] = $cleanObject;
1167 return $cleanObjectList;
1180 foreach (Users::$FIELDS as $field) {
1181 if (!isset($data[$field])) {
1182 throw new RestException(400,
"$field field missing");
1184 $account[$field] = $data[$field];
$id
Support class for third parties, contacts, members, users or resources.
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
_filterObjectProperties($object, $properties)
Filter properties that will be returned on object.
static _checkAccessToResource($resource, $resource_id=0, $dbtablename='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid')
Check access by user to a given resource.
_checkValForAPI($field, $value, $object)
Check and convert a string depending on its type/name.
Class to manage the table of subscription to notifications.
Class to manage user groups.
Class to manage Dolibarr users.
put($id, $request_data=null)
Update a user.
listGroups($sortfield="t.rowid", $sortorder='ASC', $limit=100, $page=0, $group_ids='0', $sqlfilters='', $properties='')
List groups.
index($sortfield="t.rowid", $sortorder='ASC', $limit=100, $page=0, $user_ids='0', $category=0, $sqlfilters='', $properties='')
List users.
_cleanObjectDatas($object)
Clean sensible object datas.
getInfo($includepermissions=0)
Get more properties of a user.
_cleanUserGroupListDatas($objectList)
Clean sensible user group list datas.
updateUserNotification($id, $notification_id, $request_data=null)
Update a notification for a user.
setGroup($id, $group, $entity=1)
Add a user to a group.
setPassword($id, $send_password=false)
Update a user password.
deleteUserNotification($id, $notification_id)
Delete a notification attached to a user.
infoGroups($group, $load_members=0)
Get properties of a user group.
_validate($data)
Validate fields before create or update object.
getByEmail($email, $includepermissions=0)
Get a user by email.
getGroups($id)
List the groups of a user.
createUserNotificationByCode($id, $code, $request_data=null)
Create a notification for a user using action trigger code.
post($request_data=null)
Create a user.
createUserNotification($id, $request_data=null)
Create a notification for a user.
getByLogin($login, $includepermissions=0)
Get a user by login.
getUserNotification($id)
Get notifications for a user.
__construct()
Constructor.
print $script_file $mode $langs defaultlang(is_numeric($duration_value) ? " delay=". $duration_value :"").(is_numeric($duration_value2) ? " after cd cd cd description as p label as s rowid as s nom as s email
Sender: Who sends the email ("Sender" has sent emails on behalf of "From").
forgeSQLFromUniversalSearchCriteria($filter, &$errorstr='', $noand=0, $nopar=0, $noerror=0)
forgeSQLFromUniversalSearchCriteria
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
sanitizeVal($out='', $check='alphanohtml', $filter=null, $options=null)
Return a sanitized or empty value after checking value against a rule.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...