diff --git a/htdocs/core/tpl/apitoken_list.tpl.php b/htdocs/core/tpl/apitoken_list.tpl.php index 8936d607600..c7c4f8b9f83 100644 --- a/htdocs/core/tpl/apitoken_list.tpl.php +++ b/htdocs/core/tpl/apitoken_list.tpl.php @@ -156,8 +156,17 @@ if ($num > 0) { $obj = $db->fetch_object($resql); $useridparam = isset($obj->fk_user) ? $obj->fk_user : $object->id; $numperms = 0; + if (isset($obj->fk_user)) { + $currentuser = new User($db); + $currentuser->fetch($obj->fk_user); + } else { + $currentuser = $object; + } if (!empty($obj->rights)) { $numperms = count(explode(",", $obj->rights)); + } elseif (!(strlen($obj->rights) == 1 && substr($obj->rights, 0, 1) == 0)) { + $currentuser->loadRights(); + $numperms = $currentuser->nb_rights; } print ''; // Action column @@ -178,8 +187,6 @@ if ($num > 0) { print ''; print ''; if (!empty($arrayfields['u.login']['checked'])) { - $currentuser = new User($db); - $currentuser->fetch($obj->fk_user); print ''; print ''; print $currentuser->getNomUrl(1);