security pagination, filtering, search, texts
This commit is contained in:
parent
85ce1066b4
commit
d4820a26b2
@ -36,7 +36,7 @@ INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`,
|
|||||||
INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (93, 42, 'lib', 'mod', 90, 0, 1, '#tab_mod', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_mod&action=lib', 'init_saimod_sys_mod_lib', '\\SYSTEM\\SAI\\saimod_sys_mod');
|
INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (93, 42, 'lib', 'mod', 90, 0, 1, '#tab_mod', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_mod&action=lib', 'init_saimod_sys_mod_lib', '\\SYSTEM\\SAI\\saimod_sys_mod');
|
||||||
|
|
||||||
INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (100, 42, 'security', 'security', -1, 0, 0, '#content', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_security', 'init_saimod_sys_security', '\\SYSTEM\\SAI\\saimod_sys_security');
|
INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (100, 42, 'security', 'security', -1, 0, 0, '#content', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_security', 'init_saimod_sys_security', '\\SYSTEM\\SAI\\saimod_sys_security');
|
||||||
INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (101, 42, 'users', 'security', 100, 0, 0, '#tab_security', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_security&action=users&search=${search}', 'init_saimod_sys_security_users', '\\SYSTEM\\SAI\\saimod_sys_security');
|
INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (101, 42, 'users', 'security', 100, 0, 0, '#tab_security', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_security&action=users&filter=${filter}&search=${search}&page=${page}', 'init_saimod_sys_security_users', '\\SYSTEM\\SAI\\saimod_sys_security');
|
||||||
INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (102, 42, 'rights', 'security', 100, 0, 1, '#tab_security', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_security&action=rights', 'init_saimod_sys_security_rights', '\\SYSTEM\\SAI\\saimod_sys_security');
|
INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (102, 42, 'rights', 'security', 100, 0, 1, '#tab_security', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_security&action=rights', 'init_saimod_sys_security_rights', '\\SYSTEM\\SAI\\saimod_sys_security');
|
||||||
INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (103, 42, 'user', 'security', 100, 0, 1, '#tab_security', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_security&action=user&username=${username}', 'init_saimod_sys_security_user', '\\SYSTEM\\SAI\\saimod_sys_security');
|
INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (103, 42, 'user', 'security', 100, 0, 1, '#tab_security', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_security&action=user&username=${username}', 'init_saimod_sys_security_user', '\\SYSTEM\\SAI\\saimod_sys_security');
|
||||||
INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (104, 42, 'newright', 'security', 100, 0, 1, '#tab_security', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_security&action=newright', 'init_saimod_sys_security_newright', '\\SYSTEM\\SAI\\saimod_sys_security');
|
INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (104, 42, 'newright', 'security', 100, 0, 1, '#tab_security', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_security&action=newright', 'init_saimod_sys_security_newright', '\\SYSTEM\\SAI\\saimod_sys_security');
|
||||||
|
|||||||
@ -60,7 +60,9 @@ INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `nam
|
|||||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (300, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_security', 'action', NULL);
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (300, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_security', 'action', NULL);
|
||||||
--
|
--
|
||||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (301, 42, 2, 300, 'user', 'username', 'STRING');
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (301, 42, 2, 300, 'user', 'username', 'STRING');
|
||||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (302, 42, 3, 300, 'users', 'search', 'STRING');
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (302, 42, 3, 300, 'users', 'filter', 'STRING');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (303, 42, 3, 300, 'users', 'search', 'STRING');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (304, 42, 3, 300, 'users', 'page', 'UINT0');
|
||||||
--
|
--
|
||||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (310, 42, 2, 300, 'addright', 'id', 'UINT');
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (310, 42, 2, 300, 'addright', 'id', 'UINT');
|
||||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (311, 42, 2, 300, 'addright', 'name', 'STRING');
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (311, 42, 2, 300, 'addright', 'name', 'STRING');
|
||||||
|
|||||||
@ -27,6 +27,7 @@
|
|||||||
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_all', 'basic');
|
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_all', 'basic');
|
||||||
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_all', 'sai_log');
|
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_all', 'sai_log');
|
||||||
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_all', 'sai_todo');
|
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_all', 'sai_todo');
|
||||||
|
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_all', 'sai_security');
|
||||||
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_all', 'sai_text');
|
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_all', 'sai_text');
|
||||||
|
|
||||||
DELETE FROM `system_text` WHERE id = 'basic_analytics';
|
DELETE FROM `system_text` WHERE id = 'basic_analytics';
|
||||||
@ -267,6 +268,7 @@
|
|||||||
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('basic_placeholder_search', 'enUS', 'I\'m searching for...', 0, 0, '2015-04-15 18:29:16', '0000-00-00 00:00:00');
|
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('basic_placeholder_search', 'enUS', 'I\'m searching for...', 0, 0, '2015-04-15 18:29:16', '0000-00-00 00:00:00');
|
||||||
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_placeholder_search', 'basic');
|
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_placeholder_search', 'basic');
|
||||||
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_placeholder_search', 'sai_todo');
|
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_placeholder_search', 'sai_todo');
|
||||||
|
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_placeholder_search', 'sai_security');
|
||||||
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_placeholder_search', 'sai_log');
|
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_placeholder_search', 'sai_log');
|
||||||
|
|
||||||
DELETE FROM `system_text` WHERE id = 'basic_progress';
|
DELETE FROM `system_text` WHERE id = 'basic_progress';
|
||||||
@ -602,6 +604,14 @@
|
|||||||
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_page', 'basic');
|
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_page', 'basic');
|
||||||
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_page', 'sai_todo');
|
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_page', 'sai_todo');
|
||||||
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_page', 'sai_log');
|
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_page', 'sai_log');
|
||||||
|
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_page', 'sai_security');
|
||||||
|
|
||||||
|
DELETE FROM `system_text` WHERE id = 'basic_add_right';
|
||||||
|
DELETE FROM `system_text_tag` WHERE id = 'basic_add_right';
|
||||||
|
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('basic_add_right', 'deDE', 'Recht hinzufügen', 1, 1, '2015-04-16 23:11:18', '2015-04-16 16:48:36');
|
||||||
|
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('basic_add_right', 'enUS', 'Add Right', 2, 1, '2015-04-16 23:11:18', '2015-04-16 23:11:18');
|
||||||
|
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_add_right', 'basic');
|
||||||
|
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_add_right', 'sai_security');
|
||||||
|
|
||||||
-- SAI
|
-- SAI
|
||||||
DELETE FROM `system_text` WHERE id = 'sai_api_title';
|
DELETE FROM `system_text` WHERE id = 'sai_api_title';
|
||||||
@ -964,6 +974,7 @@
|
|||||||
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('table_id', 'sai_log');
|
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('table_id', 'sai_log');
|
||||||
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('table_id', 'sai_todo');
|
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('table_id', 'sai_todo');
|
||||||
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('table_id', 'sai_text');
|
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('table_id', 'sai_text');
|
||||||
|
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('table_id', 'sai_security');
|
||||||
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('table_id', 'table');
|
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('table_id', 'table');
|
||||||
|
|
||||||
DELETE FROM `system_text` WHERE id = 'table_ip';
|
DELETE FROM `system_text` WHERE id = 'table_ip';
|
||||||
@ -1149,6 +1160,7 @@
|
|||||||
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('table_username', 'enUS', 'Username', 2, 2, '2015-04-18 13:56:53', '2015-04-18 13:56:53');
|
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('table_username', 'enUS', 'Username', 2, 2, '2015-04-18 13:56:53', '2015-04-18 13:56:53');
|
||||||
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('table_username', 'sai_todo');
|
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('table_username', 'sai_todo');
|
||||||
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('table_username', 'sai_start');
|
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('table_username', 'sai_start');
|
||||||
|
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('table_username', 'sai_security');
|
||||||
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('table_username', 'table');
|
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('table_username', 'table');
|
||||||
|
|
||||||
DELETE FROM `system_text` WHERE id = 'table_open';
|
DELETE FROM `system_text` WHERE id = 'table_open';
|
||||||
@ -1225,6 +1237,41 @@
|
|||||||
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('table_priority', 'sai_todo');
|
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('table_priority', 'sai_todo');
|
||||||
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('table_priority', 'table');
|
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('table_priority', 'table');
|
||||||
|
|
||||||
|
DELETE FROM `system_text` WHERE id = 'table_email';
|
||||||
|
DELETE FROM `system_text_tag` WHERE id = 'table_email';
|
||||||
|
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('table_email', 'deDE', 'E-Mail', 2, 2, '2015-04-23 01:58:25', '2015-04-23 01:58:25');
|
||||||
|
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('table_email', 'enUS', 'EMail', 2, 2, '2015-04-18 13:56:53', '2015-04-18 13:56:53');
|
||||||
|
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('table_email', 'sai_security');
|
||||||
|
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('table_email', 'table');
|
||||||
|
|
||||||
|
DELETE FROM `system_text` WHERE id = 'table_join_date';
|
||||||
|
DELETE FROM `system_text_tag` WHERE id = 'table_join_date';
|
||||||
|
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('table_join_date', 'deDE', 'Beitrittsdatum', 2, 2, '2015-04-23 01:58:25', '2015-04-23 01:58:25');
|
||||||
|
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('table_join_date', 'enUS', 'Join Date', 2, 2, '2015-04-18 13:56:53', '2015-04-18 13:56:53');
|
||||||
|
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('table_join_date', 'sai_security');
|
||||||
|
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('table_join_date', 'table');
|
||||||
|
|
||||||
|
DELETE FROM `system_text` WHERE id = 'table_language';
|
||||||
|
DELETE FROM `system_text_tag` WHERE id = 'table_language';
|
||||||
|
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('table_language', 'deDE', 'Sprache', 2, 2, '2015-04-23 01:58:25', '2015-04-23 01:58:25');
|
||||||
|
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('table_language', 'enUS', 'Language', 2, 2, '2015-04-18 13:56:53', '2015-04-18 13:56:53');
|
||||||
|
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('table_language', 'sai_security');
|
||||||
|
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('table_language', 'table');
|
||||||
|
|
||||||
|
DELETE FROM `system_text` WHERE id = 'table_last_active';
|
||||||
|
DELETE FROM `system_text_tag` WHERE id = 'table_last_active';
|
||||||
|
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('table_last_active', 'deDE', 'Zuletzt aktiv', 2, 2, '2015-04-23 01:58:25', '2015-04-23 01:58:25');
|
||||||
|
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('table_last_active', 'enUS', 'Last active', 2, 2, '2015-04-18 13:56:53', '2015-04-18 13:56:53');
|
||||||
|
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('table_last_active', 'sai_security');
|
||||||
|
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('table_last_active', 'table');
|
||||||
|
|
||||||
|
DELETE FROM `system_text` WHERE id = 'table_reset_password';
|
||||||
|
DELETE FROM `system_text_tag` WHERE id = 'table_reset_password';
|
||||||
|
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('table_reset_password', 'deDE', 'Passwort zurücksetzen', 2, 2, '2015-04-23 01:58:25', '2015-04-23 01:58:25');
|
||||||
|
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('table_reset_password', 'enUS', 'Reset Password', 2, 2, '2015-04-18 13:56:53', '2015-04-18 13:56:53');
|
||||||
|
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('table_reset_password', 'sai_security');
|
||||||
|
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('table_reset_password', 'table');
|
||||||
|
|
||||||
-- Time
|
-- Time
|
||||||
|
|
||||||
DELETE FROM `system_text` WHERE id = 'time_ago';
|
DELETE FROM `system_text` WHERE id = 'time_ago';
|
||||||
|
|||||||
@ -6,15 +6,20 @@ function init_saimod_sys_security() {
|
|||||||
$(this).parent().addClass('active');
|
$(this).parent().addClass('active');
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#user_go').click(function(){
|
|
||||||
system.load('security;search.'+encodeURIComponent($('#user_search').val()));})
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function register_search(){
|
||||||
|
$('#btn_search').click(function(){
|
||||||
|
system.load($(this).attr('state')+$('#input_search').val(),true);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function init_saimod_sys_security_users() {
|
function init_saimod_sys_security_users() {
|
||||||
$("#sai_mod_security_table").tablesorter();
|
$("#sai_mod_security_table").tablesorter();
|
||||||
$('#securitytab li').each(function(){
|
$('#securitytab li').each(function(){
|
||||||
$(this).removeClass('active');});
|
$(this).removeClass('active');});
|
||||||
$('#menu_users').parent().addClass('active');
|
$('#menu_users').parent().addClass('active');
|
||||||
|
register_search();
|
||||||
}
|
}
|
||||||
|
|
||||||
function init_saimod_sys_security_user() {
|
function init_saimod_sys_security_user() {
|
||||||
|
|||||||
@ -5,7 +5,7 @@ class SYS_SAIMOD_SECURITY_USERS extends \SYSTEM\DB\QP {
|
|||||||
protected static function query(){
|
protected static function query(){
|
||||||
return new \SYSTEM\DB\QQuery(get_class(),
|
return new \SYSTEM\DB\QQuery(get_class(),
|
||||||
//pg
|
//pg
|
||||||
'SELECT id,username,email,joindate,locale, EXTRACT(EPOCH FROM last_active) as last_active, account_flag FROM system.user WHERE username LIKE $1 OR email LIKE $1 ORDER BY last_active DESC LIMIT 100;',
|
'SELECT id,username,email,joindate,locale, EXTRACT(EPOCH FROM last_active) as last_active, account_flag FROM system.user WHERE username LIKE $1 OR email LIKE $1 ORDER BY last_active DESC;',
|
||||||
//mys
|
//mys
|
||||||
'SELECT id,username,email,joindate,locale,unix_timestamp(last_active)as last_active, account_flag FROM system_user WHERE username LIKE ? OR email LIKE ? ORDER BY last_active DESC LIMIT 100;'
|
'SELECT id,username,email,joindate,locale,unix_timestamp(last_active)as last_active, account_flag FROM system_user WHERE username LIKE ? OR email LIKE ? ORDER BY last_active DESC;'
|
||||||
);}}
|
);}}
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
<?php
|
||||||
|
namespace SYSTEM\DBD;
|
||||||
|
|
||||||
|
class SYS_SAIMOD_SECURITY_USERS_FILTER extends \SYSTEM\DB\QP {
|
||||||
|
protected static function query(){
|
||||||
|
return new \SYSTEM\DB\QQuery(get_class(),
|
||||||
|
//pg
|
||||||
|
'todo',
|
||||||
|
//mys
|
||||||
|
'SELECT id,username,email,joindate,locale,unix_timestamp(last_active)as last_active, account_flag'.
|
||||||
|
' FROM system_user'.
|
||||||
|
' LEFT JOIN system_user_to_rights ON system_user.ID = system_user_to_rights.userID'.
|
||||||
|
' WHERE (username LIKE ? OR email LIKE ?) AND rightID = ?'.
|
||||||
|
' ORDER BY last_active DESC;'
|
||||||
|
);}}
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
<?php
|
||||||
|
namespace SYSTEM\DBD;
|
||||||
|
|
||||||
|
class SYS_SAIMOD_SECURITY_USER_COUNT_FILTER extends \SYSTEM\DB\QP {
|
||||||
|
protected static function query(){
|
||||||
|
return new \SYSTEM\DB\QQuery(get_class(),
|
||||||
|
//pg
|
||||||
|
'TODO',
|
||||||
|
//mys
|
||||||
|
'SELECT count(*) as count FROM system_user'.
|
||||||
|
' LEFT JOIN system_user_to_rights ON system_user.ID = system_user_to_rights.userID'.
|
||||||
|
' WHERE (username LIKE ? OR email LIKE ?) AND rightID = ?;'
|
||||||
|
);}}
|
||||||
|
|
||||||
@ -116,19 +116,37 @@ class saimod_sys_security extends \SYSTEM\SAI\SaiModule {
|
|||||||
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/tpl/saimod_sys_security_user_view.tpl'),$vars);
|
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/tpl/saimod_sys_security_user_view.tpl'),$vars);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function sai_mod__SYSTEM_SAI_saimod_sys_security_action_users($search = null){
|
public static function sai_mod__SYSTEM_SAI_saimod_sys_security_action_users($filter = "all",$search="%",$page=0){
|
||||||
$search = '%'.$search.'%';
|
$count = $filter == "all" ? \SYSTEM\DBD\SYS_SAIMOD_SECURITY_USER_COUNT::Q1(array($search,$search))['count'] :
|
||||||
$count = \SYSTEM\DBD\SYS_SAIMOD_SECURITY_USER_COUNT::Q1(array($search),array($search,$search));
|
\SYSTEM\DBD\SYS_SAIMOD_SECURITY_USER_COUNT_FILTER::Q1(array($search,$search,$filter))['count'];
|
||||||
$rows = '';
|
$vars = array();
|
||||||
$res = \SYSTEM\DBD\SYS_SAIMOD_SECURITY_USERS::QQ(array($search),array($search,$search));
|
$vars['filter'] = $filter;
|
||||||
while($r = $res->next()){
|
$vars['search'] = $search;
|
||||||
|
$vars['page'] = $page;
|
||||||
|
$vars['table'] = '';
|
||||||
|
$res = $filter == "all" ? \SYSTEM\DBD\SYS_SAIMOD_SECURITY_USERS::QQ(array($search),array($search,$search)) :
|
||||||
|
\SYSTEM\DBD\SYS_SAIMOD_SECURITY_USERS_FILTER::QQ(array($search,$search,$filter));
|
||||||
|
$count_filtered = 0;
|
||||||
|
$res->seek(100*$page);
|
||||||
|
while(($r = $res->next()) && ($count_filtered < 100)){
|
||||||
$r['class'] = self::tablerow_class($r['last_active']);
|
$r['class'] = self::tablerow_class($r['last_active']);
|
||||||
$r['time_elapsed'] = \SYSTEM\time::time_ago_string($r['last_active']);
|
$r['time_elapsed'] = \SYSTEM\time::time_ago_string($r['last_active']);
|
||||||
$rows .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/tpl/saimod_sys_security_user.tpl'),$r);
|
$vars['table'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/tpl/saimod_sys_security_user.tpl'),$r);
|
||||||
|
$count_filtered++;
|
||||||
}
|
}
|
||||||
$vars = array();
|
$vars['pagination'] = '';
|
||||||
$vars['rows'] = $rows;
|
$vars['page_last'] = ceil($count/100)-1;
|
||||||
$vars['count'] = $count['count'];
|
for($i=0;$i < ceil($count/100);$i++){
|
||||||
|
$data = array('page' => $i,'search' => $search, 'filter' => $filter, 'active' => ($i == $page) ? 'active' : '');
|
||||||
|
$vars['pagination'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/tpl/saimod_sys_security_pagination.tpl'), $data);
|
||||||
|
}
|
||||||
|
$vars['count'] = $count_filtered.'/'.$count;
|
||||||
|
$vars['right_filter'] = '';
|
||||||
|
$res = \SYSTEM\DBD\SYS_SAIMOD_SECURITY_RIGHTS::QQ();
|
||||||
|
while($row = $res->next()){
|
||||||
|
$data = array('active' => ($filter == $row['ID'] ? 'active' : ''), 'filter' => $row['ID'], 'search' => $search, 'name' => $row['name']);
|
||||||
|
$vars['right_filter'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/tpl/saimod_sys_security_right_filter.tpl'),$data);}
|
||||||
|
$vars['active'] = ($filter == 'all' ? 'active' : '');
|
||||||
$vars = array_merge($vars,\SYSTEM\PAGE\text::tag(\SYSTEM\DBD\system_text::TAG_SAI_SECURITY));
|
$vars = array_merge($vars,\SYSTEM\PAGE\text::tag(\SYSTEM\DBD\system_text::TAG_SAI_SECURITY));
|
||||||
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/tpl/saimod_sys_security_users.tpl'),$vars);
|
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/tpl/saimod_sys_security_users.tpl'),$vars);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,8 +5,6 @@
|
|||||||
<li class="active"><a href="#!security" id="menu_users">Users</a></li>
|
<li class="active"><a href="#!security" id="menu_users">Users</a></li>
|
||||||
<li><a href="#!security(rights)" id="menu_rights">Rights</a></li>
|
<li><a href="#!security(rights)" id="menu_rights">Rights</a></li>
|
||||||
<img id="loader" src="${PICPATH}ajax-loader.gif" style="margin-left: 10px; margin-top: 10px; display: none; float: left"/>
|
<img id="loader" src="${PICPATH}ajax-loader.gif" style="margin-left: 10px; margin-top: 10px; display: none; float: left"/>
|
||||||
<button class="btn-sm btn btn-success" id="user_go" type="submit" style="float: right; margin-left: 10px;"><span class="glyphicon glyphicon-search" aria-hidden="true"></span> ${basic_search}</button>
|
|
||||||
<input class="input-medium search-query action-control" id="user_search" type="text" placeholder="EMail or Username" size="30" style="float: right;"/>
|
|
||||||
</ul>
|
</ul>
|
||||||
<div class="tab-content">
|
<div class="tab-content">
|
||||||
<div class="tab-pane active" id="tab_security"></div>
|
<div class="tab-pane active" id="tab_security"></div>
|
||||||
|
|||||||
@ -0,0 +1 @@
|
|||||||
|
<li class="${active}"><a href="#!security;filter.${filter};search.${search};page.${page}">${page}</a></li>
|
||||||
@ -0,0 +1 @@
|
|||||||
|
<li class="${active}"><a href="#!security;filter.${filter};search.${search}">${name}</a></li>
|
||||||
@ -5,11 +5,6 @@
|
|||||||
<td>${joindate}</td>
|
<td>${joindate}</td>
|
||||||
<td>${locale}</td>
|
<td>${locale}</td>
|
||||||
<td>${time_elapsed}</td>
|
<td>${time_elapsed}</td>
|
||||||
<td>${account_flag}</td>
|
|
||||||
<!--<td>
|
|
||||||
<input type="submit" class="btn" value="edit" user="${id}" action="edit">
|
|
||||||
<input type="submit" class="btn-danger" value="delete" user="${id}" action="delete">
|
|
||||||
</td>-->
|
|
||||||
<td>
|
<td>
|
||||||
<button type="submit" class="btn-sm btn btn-success" value="reset_password" user="${id}" email="${email}"><span class="glyphicon glyphicon-envelope" aria-hidden="true"></span> ${basic_send_email}</button>
|
<button type="submit" class="btn-sm btn btn-success" value="reset_password" user="${id}" email="${email}"><span class="glyphicon glyphicon-envelope" aria-hidden="true"></span> ${basic_send_email}</button>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@ -1,19 +1,26 @@
|
|||||||
Users: ${count}
|
<ul class="nav nav-pills" id="right_filter">
|
||||||
<table class="sai_table table table-hover table-condensed tablesorter" id="sai_mod_security_table" style="overflow: auto;">
|
<li class="${active}"><a href="#!security;filter.all;search.${search}">${basic_all}</a></li>
|
||||||
<thead>
|
${right_filter}
|
||||||
|
<button class="btn-sm btn btn-success" state="security;filter.${filter};search." id="btn_search" type="submit" style="float: right; margin-left: 10px;"><span class="glyphicon glyphicon-search" aria-hidden="true"></span> ${basic_search}</button>
|
||||||
|
<input class="input-medium search-query action-control" id="input_search" type="text" placeholder="${basic_placeholder_search}" size="20" style="float: right;" value="${search}"/>
|
||||||
|
</ul>
|
||||||
|
<div id="table_security">
|
||||||
|
<h6>${basic_rows}: ${count} ${basic_page}: ${page}</h6>
|
||||||
|
<table class="sai_table table table-hover table-condensed tablesorter" id="sai_mod_security_table" style="overflow: auto;">
|
||||||
<tr>
|
<tr>
|
||||||
<th>ID</th>
|
<th>${table_id}</th>
|
||||||
<th>Username</th>
|
<th>${table_username}</th>
|
||||||
<th>E-Mail</th>
|
<th>${table_email}</th>
|
||||||
<th>JoinDate</th>
|
<th>${table_join_date}</th>
|
||||||
<th>Locale</th>
|
<th>${table_language}</th>
|
||||||
<th>Last Active</th>
|
<th>${table_last_active}</th>
|
||||||
<th>Flag</th>
|
<th>${table_reset_password}</th>
|
||||||
<!--<th style="width: 110px;">Rights</th>-->
|
|
||||||
<th>reset password</th>
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
${table}
|
||||||
<tbody>
|
</table>
|
||||||
${rows}
|
<ul class="pagination">
|
||||||
</tbody>
|
<li><a href="#!security;filter.${filter};search.${search};page.0">«</a></li>
|
||||||
</table>
|
${pagination}
|
||||||
|
<li><a href="#!security;filter.${filter};search.${search};page.${page_last}">»</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
Loading…
x
Reference in New Issue
Block a user