diff --git a/htdocs/user/api_token/list.php b/htdocs/user/api_token/list.php index 20b744febdd..4389a93ef60 100644 --- a/htdocs/user/api_token/list.php +++ b/htdocs/user/api_token/list.php @@ -41,28 +41,25 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; */ // Load translation files required by page -$langs->loadLangs(array('companies', 'products', 'admin', 'users', 'languages', 'projects', 'members')); - -// Defini si peux lire/modifier permissions -$canreaduser = ($user->admin || $user->hasRight("user", "user", "read")); -$caneditfield = false; +$langs->loadLangs(array('admin', 'users')); +// Security check $id = GETPOSTINT('id'); $action = GETPOST('action', 'aZ09'); -$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'userihm'; // To manage different context of search +$massaction = GETPOST('massaction', 'alpha'); if (!isset($id) || empty($id)) { accessforbidden(); } -'@phan-var-force int<1,max> $id'; +// Retrieve needed GETPOSTS for this file $toselect = GETPOST('toselect', 'array'); -// $user est le user qui edite, $id est l'id de l'utilisateur edite +// $user is current user, $id is id of edited user +$canreaduser = ($user->admin || $user->hasRight("user", "user", "read")); $caneditfield = ((($user->id == $id) && $user->hasRight("user", "self", "write")) || (($user->id != $id) && $user->hasRight("user", "user", "write"))); - // Security check $socid = 0; if ($user->socid > 0) { @@ -70,9 +67,6 @@ if ($user->socid > 0) { } $feature2 = (($socid && $user->hasRight("user", "self", "write")) ? '' : 'user'); -// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context -$hookmanager->initHooks(array('usercard', 'userihm', 'globalcard')); - $result = restrictedArea($user, 'user', $id, 'user&user', $feature2); if ($user->id != $id && !$canreaduser) { accessforbidden(); @@ -113,20 +107,12 @@ $help_url = ''; llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-user page-card_param_ihm'); -$massaction = GETPOST('massaction', 'alpha'); $arrayofselected = is_array($toselect) ? $toselect : array(); $head = user_prepare_head($object); $title = $langs->trans("User"); -if ($action == 'edit') { - print '
';