--- ./include/views/administration.users.list.php.orig	2014-07-17 15:49:46.000000000 +0200
+++ ./include/views/administration.users.list.php	2014-08-23 14:21:34.000000000 +0200
@@ -19,7 +19,7 @@
 **/
 
 
-$usersWidget = new CWidget();
+$usersWidget = new CWidget(null, 'item-list');
 
 // append page header to widget
 $createForm = new CForm('get');
@@ -43,6 +43,75 @@
 $usersWidget->addHeader(_('Users'), $userGroupListForm);
 $usersWidget->addHeaderRowNumber();
 
+// filter
+$filterTable = new CTable('', 'filter');
+$filterTable->setAttribute('name', 'zbx_filter');
+$filterTable->setAttribute('id', 'zbx_filter');
+
+//row 1
+$filterTable->addRow(array(
+	new CCol(array(bold(_('Alias')), SPACE._('like'), bold(': ')), 'label col1'),
+	new CCol(new CTextBox('filter_alias', $data['filter_alias'], ZBX_TEXTBOX_FILTER_SIZE)),
+	new CCol(array(bold(_('Name')), SPACE._('like'), bold(': ')), 'label col2'),
+	new CCol(new CTextBox('filter_name', $data['filter_name'], ZBX_TEXTBOX_FILTER_SIZE)),
+	new CCol(array(bold(_('Surname')), SPACE._('like'), bold(': ')), 'label col3'),
+	new CCol(new CTextBox('filter_surname', $data['filter_surname'], ZBX_TEXTBOX_FILTER_SIZE)),
+	new CCol(bold(_('User type').':'), 'label col4'),
+	new CComboBox('filter_type', $data['filter_type'], null, array(
+		-1 => _('all'),
+		USER_TYPE_ZABBIX_USER => _('Zabbix user'),
+		USER_TYPE_ZABBIX_ADMIN => _('Zabbix admin'),
+		USER_TYPE_SUPER_ADMIN => _('Zabbix super admin')
+	))
+));
+
+//row 2
+$filterTable->addRow(array(
+	new CCol(bold(array(_('Is online?'),':')), 'label col1'),
+	new CComboBox('filter_online', $data['filter_online'], null, array(
+		-1 => _('all'),
+		0 => _('No'),
+		1 => _('Yes')
+	)),
+	new CCol(bold(array(_('Frontend access'),':')), 'label col2'),
+	new CComboBox('filter_access', $data['filter_access'], null, array(
+		-1 => _('all'),
+		0 => _('System default'),
+		1 => _('Internal'),
+		2  => _('Disabled')
+	)),
+	new CCol(bold(array(_('Debug mode'),':')), 'label col3'),
+	new CComboBox('filter_debug', $data['filter_debug'], null, array(
+		-1 => _('all'),
+		0 => _('Disabled'),
+		1 => _('Enabled')
+	)),
+	new CCol(bold(array(_('Status'),':')), 'label col4'),
+	new CComboBox('filter_status', $data['filter_status'], null, array(
+		-1 => _('all'),
+		0 => _('Enabled'),
+		1 => _('Disabled')
+	))
+));
+
+$filter = new CButton('filter', _('Filter'), "javascript: create_var('zbx_filter', 'filter_set', '1', true);");
+$filter->useJQueryStyle('main');
+
+$reset = new CButton('reset', _('Reset'), "javascript: clearAllForm('zbx_filter');");
+$reset->useJQueryStyle();
+
+$divButtons = new CDiv(array($filter, SPACE, $reset));
+$divButtons->setAttribute('style', 'padding: 4px 0;');
+
+$filterTable->addRow(new CCol($divButtons, 'center', 8));
+
+$filterForm = new CForm('get');
+$filterForm->setAttribute('name', 'zbx_filter');
+$filterForm->setAttribute('id', 'zbx_filter');
+$filterForm->addItem($filterTable);
+
+$usersWidget->addFlicker($filterForm, CProfile::get('web.users.filter.state', 0));
+
 // create form
 $usersForm = new CForm();
 $usersForm->setName('userForm');
--- ./users.php.orig	2014-07-17 15:49:50.000000000 +0200
+++ ./users.php	2014-08-23 14:57:43.000000000 +0200
@@ -73,14 +73,70 @@
 	'del_group_user' =>		array(T_ZBX_STR, O_OPT, P_SYS|P_ACT,	null,	null),
 	'change_password' =>	array(T_ZBX_STR, O_OPT, P_SYS|P_ACT,	null,	null),
 	'cancel' =>				array(T_ZBX_STR, O_OPT, P_SYS,			null,	null),
+	// filter
+	'filter_set' =>			array(T_ZBX_STR, O_OPT, P_ACT,  null, null),
+	'filter_alias' =>		array(T_ZBX_STR, O_OPT, null,   null, null),
+	'filter_name' =>		array(T_ZBX_STR, O_OPT, null,   null, null),
+	'filter_surname' =>		array(T_ZBX_STR, O_OPT, null,   null, null),
+	'filter_type' =>		array(T_ZBX_INT, O_OPT, null,   IN(array(-1, 1, 2, 3)), null),
+	'filter_online' =>		array(T_ZBX_INT, O_OPT, null,   IN(array(-1, 0, 1)), null),
+	'filter_access' =>		array(T_ZBX_INT, O_OPT, null,   IN(array(-1, 0, 1, 2)), null),
+	'filter_debug' =>		array(T_ZBX_INT, O_OPT, null,   IN(array(-1, 0, 1)), null),
+	'filter_status' =>		array(T_ZBX_INT, O_OPT, null,   IN(array(-1, 0, 1)), null),
 	// form
 	'form' =>				array(T_ZBX_STR, O_OPT, P_SYS,			null,	null),
-	'form_refresh' =>		array(T_ZBX_STR, O_OPT, null,			null,	null)
+	'form_refresh' =>		array(T_ZBX_STR, O_OPT, null,			null,	null),
+	// ajax
+	'favobj' =>			array(T_ZBX_STR, O_OPT, P_ACT,  null,           null),
+	'favref' =>			array(T_ZBX_STR, O_OPT, P_ACT,  NOT_EMPTY,      'isset({favobj})'),
+	'favstate' =>			array(T_ZBX_INT, O_OPT, P_ACT,  NOT_EMPTY,      'isset({favobj})&&("filter"=={favobj})')
 );
 check_fields($fields);
 validate_sort_and_sortorder('alias', ZBX_SORT_UP);
 
 /*
+ * Ajax
+ */
+if (isset($_REQUEST['favobj'])) {
+	if ($_REQUEST['favobj'] == 'filter') {
+		CProfile::update('web.users.filter.state', $_REQUEST['favstate'], PROFILE_TYPE_INT);
+	}
+}
+
+/*
+ * Filter
+ */
+if (isset($_REQUEST['filter_set'])) {
+	$_REQUEST['filter_alias'] = get_request('filter_alias');
+	$_REQUEST['filter_name'] = get_request('filter_name');
+	$_REQUEST['filter_surname'] = get_request('filter_surname');
+	$_REQUEST['filter_type'] = get_request('filter_type', -1);
+	$_REQUEST['filter_online'] = get_request('filter_online', -1);
+	$_REQUEST['filter_access'] = get_request('filter_access', -1);
+	$_REQUEST['filter_debug'] = get_request('filter_debug', -1);
+	$_REQUEST['filter_status'] = get_request('filter_status', -1);
+
+	CProfile::update('web.users.filter_alias', $_REQUEST['filter_alias'], PROFILE_TYPE_STR);
+	CProfile::update('web.users.filter_name', $_REQUEST['filter_name'], PROFILE_TYPE_STR);
+	CProfile::update('web.users.filter_surname', $_REQUEST['filter_surname'], PROFILE_TYPE_STR);
+	CProfile::update('web.users.filter_type', $_REQUEST['filter_type'], PROFILE_TYPE_STR);
+	CProfile::update('web.users.filter_online', $_REQUEST['filter_online'], PROFILE_TYPE_STR);
+	CProfile::update('web.users.filter_access', $_REQUEST['filter_access'], PROFILE_TYPE_STR);
+	CProfile::update('web.users.filter_debug', $_REQUEST['filter_debug'], PROFILE_TYPE_STR);
+	CProfile::update('web.users.filter_status', $_REQUEST['filter_status'], PROFILE_TYPE_STR);
+}
+else {
+	$_REQUEST['filter_alias'] = CProfile::get('web.users.filter_alias');
+	$_REQUEST['filter_name'] = CProfile::get('web.users.filter_name');
+	$_REQUEST['filter_surname'] = CProfile::get('web.users.filter_surname');
+	$_REQUEST['filter_type'] = CProfile::get('web.users.filter_type', -1);
+	$_REQUEST['filter_online'] = CProfile::get('web.users.filter_online', -1);
+	$_REQUEST['filter_access'] = CProfile::get('web.users.filter_access', -1);
+	$_REQUEST['filter_debug'] = CProfile::get('web.users.filter_debug', -1);
+	$_REQUEST['filter_status'] = CProfile::get('web.users.filter_status', -1);
+}
+
+/*
  * Permissions
  */
 if (isset($_REQUEST['userid'])) {
@@ -409,7 +465,15 @@
 }
 else {
 	$data = array(
-		'displayNodes' => is_array(get_current_nodeid())
+		'displayNodes' => is_array(get_current_nodeid()),
+		'filter_alias' => get_request('filter_alias'),
+		'filter_name' => get_request('filter_name'),
+		'filter_surname' => get_request('filter_surname'),
+		'filter_type' => get_request('filter_type'),
+		'filter_online' => get_request('filter_online'),
+		'filter_access' => get_request('filter_access'),
+		'filter_debug' => get_request('filter_debug'),
+		'filter_status' => get_request('filter_status')
 	);
 
 	// get user groups
@@ -418,18 +482,35 @@
 	));
 	order_result($data['userGroups'], 'name');
 
-	// get users
-	$data['users'] = API::User()->get(array(
+	$options = array(
 		'usrgrpids' => ($_REQUEST['filter_usrgrpid'] > 0) ? $_REQUEST['filter_usrgrpid'] : null,
 		'output' => API_OUTPUT_EXTEND,
 		'selectUsrgrps' => API_OUTPUT_EXTEND,
 		'getAccess' => 1,
 		'limit' => $config['search_limit'] + 1
-	));
+	);
+
+	if (!zbx_empty($data['filter_alias'])) {
+		$options['search']['alias'] = $data['filter_alias'];
+	}
+
+	if (!zbx_empty($data['filter_name'])) {
+		$options['search']['name'] = $data['filter_name'];
+	}
+
+	if (!zbx_empty($data['filter_surname'])) {
+		$options['search']['surname'] = $data['filter_surname'];
+	}
+
+	if ($data['filter_type'] > -1) {
+		$options['filter']['type'] = $data['filter_type'];
+	}
+
+	// get users
+	$data['users'] = API::User()->get($options);
 
 	// sorting & paging
 	order_result($data['users'], getPageSortField('alias'), getPageSortOrder());
-	$data['paging'] = getPagingLine($data['users'], array('userid'));
 
 	foreach ($data['users'] as $key => $user) {
 		// nodes
@@ -451,6 +532,37 @@
 		}
 	}
 
+	if ($data['filter_online'] > -1 || $data['filter_access'] > -1 || $data['filter_debug'] > -1 || $data['filter_status'] > -1) {
+		foreach ($data['users'] as $key => $user) {
+			$userid = $user['userid'];
+
+			if ($data['filter_online'] > -1) {
+				$session = $data['usersSessions'][$userid];
+				$online_time = ($user['autologout'] == 0 || ZBX_USER_ONLINE_TIME < $user['autologout']) ? ZBX_USER_ONLINE_TIME : $user['autologout'];
+
+				if ($session['lastaccess'] && ($session['lastaccess'] + $online_time) >= time()) {
+					if ($data['filter_online'] == 0) unset($data['users'][$key]);
+				} else {
+					if ($data['filter_online'] == 1) unset($data['users'][$key]);
+				}
+			}
+
+			if ($data['filter_access'] > -1) {
+				if ($user['gui_access'] != $data['filter_access']) unset($data['users'][$key]);
+			}
+
+			if ($data['filter_debug'] > -1) {
+				if ($user['debug_mode'] != $data['filter_debug']) unset($data['users'][$key]);
+			}
+
+			if ($data['filter_status'] > -1) {
+				if ($user['users_status'] != $data['filter_status']) unset($data['users'][$key]);
+			}
+		}
+	}
+
+	$data['paging'] = getPagingLine($data['users']);
+
 	// render view
 	$usersView = new CView('administration.users.list', $data);
 	$usersView->render();
