[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/administrator/components/com_admin/sql/updates/mysql/ -> 4.2.0-2022-05-15.sql (source)

   1  --
   2  -- Create the new table for MFA
   3  --
   4  CREATE TABLE IF NOT EXISTS `#__user_mfa` (
   5    `id` int NOT NULL AUTO_INCREMENT,
   6    `user_id` int unsigned NOT NULL,
   7    `title` varchar(255) NOT NULL DEFAULT '',
   8    `method` varchar(100) NOT NULL,
   9    `default` tinyint NOT NULL DEFAULT 0,
  10    `options` mediumtext NOT NULL,
  11    `created_on` datetime NOT NULL,
  12    `last_used` datetime,
  13    PRIMARY KEY (`id`),
  14    KEY `idx_user_id` (`user_id`)
  15  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci COMMENT='Multi-factor Authentication settings';
  16  
  17  --
  18  -- Remove obsolete postinstallation message
  19  --
  20  DELETE FROM `#__postinstall_messages` WHERE `condition_file` = 'site://plugins/twofactorauth/totp/postinstall/actions.php';
  21  
  22  --
  23  -- Add new MFA plugins
  24  --
  25  INSERT INTO `#__extensions` (`package_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `locked`, `manifest_cache`, `params`, `custom_data`, `ordering`, `state`) VALUES
  26  (0, 'plg_multifactorauth_totp', 'plugin', 'totp', 'multifactorauth', 0, 0, 1, 0, 1, '', '', '', 1, 0),
  27  (0, 'plg_multifactorauth_yubikey', 'plugin', 'yubikey', 'multifactorauth', 0, 0, 1, 0, 1, '', '', '', 2, 0),
  28  (0, 'plg_multifactorauth_webauthn', 'plugin', 'webauthn', 'multifactorauth', 0, 0, 1, 0, 1, '', '', '', 3, 0),
  29  (0, 'plg_multifactorauth_email', 'plugin', 'email', 'multifactorauth', 0, 0, 1, 0, 1, '', '', '', 4, 0),
  30  (0, 'plg_multifactorauth_fixed', 'plugin', 'fixed', 'multifactorauth', 0, 0, 1, 0, 1, '', '', '', 5, 0);
  31  
  32  --
  33  -- Update MFA plugins' publish status
  34  --
  35  UPDATE `#__extensions` AS `a`
  36      INNER JOIN `#__extensions` AS `b` on `a`.`element` = `b`.`element`
  37  SET `a`.enabled = `b`.enabled
  38  WHERE `a`.folder = 'multifactorauth'
  39      AND `b`.folder = 'twofactorauth';
  40  
  41  --
  42  -- Remove legacy TFA plugins
  43  --
  44  DELETE FROM `#__extensions`
  45  WHERE `type` = 'plugin' AND `folder` = 'twofactorauth' AND `element` IN ('totp', 'yubikey');
  46  
  47  --
  48  -- Add post-installation message
  49  --
  50  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`)
  51  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';
  52  
  53  --
  54  -- Create a mail template for plg_multifactorauth_email
  55  --
  56  INSERT IGNORE INTO `#__mail_templates` (`template_id`, `extension`, `language`, `subject`, `body`, `htmlbody`, `attachments`, `params`) VALUES
  57  ('plg_multifactorauth_email.mail', 'plg_multifactorauth_email', '', 'PLG_MULTIFACTORAUTH_EMAIL_EMAIL_SUBJECT', 'PLG_MULTIFACTORAUTH_EMAIL_EMAIL_BODY', '', '', '{"tags":["code","sitename","siteurl","username","email","fullname"]}');


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer