[ Index ] |
PHP Cross Reference of Joomla 4.2.2 documentation |
[Summary view] [Print] [Text view]
1 -- 2 -- Create the new table for MFA 3 -- 4 CREATE TABLE IF NOT EXISTS "#__user_mfa" ( 5 "id" serial NOT NULL, 6 "user_id" bigint NOT NULL, 7 "title" varchar(255) DEFAULT '' NOT NULL, 8 "method" varchar(100) NOT NULL, 9 "default" smallint DEFAULT 0 NOT NULL, 10 "options" text NOT NULL, 11 "created_on" timestamp without time zone NOT NULL, 12 "last_used" timestamp without time zone, 13 PRIMARY KEY ("id") 14 ); 15 16 CREATE INDEX "#__user_mfa_idx_user_id" ON "#__user_mfa" ("user_id") /** CAN FAIL **/; 17 18 COMMENT ON TABLE "#__user_mfa" IS 'Multi-factor Authentication settings'; 19 20 -- 21 -- Remove obsolete postinstallation message 22 -- 23 DELETE FROM "#__postinstall_messages" WHERE "condition_file" = 'site://plugins/twofactorauth/totp/postinstall/actions.php'; 24 25 -- 26 -- Add new MFA plugins 27 -- 28 INSERT INTO "#__extensions" ("package_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "locked", "manifest_cache", "params", "custom_data", "ordering", "state") VALUES 29 (0, 'plg_multifactorauth_totp', 'plugin', 'totp', 'multifactorauth', 0, 0, 1, 0, 1, '', '', '', 1, 0), 30 (0, 'plg_multifactorauth_yubikey', 'plugin', 'yubikey', 'multifactorauth', 0, 0, 1, 0, 1, '', '', '', 2, 0), 31 (0, 'plg_multifactorauth_webauthn', 'plugin', 'webauthn', 'multifactorauth', 0, 0, 1, 0, 1, '', '', '', 3, 0), 32 (0, 'plg_multifactorauth_email', 'plugin', 'email', 'multifactorauth', 0, 0, 1, 0, 1, '', '', '', 4, 0), 33 (0, 'plg_multifactorauth_fixed', 'plugin', 'fixed', 'multifactorauth', 0, 0, 1, 0, 1, '', '', '', 5, 0); 34 35 -- 36 -- Update MFA plugins' publish status 37 -- 38 UPDATE "#__extensions" AS "a" 39 SET "enabled" = "b"."enabled" 40 FROM "#__extensions" AS "b" 41 WHERE "a"."element" = "b"."element" 42 AND "a"."folder" = 'multifactorauth' 43 AND "b"."folder" = 'twofactorauth'; 44 45 -- 46 -- Remove legacy TFA plugins 47 -- 48 DELETE FROM "#__extensions" 49 WHERE "type" = 'plugin' AND "folder" = 'twofactorauth' AND "element" IN ('totp', 'yubikey'); 50 51 -- 52 -- Add post-installation message 53 -- 54 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") 55 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' 56 ON CONFLICT DO NOTHING; 57 58 -- 59 -- Create a mail template for plg_multifactorauth_email 60 -- 61 INSERT INTO "#__mail_templates" ("template_id", "extension", "language", "subject", "body", "htmlbody", "attachments", "params") VALUES 62 ('plg_multifactorauth_email.mail', 'plg_multifactorauth_email', '', 'PLG_MULTIFACTORAUTH_EMAIL_EMAIL_SUBJECT', 'PLG_MULTIFACTORAUTH_EMAIL_EMAIL_BODY', '', '', '{"tags":["code","sitename","siteurl","username","email","fullname"]}') 63 ON CONFLICT DO NOTHING;
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Wed Sep 7 05:41:13 2022 | Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer |