CProfile::updateArray('web.token.filter_userids', $this->getInput('filter_userids', []), PROFILE_TYPE_ID);
<?php declare(strict_types = 0);
class CControllerTokenList extends CController {
protected function init() {
$this->disableCsrfValidation();
protected function checkInput() {
'sort' => 'in name,user,expires_at,creator,lastaccess,status',
'sortorder' => 'in '.ZBX_SORT_DOWN.','.ZBX_SORT_UP,
'filter_name' => 'string',
'filter_userids' => 'array_db users.userid',
'filter_expires_state' => 'in 1',
'filter_expires_days' => 'int32',
'filter_creator_userids' => 'array_db users.userid',
'filter_status' => 'in -1,'.ZBX_AUTH_TOKEN_ENABLED.','.ZBX_AUTH_TOKEN_DISABLED,
$ret = $this->validateInput($fields);
$this->setResponse(new CControllerResponseFatal());
protected function checkPermissions() {
if (CWebUser::isGuest()) {
return ($this->checkAccess(CRoleHelper::ACTIONS_MANAGE_API_TOKENS)
&& $this->checkAccess(CRoleHelper::UI_ADMINISTRATION_API_TOKENS)
protected function doAction() {
$sort_field = $this->getInput('sort', CProfile::get('web.token.list.sort', 'name'));
$sort_order = $this->getInput('sortorder', CProfile::get('web.token.list.sortorder', ZBX_SORT_UP));
CProfile::update('web.token.list.sort', $sort_field, PROFILE_TYPE_STR);
CProfile::update('web.token.list.sortorder', $sort_order, PROFILE_TYPE_STR);