Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
262 commits
Select commit Hold shift + click to select a range
f2fb3f3
Captive TFA
nikosdion May 14, 2022
61cfe95
Captive TFA
nikosdion May 14, 2022
9711fb6
Captive TFA
nikosdion May 14, 2022
58a54bc
Captive TFA
nikosdion May 14, 2022
4c13691
Captive TFA
nikosdion May 14, 2022
3f3775c
Captive TFA
nikosdion May 14, 2022
89a7bd0
Captive TFA
nikosdion May 14, 2022
13fe960
Captive TFA
nikosdion May 14, 2022
d3017a4
Captive TFA
nikosdion May 14, 2022
51e9dbf
Captive TFA
nikosdion May 14, 2022
0994769
Captive TFA
nikosdion May 14, 2022
8ad9907
Captive TFA
nikosdion May 14, 2022
bc234a1
Captive TFA
nikosdion May 14, 2022
1333e52
Merge branch '4.2-dev' into feature/tfa
nikosdion May 14, 2022
47588c1
Captive TFA
nikosdion May 14, 2022
ddfa506
Captive TFA
nikosdion May 15, 2022
9611c36
Captive TFA
nikosdion May 15, 2022
8e11155
Captive TFA
nikosdion May 15, 2022
ab2e747
Captive TFA
nikosdion May 15, 2022
80a35a3
Captive TFA
nikosdion May 15, 2022
865f621
Captive TFA
nikosdion May 15, 2022
1c1a167
Captive TFA
nikosdion May 15, 2022
6045ba4
Captive TFA
nikosdion May 15, 2022
5ba08ed
Captive TFA
nikosdion May 15, 2022
7aaa6d9
Captive TFA
nikosdion May 15, 2022
259b4ba
Captive TFA
nikosdion May 15, 2022
25855e6
Captive TFA
nikosdion May 15, 2022
93ce4b2
Captive TFA
nikosdion May 15, 2022
82ef6a1
Captive TFA
nikosdion May 16, 2022
b275436
Merge branch '4.2-dev' into feature/tfa
nikosdion May 16, 2022
d7f0395
Captive TFA
nikosdion May 16, 2022
eef166e
Captive TFA
nikosdion May 16, 2022
b27cb8f
Captive TFA
nikosdion May 16, 2022
47d570f
Captive TFA
nikosdion May 16, 2022
92fbbb3
Captive TFA
nikosdion May 16, 2022
bdf19c4
Captive TFA
nikosdion May 16, 2022
9da3498
Captive TFA
nikosdion May 16, 2022
d3b20a5
Captive TFA
nikosdion May 16, 2022
2923cc9
Captive TFA
nikosdion May 16, 2022
68c0a16
Captive TFA
nikosdion May 16, 2022
4256f11
Captive TFA
nikosdion May 16, 2022
e321be0
Captive TFA
nikosdion May 16, 2022
aa98942
Captive TFA
nikosdion May 16, 2022
c150aba
Captive TFA
nikosdion May 16, 2022
7c96b49
Captive TFA
nikosdion May 16, 2022
d8a7d28
Captive TFA
nikosdion May 16, 2022
845cb67
Captive TFA
nikosdion May 16, 2022
67bc308
Captive TFA
nikosdion May 16, 2022
bddb12d
Captive TFA
nikosdion May 16, 2022
9c5be51
Captive TFA
nikosdion May 16, 2022
8958daf
Captive TFA
nikosdion May 16, 2022
157a823
Captive TFA
nikosdion May 16, 2022
2e74336
Captive TFA
nikosdion May 16, 2022
db4e68f
Captive TFA
nikosdion May 17, 2022
9353c23
Captive TFA
nikosdion May 17, 2022
9a56655
Captive TFA
nikosdion May 17, 2022
e81551b
Captive TFA
nikosdion May 17, 2022
4ec9196
Captive TFA
nikosdion May 17, 2022
6327372
Captive TFA
nikosdion May 17, 2022
27e12ba
Captive TFA
nikosdion May 17, 2022
536c3b5
Captive TFA
nikosdion May 17, 2022
add3d21
Captive TFA
nikosdion May 17, 2022
ca1df67
Captive TFA
nikosdion May 17, 2022
3f4b0d0
SQL code style and consistency fixes
richard67 May 17, 2022
5f795c9
Add "CAN FAIL" installer hint
richard67 May 17, 2022
cbf3517
Change longtext to mediumtext
richard67 May 17, 2022
b79caec
Change longtext to mediumtext in update script
richard67 May 17, 2022
2a5ab39
No default value for method
richard67 May 17, 2022
af54b6a
Use real null values for last_used
richard67 May 17, 2022
1433833
Captive TFA
nikosdion May 17, 2022
4561bd3
Captive TFA
nikosdion May 17, 2022
fa2a278
Captive TFA
nikosdion May 17, 2022
55e62f6
Captive TFA
nikosdion May 17, 2022
dcc511b
Captive TFA
nikosdion May 17, 2022
bb1ab26
Captive TFA
nikosdion May 17, 2022
0f5b388
Captive TFA
nikosdion May 17, 2022
ec3b7ee
Captive TFA
nikosdion May 17, 2022
0e385b1
Captive TFA
nikosdion May 17, 2022
63544ba
Captive TFA
nikosdion May 17, 2022
63ea23d
Captive TFA
nikosdion May 17, 2022
ba786c6
Captive TFA
nikosdion May 17, 2022
9cd5ebc
Captive TFA
nikosdion May 17, 2022
a9c3881
Captive TFA
nikosdion May 17, 2022
c5852fe
Captive TFA
nikosdion May 17, 2022
ab4fcab
Captive TFA
nikosdion May 17, 2022
39a79a0
Captive TFA
nikosdion May 17, 2022
ef88682
Captive TFA
nikosdion May 17, 2022
0fb29d4
Captive TFA
nikosdion May 17, 2022
d9303d7
Captive TFA
nikosdion May 17, 2022
8f6b0b9
Captive TFA
nikosdion May 17, 2022
c91d859
Captive TFA
nikosdion May 17, 2022
f719269
codestyle changes
brianteeman May 17, 2022
f12fd90
Renamed SiteTemplateAware to SiteTemplateTrait
nikosdion May 17, 2022
3b9bd78
Remove more instances of "2SV"
nikosdion May 17, 2022
e30e9ef
s/Two Step Verification/Two Step Validation/
nikosdion May 17, 2022
cc028e9
Language style
nikosdion May 17, 2022
1917c0f
Remove unnecessary language string
nikosdion May 17, 2022
acdf9e2
Remove redundant paragraph tags from PLG_TWOFACTORAUTH_EMAIL_XML_DESC…
nikosdion May 17, 2022
8c0e97d
Remove redundant paragraph tags from PLG_TWOFACTORAUTH_EMAIL_XML_DESC…
nikosdion May 17, 2022
6f582f2
Merge pull request #5 from brianteeman/patch-6
nikosdion May 17, 2022
752ff54
Remove the info tooltip in the methods list
nikosdion May 17, 2022
fe9f082
Merge remote-tracking branch 'nikosdion/feature/tfa' into feature/tfa
nikosdion May 17, 2022
64de893
Simplify the TFA enabled / disabled message
nikosdion May 17, 2022
086d15f
Fix layout of backup codes in methods list
nikosdion May 17, 2022
01a29a3
Fix mail message
nikosdion May 17, 2022
34dee38
Confirm TFA method deletion
nikosdion May 17, 2022
f5c53ca
Merge branch '4.2-dev' into feature/tfa
nikosdion May 18, 2022
64c9570
Simplify code label in Email plugin
nikosdion May 18, 2022
94ce1ec
Remove more dead code referencing the legacy TFA
nikosdion May 18, 2022
b1d5f65
Use concrete events
nikosdion May 18, 2022
963584e
WebAuthn support for some Android devices and FIDO keys
nikosdion May 18, 2022
61b73d2
Rename Tfa to Mfa
nikosdion May 18, 2022
b492375
Move Joomla\CMS\Event\TwoFactor to Joomla\CMS\Event\MultiFactor
nikosdion May 18, 2022
b5250c9
Two Factor Authentication => Multi-factor Authentication
nikosdion May 18, 2022
97eddfd
`#__user_tfa` => `#__user_mfa`
nikosdion May 18, 2022
992b833
twofactorauth => multifactorauth
nikosdion May 18, 2022
538b7ec
Change the post-install message
nikosdion May 18, 2022
bf819dc
Remove references to “second factor”
nikosdion May 18, 2022
fe7cfc5
Remove the legacy TFA plugins
nikosdion May 18, 2022
b0fe4f0
I missed a few things
nikosdion May 18, 2022
159606e
I missed a few more things
nikosdion May 18, 2022
ca0a5bd
Wrong redirection from post-installation messages
nikosdion May 18, 2022
9234683
Fix NotifyActionLog expected event names
nikosdion May 18, 2022
d1e4b74
Improve display of Last Used date
nikosdion May 18, 2022
36a1829
MFA extension helper
brianteeman May 18, 2022
63ed002
Merge branch '4.2-dev' into feature/tfa
richard67 May 18, 2022
2adc051
Remove unused field
nikosdion May 19, 2022
78e5ad3
Remove no longer used language strings
nikosdion May 19, 2022
d5a7544
Merge remote-tracking branch 'nikosdion/feature/tfa' into feature/tfa
nikosdion May 19, 2022
355b950
Undo changes in old SQL scripts
nikosdion May 19, 2022
b27ef83
Merge pull request #6 from brianteeman/patch-7
nikosdion May 19, 2022
fc173fb
Merge remote-tracking branch 'nikosdion/feature/tfa' into feature/tfa
nikosdion May 19, 2022
f55acea
Improve layout and accessibility of the methods list page
nikosdion May 19, 2022
545efcf
Add missing options to plg_multifactorauth_email
nikosdion May 19, 2022
b2b6b6c
Sort lines alphabetically
nikosdion May 19, 2022
da2112f
Add label to the One Time Emergency Password input
nikosdion May 19, 2022
ceaa4a3
Sort lines
nikosdion May 19, 2022
d79f355
Fix PHPCS complaint
nikosdion May 19, 2022
e02371f
Formatting of XML files
nikosdion May 19, 2022
5e9aa8f
Forgot to remove extra CSS class
nikosdion May 19, 2022
4e1e25c
Apply suggestions from code review
nikosdion May 20, 2022
ac4d88f
Commit suggestions from code review
nikosdion May 20, 2022
3302ba4
Commit formatting suggestions from code review
nikosdion May 20, 2022
1b1f5e3
Commit formatting suggestions from code review
nikosdion May 20, 2022
a8637b7
Commit formatting suggestions from code review
nikosdion May 20, 2022
f856f86
Commit formatting suggestions from code review
nikosdion May 20, 2022
4b9209f
Commit formatting suggestions from code review
nikosdion May 20, 2022
2536919
Commit formatting suggestions from code review
nikosdion May 20, 2022
c8f71d6
Commit formatting suggestions from code review
nikosdion May 20, 2022
dfe386b
Commit formatting suggestions from code review
nikosdion May 20, 2022
40c45e5
Commit formatting suggestions from code review
nikosdion May 20, 2022
c5d8886
Merge branch '4.2-dev' into feature/tfa
nikosdion May 20, 2022
6bc34f8
Update build/media_source/plg_multifactorauth_webauthn/js/webauthn.es…
nikosdion May 20, 2022
def44de
Fix update SQL
nikosdion May 21, 2022
bbc4b34
Merge remote-tracking branch 'nikosdion/feature/tfa' into feature/tfa
nikosdion May 21, 2022
287b475
Onboarding would result in a PHP exception
nikosdion May 21, 2022
36ccc78
Make MFA plugins' publish state consistent between MySQL and PostgreSQL
nikosdion May 21, 2022
296757d
Update administrator/components/com_users/src/Controller/MethodsContr…
nikosdion May 21, 2022
8ab585b
Update administrator/components/com_admin/sql/updates/mysql/4.2.0-202…
nikosdion May 21, 2022
a489763
Update administrator/components/com_admin/sql/updates/postgresql/4.2.…
nikosdion May 21, 2022
8a306d4
Update administrator/components/com_admin/sql/updates/mysql/4.2.0-202…
nikosdion May 21, 2022
81c1e47
Update administrator/components/com_admin/sql/updates/postgresql/4.2.…
nikosdion May 21, 2022
162d04e
Merge branch '4.2-dev' into feature/tfa
nikosdion May 23, 2022
6ba1f9c
Update administrator/components/com_admin/sql/updates/postgresql/4.2.…
nikosdion May 23, 2022
fa07f71
Restore obsolete language strings
nikosdion May 23, 2022
3b020af
Re-add the obsolete plugins' language files
nikosdion May 23, 2022
086d76d
Merge remote-tracking branch 'nikosdion/feature/tfa' into feature/tfa
nikosdion May 23, 2022
6daa821
Remove no longer used twofactor field
nikosdion May 23, 2022
1e32f83
Rename CSS class to com-users-profile__multifactor
nikosdion May 23, 2022
f5b6869
Merge branch '4.2-dev' into feature/tfa
nikosdion May 23, 2022
f848778
Update administrator/language/en-GB/plg_multifactorauth_email.sys.ini
nikosdion May 24, 2022
bef3889
Update administrator/language/en-GB/plg_multifactorauth_email.ini
nikosdion May 24, 2022
7f51791
Update administrator/language/en-GB/plg_multifactorauth_email.ini
nikosdion May 24, 2022
c9fd07c
Update administrator/language/en-GB/com_users.ini
nikosdion May 24, 2022
a0ec263
Update administrator/language/en-GB/com_users.ini
nikosdion May 24, 2022
8ae8d9a
Update administrator/language/en-GB/com_users.ini
nikosdion May 24, 2022
d4417bd
Update administrator/language/en-GB/com_users.ini
nikosdion May 24, 2022
b85b84b
Update administrator/language/en-GB/com_users.ini
nikosdion May 24, 2022
d4295f9
Accessibility improvement
nikosdion May 24, 2022
f7cfb98
Improve language
nikosdion May 24, 2022
7227c6c
Change the heading level
nikosdion May 24, 2022
e9c0c7c
Fix case of extension registry file
nikosdion May 24, 2022
c49f008
Remove accidental double space after echo
nikosdion May 24, 2022
db6dbd7
Remove BS3 leftovers
nikosdion May 24, 2022
7044c3b
Remove BS3 leftovers
nikosdion May 24, 2022
d605bbc
Remove BS3 leftovers
nikosdion May 24, 2022
7e187e8
Update administrator/components/com_users/tmpl/methods/list.php
nikosdion May 25, 2022
185c6e6
Update components/com_users/tmpl/methods/list.php
nikosdion May 25, 2022
9109666
Merge branch '4.2-dev' into feature/tfa
nikosdion May 27, 2022
d014ffb
PHP warnings when there are no MFA plugins enabled
nikosdion May 27, 2022
f9c780a
MFA onboarding was shown with no MFA plugins enabled
nikosdion May 27, 2022
123e925
Backup codes alert is narrower than page on super-wide screens
nikosdion May 27, 2022
f3eb6d6
Backup codes alert heading font size fix in backend
nikosdion May 27, 2022
9327d1f
Revert wording for JENFORCE_2FA_REDIRECT_MESSAGE
nikosdion May 27, 2022
d75a0f4
Backend users without `core.manage` on com_users were blocked
nikosdion May 27, 2022
650b4aa
Onboarding in backend shouldn't have a Back button
nikosdion May 27, 2022
8431ca0
Improve layout of method add/edit page
nikosdion May 27, 2022
7e350ec
Remove unnecessary H5 tag from TOTP setup table
nikosdion May 27, 2022
e4adef5
Kill that bloody Back button with fire
nikosdion May 27, 2022
3c56f73
MFA WebAuthn: use Joomla.Text instead of Joomla.JText
nikosdion May 28, 2022
f464df2
MFA WebAuthn: show meaningful error on HTTP
nikosdion May 28, 2022
af1ce98
MFA Email: more sensible email body
nikosdion May 28, 2022
32d38d2
MFA WebAuthn: must be able to edit the title
nikosdion May 28, 2022
d66bc0b
MFA add/edit: remove placeholders, replace with help text
nikosdion May 28, 2022
c141c0f
Heading levels
nikosdion May 28, 2022
9c3a0ce
Editing a user would show the wrong interface
nikosdion May 28, 2022
cdd1300
Refactor security checks
nikosdion May 28, 2022
9c3864b
Add missing Group By to the SQL query
nikosdion May 28, 2022
40c7617
Show MFA enabled when a legacy method is enabled
nikosdion May 28, 2022
f557f9c
Users: filter by MFA status
nikosdion May 28, 2022
ffddca9
Language clarification
nikosdion May 28, 2022
381c4d6
Move the frontend onboarding page header to the top
nikosdion May 28, 2022
801f6ce
User Options language clarification
nikosdion May 28, 2022
0bec814
PostgreSQL installation SQL wasn't updated
nikosdion May 28, 2022
fe536a2
Adding periods to the end of lines of error messages you will never, …
nikosdion May 28, 2022
b29a6b8
Remove a tab
nikosdion May 28, 2022
5f95438
Remove another tab from a comment
nikosdion May 28, 2022
84d9cf5
Typo removing junk
nikosdion May 28, 2022
ed90fa9
Remove useless imports
nikosdion May 28, 2022
4b82c3a
Busywork
nikosdion May 28, 2022
dd9d83f
Typo in the INI file
nikosdion May 29, 2022
03385ab
Align comment
nikosdion May 29, 2022
47e853b
Remove redundant SQL for PostgreSQL
nikosdion May 29, 2022
bedc2dd
Typo in labels' `for` attribute
nikosdion May 29, 2022
b42d313
Move backup codes to the top of the page
nikosdion May 29, 2022
9e77f0b
Mandatory and forbidden MFA was not taken into account
nikosdion May 29, 2022
bcd044e
Show information when MFA is mandatory
nikosdion May 29, 2022
3a9687e
Make the buttons smaller
nikosdion May 29, 2022
1f6f281
The secondary button looks horrid in the frontend
nikosdion May 29, 2022
ffc43c0
Redirect users to login page in the frontend
nikosdion May 29, 2022
cb64651
MFA Email: fallback to standard mailer when the mail template isn't i…
nikosdion May 29, 2022
c589be1
Delete backup codes when the last MFA method is deleted
nikosdion May 29, 2022
f693b3d
Use text inputs for TOTP
nikosdion May 30, 2022
1928296
Fix the buttons for WebAuthn
nikosdion May 30, 2022
dfb66ff
Clarify language strings
nikosdion May 30, 2022
340c8eb
Use toolbar buttons in the backend
nikosdion May 30, 2022
2ecf329
Change the icon classes
nikosdion May 30, 2022
6cb63e8
Forgot to copy over the changes to the frontend
nikosdion May 31, 2022
02c568e
Regression: configure existing authenticators
nikosdion May 31, 2022
c708639
Backup codes should never become the default method automatically
nikosdion May 31, 2022
bbfe0e1
Merge branch '4.2-dev' into feature/tfa
nikosdion May 31, 2022
4d7a0c0
Improve methods list layout
nikosdion May 31, 2022
21f877c
Use toolbar buttons in backend pages
nikosdion May 31, 2022
bbb5260
Fix return URLs for backend MFA edit pages
nikosdion May 31, 2022
b797fcc
Edit / Delete buttons mention the auth method name in the respective …
nikosdion May 31, 2022
f72a182
RTL aware back buttons
nikosdion May 31, 2022
ed01861
Merge branch '4.2-dev' into feature/tfa
nikosdion Jun 3, 2022
083f308
Consistent use of the term Fixed Code
nikosdion Jun 3, 2022
ea72db0
Fix typo
nikosdion Jun 3, 2022
d86a9bf
Merge branch '4.2-dev' into feature/tfa
roland-d Jun 4, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions administrator/components/com_admin/script.php
Original file line number Diff line number Diff line change
Expand Up @@ -7809,6 +7809,8 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false)
'/libraries/vendor/maximebf/debugbar/build',
// From 4.1 to 4.2.0
'/libraries/vendor/nyholm/psr7/doc',
'/plugins/twofactorauth/totp',
'/plugins/twofactorauth/yubikey',
);

