diff --git a/sai/modules/saimod_sys_security/qq/SYS_SAIMOD_SECURITY_USERS.php b/sai/modules/saimod_sys_security/qq/SYS_SAIMOD_SECURITY_USERS.php index 97334f3..b153104 100644 --- a/sai/modules/saimod_sys_security/qq/SYS_SAIMOD_SECURITY_USERS.php +++ b/sai/modules/saimod_sys_security/qq/SYS_SAIMOD_SECURITY_USERS.php @@ -3,9 +3,15 @@ namespace SYSTEM\SQL; class SYS_SAIMOD_SECURITY_USERS extends \SYSTEM\DB\QP { public static function get_class(){return \get_class();} public static function pgsql(){return -'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 $2 ORDER BY last_active DESC;'; +'SELECT id,username,email,joindate,locale, EXTRACT(EPOCH FROM last_active) as last_active, email_confirmed'. +' FROM system.user'. +' WHERE username LIKE $1 OR email LIKE $2'. +' ORDER BY last_active DESC;'; } public static function mysql(){return -'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;'; +'SELECT id,username,email,joindate,locale,unix_timestamp(last_active)as last_active, email_confirmed'. +' FROM system_user'. +' WHERE username LIKE ? OR email LIKE ?'. +' ORDER BY last_active DESC;'; } } \ No newline at end of file diff --git a/security/qq/SYS_SECURITY_AVAILABLE.php b/security/qq/SYS_SECURITY_AVAILABLE.php index 5539cb4..01266fb 100644 --- a/security/qq/SYS_SECURITY_AVAILABLE.php +++ b/security/qq/SYS_SECURITY_AVAILABLE.php @@ -4,10 +4,10 @@ class SYS_SECURITY_AVAILABLE extends \SYSTEM\DB\QP { public static function get_class(){return \get_class();} public static function pgsql(){return 'SELECT COUNT(*) as count FROM '.\SYSTEM\SQL\system_user::NAME_PG. -' WHERE lower('.\SYSTEM\SQL\system_user::FIELD_USERNAME.') like lower($1);'; +' WHERE UPPER('.\SYSTEM\SQL\system_user::FIELD_USERNAME.') like UPPER($1);'; } public static function mysql(){return 'SELECT COUNT(*) as count FROM '.\SYSTEM\SQL\system_user::NAME_MYS. -' WHERE lower('.\SYSTEM\SQL\system_user::FIELD_USERNAME.') like lower(?);'; +' WHERE UPPER('.\SYSTEM\SQL\system_user::FIELD_USERNAME.') like UPPER(?);'; } } \ No newline at end of file diff --git a/sql/qt/mysql/data/system_text.sql b/sql/qt/mysql/data/system_text.sql index 562dfbe..dc44503 100644 --- a/sql/qt/mysql/data/system_text.sql +++ b/sql/qt/mysql/data/system_text.sql @@ -519,6 +519,7 @@ INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('basic_rename', 'enUS', 'Rename', 2, 1, '2015-04-16 23:11:18', '2015-04-16 23:11:18'); INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_rename', 'basic'); INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_rename', 'sai_files'); + INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_rename', 'sai_security'); DELETE FROM `system_text` WHERE id = 'basic_upload'; DELETE FROM `system_text_tag` WHERE id = 'basic_upload'; @@ -649,6 +650,62 @@ INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_generate', 'basic'); INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_generate', 'sai_docu'); + DELETE FROM `system_text` WHERE id = 'basic_confirm_email'; + DELETE FROM `system_text_tag` WHERE id = 'basic_confirm_email'; + INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('basic_confirm_email', 'deDE', 'EMail bestätigen', 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_confirm_email', 'enUS', 'Confirm EMail', 2, 1, '2015-04-16 23:11:18', '2015-04-16 23:11:18'); + INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_confirm_email', 'basic'); + INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_confirm_email', 'sai_security'); + + DELETE FROM `system_text` WHERE id = 'basic_change_password'; + DELETE FROM `system_text_tag` WHERE id = 'basic_change_password'; + INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('basic_change_password', 'deDE', 'Password ändern', 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_change_password', 'enUS', 'Change Password', 2, 1, '2015-04-16 23:11:18', '2015-04-16 23:11:18'); + INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_change_password', 'basic'); + INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_change_password', 'sai_security'); + + DELETE FROM `system_text` WHERE id = 'basic_reset_password'; + DELETE FROM `system_text_tag` WHERE id = 'basic_reset_password'; + INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('basic_reset_password', 'deDE', 'Password zurücksetzen', 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_reset_password', 'enUS', 'Reset Password', 2, 1, '2015-04-16 23:11:18', '2015-04-16 23:11:18'); + INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_reset_password', 'basic'); + INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_reset_password', 'sai_security'); + + DELETE FROM `system_text` WHERE id = 'basic_change_email'; + DELETE FROM `system_text_tag` WHERE id = 'basic_change_email'; + INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('basic_change_email', 'deDE', 'EMail ändern', 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_change_email', 'enUS', 'Change EMail', 2, 1, '2015-04-16 23:11:18', '2015-04-16 23:11:18'); + INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_change_email', 'basic'); + INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_change_email', 'sai_security'); + + DELETE FROM `system_text` WHERE id = 'basic_password_old'; + DELETE FROM `system_text_tag` WHERE id = 'basic_password_old'; + INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('basic_password_old', 'deDE', 'Altes Passwort', 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_password_old', 'enUS', 'Old Password', 2, 1, '2015-04-16 23:11:18', '2015-04-16 23:11:18'); + INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_password_old', 'basic'); + INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_password_old', 'sai_security'); + + DELETE FROM `system_text` WHERE id = 'basic_password_new'; + DELETE FROM `system_text_tag` WHERE id = 'basic_password_new'; + INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('basic_password_new', 'deDE', 'Neues Passwort', 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_password_new', 'enUS', 'New Password', 2, 1, '2015-04-16 23:11:18', '2015-04-16 23:11:18'); + INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_password_new', 'basic'); + INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_password_new', 'sai_security'); + + DELETE FROM `system_text` WHERE id = 'basic_email_new'; + DELETE FROM `system_text_tag` WHERE id = 'basic_email_new'; + INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('basic_email_new', 'deDE', 'Neue Email', 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_email_new', 'enUS', 'New Email', 2, 1, '2015-04-16 23:11:18', '2015-04-16 23:11:18'); + INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_email_new', 'basic'); + INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_email_new', 'sai_security'); + + DELETE FROM `system_text` WHERE id = 'basic_username_new'; + DELETE FROM `system_text_tag` WHERE id = 'basic_username_new'; + INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('basic_username_new', 'deDE', 'Neuer Username', 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_username_new', 'enUS', 'New Username', 2, 1, '2015-04-16 23:11:18', '2015-04-16 23:11:18'); + INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_username_new', 'basic'); + INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_username_new', 'sai_security'); + -- SAI DELETE FROM `system_text` WHERE id = 'sai_api_title'; DELETE FROM `system_text_tag` WHERE id = 'sai_api_title'; @@ -1230,6 +1287,7 @@ INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('table_action', 'deDE', 'Aktion', 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_action', 'enUS', 'Action', 2, 2, '2015-04-18 13:56:53', '2015-04-18 13:56:53'); INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('table_action', 'sai_todo'); + INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('table_action', 'sai_security'); INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('table_action', 'table'); DELETE FROM `system_text` WHERE id = 'table_username'; @@ -1350,6 +1408,11 @@ 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'); + REPLACE INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('table_email_confirmed', 'deDE', 'Email bestätigt', 10, 10, '2016-06-01 15:49:43', '2016-06-01 15:49:43'); + REPLACE INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('table_email_confirmed', 'enUS', 'Email Confirmed', 10, 10, '2016-06-01 15:49:28', '2016-06-01 15:49:28'); + REPLACE INTO `system_text_tag` (`id`, `tag`) VALUES ('table_email_confirmed', 'sai_security'); + REPLACE INTO `system_text_tag` (`id`, `tag`) VALUES ('table_email_confirmed', 'table'); + -- Time DELETE FROM `system_text` WHERE id = 'time_ago'; diff --git a/sql/qt/mysql/schema/system_user.sql b/sql/qt/mysql/schema/system_user.sql index 65e1f64..8beca16 100644 --- a/sql/qt/mysql/schema/system_user.sql +++ b/sql/qt/mysql/schema/system_user.sql @@ -6,8 +6,8 @@ CREATE TABLE `system_user` ( `email` CHAR(255) NOT NULL, `joindate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, `locale` CHAR(6) NOT NULL DEFAULT 'enUS', - `last_active` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00', - `account_flag` INT(10) NULL DEFAULT NULL, + `last_active` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + `email_confirmed` INT(11) NULL DEFAULT NULL, PRIMARY KEY (`id`) ) COLLATE='utf8_general_ci' diff --git a/sql/qt/pgsql/schema/system_user.sql b/sql/qt/pgsql/schema/system_user.sql index 1b11fa2..3388c16 100644 --- a/sql/qt/pgsql/schema/system_user.sql +++ b/sql/qt/pgsql/schema/system_user.sql @@ -8,7 +8,7 @@ CREATE TABLE system."user" joindate timestamp with time zone NOT NULL DEFAULT now(), locale character varying(6) NOT NULL DEFAULT 'enUS'::character varying, last_active timestamp with time zone NOT NULL DEFAULT now(), - account_flag integer, + email_confirmed integer DEFAULT NULL, CONSTRAINT system_user_pk_id PRIMARY KEY (id) ) WITH ( diff --git a/sql/tbl/system_user.php b/sql/tbl/system_user.php index ca2b613..2bb51b3 100644 --- a/sql/tbl/system_user.php +++ b/sql/tbl/system_user.php @@ -15,5 +15,5 @@ class system_user { const FIELD_JOINDATE = 'joindate'; const FIELD_LOCALE = 'locale'; const FIELD_LAST_ACTIVE = 'last_active'; - const FIELD_ACCOUNT_FLAG = 'account_flag'; + const FIELD_EMAIL_CONFIRMED = 'email_confirmed'; } \ No newline at end of file