25if (!defined(
'NOTOKENRENEWAL')) {
26 define(
'NOTOKENRENEWAL', 1);
28if (!defined(
'NOREQUIREMENU')) {
29 define(
'NOREQUIREMENU',
'1');
31if (!defined(
'NOREQUIREHTML')) {
32 define(
'NOREQUIREHTML',
'1');
34if (!defined(
'NOREQUIREAJAX')) {
35 define(
'NOREQUIREAJAX',
'1');
37if (!defined(
'NOREQUIRESOC')) {
38 define(
'NOREQUIRESOC',
'1');
42require
'../../main.inc.php';
50require_once DOL_DOCUMENT_ROOT.
'/core/class/html.form.class.php';
52$htmlname = (string)
GETPOST(
'htmlname',
'aZ09');
54$excludeids =
GETPOST(
'exclude',
'intcomma');
55$include =
GETPOST(
'include',
'alphanohtml');
56$forceentity =
GETPOST(
'force_entity',
'alphanohtml');
65$morefilter = (string)
GETPOST(
'morefilter',
'nohtml');
72if (empty($user->id)) {
78$restricttoself = ($user->socid > 0);
86if ($htmlname ===
'') {
87 print json_encode(array());
95$searchkey = (string)
GETPOST($htmlname,
'alphanohtml');
96if ($searchkey ===
'' && $minlength >= 1) {
98 print json_encode(array());
104if ($minlength >= 1 &&
dol_strlen($searchkey) < $minlength) {
109if ($excludeids !==
'') {
110 $exclude = array_map(
'intval', explode(
',', $excludeids));
114if ($include !==
'' && $include !==
'hierarchy' && $include !==
'hierarchyme') {
115 $include = array_map(
'intval', explode(
',', $include));
119if ($restricttoself) {
120 $include = array($user->id);
124$form =
new Form($db);
131$limitoffset = ($page > 1) ? ($page - 1) * $limit : 0;
133$arrayresult = $form->select_dolusers(
'', $htmlname, 0, $exclude, 0, $include,
'', $forceentity, $maxlength, $showstatus, $morefilter, 0,
'',
'', $notdisabled, 2,
false, 0, $searchkey, $limit, $limitoffset);
136if (is_array($arrayresult)) {
137 foreach ($arrayresult as
$id => $val) {
138 if ((
int)
$id <= 0) {
153print json_encode($outarray);
$id
Support class for third parties, contacts, members, users or resources.
dol_string_nohtmltag($stringtoclean, $removelinefeed=1, $pagecodeto='UTF-8', $strip_tags=0, $removedoublespaces=1)
Clean a string from all HTML tags and entities.
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
if(!defined( 'NOREQUIREMENU')) if(!empty(GETPOST('seteventmessages', 'alpha'))) if(!function_exists("llxHeader")) top_httphead($contenttype='text/html', $forcenocache=0)
Show HTTP header.
httponly_accessforbidden($message='1', $http_response_code=403, $stringalreadysanitized=0)
Show a message to say access is forbidden and stop program.