$status['files_checked'] = $files;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
--
-- Create the new table for MFA
--
CREATE TABLE IF NOT EXISTS `#__user_mfa` (
`id` int NOT NULL AUTO_INCREMENT,
`user_id` int unsigned NOT NULL,
`title` varchar(255) NOT NULL DEFAULT '',
`method` varchar(100) NOT NULL,
`default` tinyint NOT NULL DEFAULT 0,
`options` mediumtext NOT NULL,
`created_on` datetime NOT NULL,
`last_used` datetime,
PRIMARY KEY (`id`),
KEY `idx_user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci COMMENT='Multi-factor Authentication settings';

--
-- Remove obsolete postinstallation message
--
DELETE FROM `#__postinstall_messages` WHERE `condition_file` = 'site://plugins/twofactorauth/totp/postinstall/actions.php';

--
-- Add new MFA plugins
--
INSERT INTO `#__extensions` (`package_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `locked`, `manifest_cache`, `params`, `custom_data`, `ordering`, `state`) VALUES
(0, 'plg_multifactorauth_totp', 'plugin', 'totp', 'multifactorauth', 0, 0, 1, 0, 1, '', '', '', 1, 0),
(0, 'plg_multifactorauth_yubikey', 'plugin', 'yubikey', 'multifactorauth', 0, 0, 1, 0, 1, '', '', '', 2, 0),
(0, 'plg_multifactorauth_webauthn', 'plugin', 'webauthn', 'multifactorauth', 0, 0, 1, 0, 1, '', '', '', 3, 0),
(0, 'plg_multifactorauth_email', 'plugin', 'email', 'multifactorauth', 0, 0, 1, 0, 1, '', '', '', 4, 0),
(0, 'plg_multifactorauth_fixed', 'plugin', 'fixed', 'multifactorauth', 0, 0, 1, 0, 1, '', '', '', 5, 0);

--
-- Update MFA plugins' publish status
--
UPDATE `#__extensions` AS `a`
INNER JOIN `#__extensions` AS `b` on `a`.`element` = `b`.`element`
SET `a`.enabled = `b`.enabled
WHERE `a`.folder = 'multifactorauth'
AND `b`.folder = 'twofactorauth';

--
-- Remove legacy TFA plugins
--
DELETE FROM `#__extensions`
WHERE `type` = 'plugin' AND `folder` = 'twofactorauth' AND `element` IN ('totp', 'yubikey');

--
-- Add post-installation message
--
INSERT IGNORE INTO `#__postinstall_messages` (`extension_id`, `title_key`, `description_key`, `action_key`, `language_extension`, `language_client_id`, `type`, `action_file`, `action`, `condition_file`, `condition_method`, `version_introduced`, `enabled`)
SELECT `extension_id`, 'COM_USERS_POSTINSTALL_MULTIFACTORAUTH_TITLE', 'COM_USERS_POSTINSTALL_MULTIFACTORAUTH_BODY', 'COM_USERS_POSTINSTALL_MULTIFACTORAUTH_ACTION', 'com_users', 1, 'action', 'admin://components/com_users/postinstall/multifactorauth.php', 'com_users_postinstall_mfa_action', 'admin://components/com_users/postinstall/multifactorauth.php', 'com_users_postinstall_mfa_condition', '4.2.0', 1 FROM `#__extensions` WHERE `name` = 'files_joomla';

--
-- Create a mail template for plg_multifactorauth_email
--
INSERT IGNORE INTO `#__mail_templates` (`template_id`, `extension`, `language`, `subject`, `body`, `htmlbody`, `attachments`, `params`) VALUES
('plg_multifactorauth_email.mail', 'plg_multifactorauth_email', '', 'PLG_MULTIFACTORAUTH_EMAIL_EMAIL_SUBJECT', 'PLG_MULTIFACTORAUTH_EMAIL_EMAIL_BODY', '', '', '{"tags":["code","sitename","siteurl","username","email","fullname"]}');
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
--
-- Create the new table for MFA
--
CREATE TABLE IF NOT EXISTS "#__user_mfa" (
"id" serial NOT NULL,
"user_id" bigint NOT NULL,
"title" varchar(255) DEFAULT '' NOT NULL,
"method" varchar(100) NOT NULL,
"default" smallint DEFAULT 0 NOT NULL,
"options" text NOT NULL,
"created_on" timestamp without time zone NOT NULL,
"last_used" timestamp without time zone,
PRIMARY KEY ("id")
);

CREATE INDEX "#__user_mfa_idx_user_id" ON "#__user_mfa" ("user_id") /** CAN FAIL **/;

COMMENT ON TABLE "#__user_mfa" IS 'Multi-factor Authentication settings';

--
-- Remove obsolete postinstallation message
--
DELETE FROM "#__postinstall_messages" WHERE "condition_file" = 'site://plugins/twofactorauth/totp/postinstall/actions.php';

--
-- Add new MFA plugins
--
INSERT INTO "#__extensions" ("package_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "locked", "manifest_cache", "params", "custom_data", "ordering", "state") VALUES
(0, 'plg_multifactorauth_totp', 'plugin', 'totp', 'multifactorauth', 0, 0, 1, 0, 1, '', '', '', 1, 0),
(0, 'plg_multifactorauth_yubikey', 'plugin', 'yubikey', 'multifactorauth', 0, 0, 1, 0, 1, '', '', '', 2, 0),
(0, 'plg_multifactorauth_webauthn', 'plugin', 'webauthn', 'multifactorauth', 0, 0, 1, 0, 1, '', '', '', 3, 0),
(0, 'plg_multifactorauth_email', 'plugin', 'email', 'multifactorauth', 0, 0, 1, 0, 1, '', '', '', 4, 0),
(0, 'plg_multifactorauth_fixed', 'plugin', 'fixed', 'multifactorauth', 0, 0, 1, 0, 1, '', '', '', 5, 0);

--
-- Update MFA plugins' publish status
--
UPDATE "#__extensions" AS "a"
SET "enabled" = "b"."enabled"
FROM "#__extensions" AS "b"
WHERE "a"."element" = "b"."element"
AND "a"."folder" = 'multifactorauth'
AND "b"."folder" = 'twofactorauth';

--
-- Remove legacy TFA plugins
--
DELETE FROM "#__extensions"
WHERE "type" = 'plugin' AND "folder" = 'twofactorauth' AND "element" IN ('totp', 'yubikey');

--
-- Add post-installation message
--
INSERT INTO "#__postinstall_messages" ("extension_id", "title_key", "description_key", "action_key", "language_extension", "language_client_id", "type", "action_file", "action", "condition_file", "condition_method", "version_introduced", "enabled")
SELECT "extension_id", 'COM_USERS_POSTINSTALL_MULTIFACTORAUTH_TITLE', 'COM_USERS_POSTINSTALL_MULTIFACTORAUTH_BODY', 'COM_USERS_POSTINSTALL_MULTIFACTORAUTH_ACTION', 'com_users', 1, 'action', 'admin://components/com_users/postinstall/multifactorauth.php', 'com_users_postinstall_mfa_action', 'admin://components/com_users/postinstall/multifactorauth.php', 'com_users_postinstall_mfa_condition', '4.2.0', 1 FROM "#__extensions" WHERE "name" = 'files_joomla'
ON CONFLICT DO NOTHING;

--
-- Create a mail template for plg_multifactorauth_email
--
INSERT INTO "#__mail_templates" ("template_id", "extension", "language", "subject", "body", "htmlbody", "attachments", "params") VALUES
('plg_multifactorauth_email.mail', 'plg_multifactorauth_email', '', 'PLG_MULTIFACTORAUTH_EMAIL_EMAIL_SUBJECT', 'PLG_MULTIFACTORAUTH_EMAIL_EMAIL_BODY', '', '', '{"tags":["code","sitename","siteurl","username","email","fullname"]}')
ON CONFLICT DO NOTHING;
Original file line number Diff line number Diff line change
Expand Up @@ -1484,7 +1484,7 @@ public function getNonCoreExtensions()
*
* @since 3.10.0
*/
public function getNonCorePlugins($folderFilter = ['system','user','authentication','actionlog','twofactorauth'])
public function getNonCorePlugins($folderFilter = ['system','user','authentication','actionlog','multifactorauth'])
{
$db = $this->getDbo();
$query = $db->getQuery(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
$wa = $this->document->getWebAssetManager();
$wa->useScript('keepalive');

$twofactormethods = AuthenticationHelper::getTwoFactorMethods();

?>

<div class="alert warning">
Expand Down Expand Up @@ -63,21 +61,6 @@
</div>
</div>
</div>
<?php if (count($twofactormethods) > 1) : ?>
<div class="control-group">
<div class="controls">
<div class="input-group">
<input name="secretkey" autocomplete="one-time-code" id="mod-login-secretkey" type="text" class="form-control" placeholder="<?php echo Text::_('JGLOBAL_SECRETKEY'); ?>" size="15">
<span class="input-group-text" title="<?php echo Text::_('JGLOBAL_SECRETKEY_HELP'); ?>">
<span class="icon-star" aria-hidden="true"></span>
<label for="mod-login-secretkey" class="visually-hidden">
<?php echo Text::_('JGLOBAL_SECRETKEY'); ?>
</label>
</span>
</div>
</div>
</div>
<?php endif; ?>
<div class="control-group">
<div class="controls">
<div class="btn-group">
Expand Down
17 changes: 0 additions & 17 deletions administrator/components/com_joomlaupdate/tmpl/upload/captive.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;

$twofactormethods = AuthenticationHelper::getTwoFactorMethods();

/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->useScript('core')
Expand Down Expand Up @@ -67,21 +65,6 @@
</div>
</div>
</div>
<?php if (count($twofactormethods) > 1) : ?>
<div class="control-group">
<div class="controls">
<div class="input-group">
<input name="secretkey" autocomplete="one-time-code" id="mod-login-secretkey" type="text" class="form-control" placeholder="<?php echo Text::_('JGLOBAL_SECRETKEY'); ?>" size="15">
<span class="input-group-text" title="<?php echo Text::_('JGLOBAL_SECRETKEY_HELP'); ?>">
<span class="icon-star" aria-hidden="true"></span>
<label for="mod-login-secretkey" class="visually-hidden">
<?php echo Text::_('JGLOBAL_SECRETKEY'); ?>
</label>
</span>
</div>
</div>
</div>
<?php endif; ?>
<div class="control-group">
<div class="controls">
<a class="btn btn-danger" href="index.php?option=com_joomlaupdate">
Expand Down
147 changes: 120 additions & 27 deletions administrator/components/com_users/config.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<config>
<help key="Users:_Options"/>
<inlinehelp button="show"/>
<fieldset
name="user_options"
label="COM_USERS_CONFIG_USER_OPTIONS" >
Expand Down Expand Up @@ -109,33 +110,6 @@
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>

<field
name="enforce_2fa_options"
type="list"
label="COM_USERS_CONFIG_FIELD_ENFORCE_2FA_FIELD_LABEL"
description="COM_USERS_CONFIG_FIELD_ENFORCE_2FA_FIELD_DESC"
default="0"
filter="integer"
validate="options"
>
<option value="0">JNO</option>
<option value="1">COM_USERS_CONFIG_FIELD_ENFORCE_2FA_FIELD_SITE</option>
<option value="2">COM_USERS_CONFIG_FIELD_ENFORCE_2FA_FIELD_ADMIN</option>
<option value="3">COM_USERS_CONFIG_FIELD_ENFORCE_2FA_FIELD_BOTH</option>
</field>

<field
name="enforce_2fa_usergroups"
type="usergrouplist"
label="COM_USERS_CONFIG_FIELD_ENFORCE_2FA_GROUPS_LABEL"
layout="joomla.form.field.list-fancy-select"
multiple="true"
filter="int_array"
size="10"
showon="enforce_2fa_options!:0"
/>

</fieldset>

<fieldset
Expand Down Expand Up @@ -238,6 +212,125 @@
/>
</fieldset>

<fieldset
name="multifactorauth"
label="COM_USERS_CONFIG_MULTIFACTORAUTH_SETTINGS_LABEL"
description="COM_USERS_CONFIG_MULTIFACTORAUTH_SETTINGS_DESC"
addfieldprefix="Joomla\Component\Users\Administrator\Field"
>
<field
name="allowed_positions_frontend"
type="modulesposition"
label="COM_USERS_CONFIG_ALLOWED_POSITIONS_FRONTEND_LABEL"
description="COM_USERS_CONFIG_ALLOWED_POSITIONS_FRONTEND_DESC"
default=""
layout="joomla.form.field.list-fancy-select"
client="site"
multiple="1"
/>

<field
name="frontend_show_title"
type="radio"
label="COM_USERS_CONFIG_FRONTEND_SHOW_TITLE_LABEL"
description="COM_USERS_CONFIG_FRONTEND_SHOW_TITLE_DESC"
layout="joomla.form.field.radio.switcher"
default="1"
>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>

<field
name="allowed_positions_backend"
type="modulesposition"
label="COM_USERS_CONFIG_ALLOWED_POSITIONS_BACKEND_LABEL"
description="COM_USERS_CONFIG_ALLOWED_POSITIONS_BACKEND_DESC"
default=""
layout="joomla.form.field.list-fancy-select"
client="administrator"
multiple="1"
/>

<field
name="neverMFAUserGroups"
type="UserGroupList"
label="COM_USERS_CONFIG_NEVERMFAUSERGROUPS_LABEL"
description="COM_USERS_CONFIG_NEVERMFAUSERGROUPS_DESC"
layout="joomla.form.field.list-fancy-select"
checksuperusergroup="1"
default=""
multiple="1"
>
<option value="0">COM_USERS_CONFIG_LBL_NOGROUP</option>
</field>

<field
name="forceMFAUserGroups"
type="UserGroupList"
label="COM_USERS_CONFIG_FORCEMFAUSERGROUPS_LABEL"
description="COM_USERS_CONFIG_FORCEMFAUSERGROUPS_DESC"
layout="joomla.form.field.list-fancy-select"
checksuperusergroup="1"
default=""
multiple="1"
>
<option value="0">COM_USERS_CONFIG_LBL_NOGROUP</option>
</field>

<field
name="captive_template"
type="templatestyle"
label="COM_USERS_CONFIG_FRONTEND_CAPTIVE_TEMPLATE_LABEL"
description="COM_USERS_CONFIG_FRONTEND_CAPTIVE_TEMPLATE_DESC"
client="site"
>
<option value="">JOPTION_USE_DEFAULT</option>
</field>

<field
name="mfaonsilent"
type="radio"
label="COM_USERS_CONFIG_MFAONSILENT_LABEL"
description="COM_USERS_CONFIG_MFAONSILENT_DESC"
layout="joomla.form.field.radio.switcher"
default="0"
>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>

<field
name="silentresponses"
type="text"
label="COM_USERS_CONFIG_SILENTRESPONSES_LABEL"
description="COM_USERS_CONFIG_SILENTRESPONSES_DESC"
default="cookie, passwordless"
showon="mfaonsilent:0"
/>

<field
name="mfaredirectonlogin"
type="radio"
label="COM_USERS_CONFIG_REDIRECTONLOGIN_LABEL"
description="COM_USERS_CONFIG_REDIRECTONLOGIN_DESC"
layout="joomla.form.field.radio.switcher"
default="0"
>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>

<field
name="mfaredirecturl"
type="text"
label="COM_USERS_CONFIG_REDIRECTURL_LABEL"
description="COM_USERS_CONFIG_REDIRECTURL_DESC"
default=""
showon="redirectonlogin:1"
/>
</fieldset>

<fieldset
name="user_notes_history"
label="COM_USERS_CONFIG_FIELD_NOTES_HISTORY" >
Expand Down
10 changes: 10 additions & 0 deletions administrator/components/com_users/forms/filter_users.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@
>
<option value="">COM_USERS_FILTER_STATE</option>
</field>
<field
name="mfa"
type="list"
label="COM_USERS_HEADING_MFA"
onchange="this.form.submit();"
>
<option value="">COM_USERS_FILTER_MFA</option>
<option value="1">JENABLED</option>
<option value="0">JDISABLED</option>
</field>
<field
name="active"
type="useractive"
Expand Down
1 change: 0 additions & 1 deletion administrator/components/com_users/forms/user.xml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@

</fieldset>
<field name="groups" type="hidden" />
<field name="twofactor" type="hidden" />

<fields name="params">

Expand Down
Loading