Skip to content

Commit f30ba51

Browse files
committed
Reduce scope, validation state can later be stored in otp_data.
1 parent 792764f commit f30ba51

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ALTER TABLE `sys_user` ADD `otp_enabled` SET('n', 'y','v') NOT NULL DEFAULT 'n' COMMENT 'v=waiting for validation of the chosen otp method' AFTER `lost_password_reqtime`, ADD `otp_type` SET('email') NOT NULL DEFAULT 'email' AFTER `otp_enabled`, ADD `otp_data` VARCHAR(255) NULL AFTER `otp_type`, ADD `otp_recovery` VARCHAR(64) NULL AFTER `otp_data`, ADD `otp_attempts` TINYINT NOT NULL DEFAULT '0' AFTER `otp_recovery`;
1+
ALTER TABLE `sys_user` ADD `otp_type` SET('email') NOT NULL DEFAULT 'email' AFTER `otp_enabled`, ADD `otp_data` VARCHAR(255) NULL AFTER `otp_type`, ADD `otp_recovery` VARCHAR(64) NULL AFTER `otp_data`, ADD `otp_attempts` TINYINT NOT NULL DEFAULT '0' AFTER `otp_recovery`;

install/sql/ispconfig3.sql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1842,7 +1842,6 @@ CREATE TABLE `sys_user` (
18421842
`lost_password_function` tinyint(1) NOT NULL default '1',
18431843
`lost_password_hash` VARCHAR(50) NOT NULL default '',
18441844
`lost_password_reqtime` DATETIME NULL default NULL,
1845-
`otp_enabled` set('n','y','v') NOT NULL DEFAULT 'n',
18461845
`otp_type` set('email') NOT NULL DEFAULT 'email',
18471846
`otp_data` varchar(255) DEFAULT NULL,
18481847
`otp_recovery` varchar(64) DEFAULT NULL,

interface/web/login/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ function process_login_request(app $app, &$error, $conf, $module)
138138
} else {
139139

140140
//* Do 2FA authentication
141-
if($user['otp_enabled'] == 'y') {
141+
if($user['otp_type'] != 'none') {
142142

143143
//* Save session in pending state and destroy original session
144144
$_SESSION['s_pending'] = $_SESSION['s'];

0 commit comments

Comments
 (0)