From 7afd911130507f08d148939943611d06315357d0 Mon Sep 17 00:00:00 2001 From: Brian Teeman Date: Mon, 12 Feb 2018 11:37:12 +0000 Subject: [PATCH 1/6] reCAPTCHA V1 stops on March 31 Google have emailed directly anyone using v1 reCAPTCHA keys but users don't read their email. This PR adds a post-installation message IF they have the reCAPTCHA plugin enabled AND they are using v1 keys. This PR also updates the messages in the plugin informing them that V1 will not work after march 31 @mbabker already completely refactored the plugin for J4 to remove V1 etc this PR is ust for the messages --- .../sql/updates/mysql/3.9.0-2018-02-12.sql | 3 ++ .../updates/postgresql/3.9.0-2018-02-12.sql | 3 ++ .../sql/updates/sqlazure/3.9.0-2018-02-12.sql | 3 ++ .../en-GB/en-GB.plg_captcha_recaptcha.ini | 8 ++-- installation/sql/mysql/joomla.sql | 3 +- installation/sql/postgresql/joomla.sql | 3 +- installation/sql/sqlazure/joomla.sql | 3 +- .../captcha/recaptcha/postinstall/actions.php | 48 +++++++++++++++++++ 8 files changed, 68 insertions(+), 6 deletions(-) create mode 100644 administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-02-12.sql create mode 100644 administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-02-12.sql create mode 100644 administrator/components/com_admin/sql/updates/sqlazure/3.9.0-2018-02-12.sql create mode 100644 plugins/captcha/recaptcha/postinstall/actions.php diff --git a/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-02-12.sql b/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-02-12.sql new file mode 100644 index 0000000000000..a693f7635aaec --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-02-12.sql @@ -0,0 +1,3 @@ +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`) +VALUES +(700, 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_TITLE', 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_BODY', 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_ACTION', 'plg_captcha_recaptcha', 1, 'action', 'site://plugins/captcha/recaptcha/postinstall/actions.php', 'recaptcha_postinstall_action', 'site://plugins/captcha/recaptcha/postinstall/actions.php', 'recaptcha_postinstall_condition', '3.9.0', 1); diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-02-12.sql b/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-02-12.sql new file mode 100644 index 0000000000000..168b254cb2968 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-02-12.sql @@ -0,0 +1,3 @@ +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") +VALUES +(700, 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_TITLE', 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_BODY', 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_ACTION', 'plg_captcha_recaptcha', 1, 'action', 'site://plugins/captcha/recaptcha/postinstall/actions.php', 'recaptcha_postinstall_action', 'site://plugins/captcha/recaptcha/postinstall/actions.php', 'recaptcha_postinstall_condition', '3.9.0', 1); \ No newline at end of file diff --git a/administrator/components/com_admin/sql/updates/sqlazure/3.9.0-2018-02-12.sql b/administrator/components/com_admin/sql/updates/sqlazure/3.9.0-2018-02-12.sql new file mode 100644 index 0000000000000..168b254cb2968 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/sqlazure/3.9.0-2018-02-12.sql @@ -0,0 +1,3 @@ +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") +VALUES +(700, 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_TITLE', 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_BODY', 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_ACTION', 'plg_captcha_recaptcha', 1, 'action', 'site://plugins/captcha/recaptcha/postinstall/actions.php', 'recaptcha_postinstall_action', 'site://plugins/captcha/recaptcha/postinstall/actions.php', 'recaptcha_postinstall_condition', '3.9.0', 1); \ No newline at end of file diff --git a/administrator/language/en-GB/en-GB.plg_captcha_recaptcha.ini b/administrator/language/en-GB/en-GB.plg_captcha_recaptcha.ini index 7e5db19504751..29821c12ebe7c 100644 --- a/administrator/language/en-GB/en-GB.plg_captcha_recaptcha.ini +++ b/administrator/language/en-GB/en-GB.plg_captcha_recaptcha.ini @@ -5,11 +5,13 @@ PLG_CAPTCHA_RECAPTCHA_XML_DESCRIPTION="This CAPTCHA plugin uses the reCAPTCHA service to prevent spammers while it helps to digitize books, newspapers and old radio shows. To get a site and secret key for your domain, go to https://www.google.com/recaptcha. To use this for new account registration, go to Options in the User Manager and select CAPTCHA - reCAPTCHA as the CAPTCHA." PLG_CAPTCHA_RECAPTCHA="CAPTCHA - reCAPTCHA" - +PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_ACTION="Update reCAPTCHA settings" +PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_TITLE="reCAPTCHA v1 - discontinued" +PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_BODY="Support for reCAPTCHA v1 will be turned off by Google on March 31, 2018. Please update the settings in the reCAPTCHA plugin to use Version 2.0." ; Params -PLG_RECAPTCHA_VERSION_1_WARNING_LABEL="You have selected Version 1.0. All new sites should be using Version 2.0. Since May 2016 version 1.0 has been deprecated and is only maintained to provide support for Global Site keys which are no longer available from Google. Version 1.0 will not work for new sites and continued functionality can not be guaranteed." +PLG_RECAPTCHA_VERSION_1_WARNING_LABEL="You have selected Version 1.0. As of March 31, 2018 this will no longer work and you should use Version 2.0." PLG_RECAPTCHA_VERSION_LABEL="Version" -PLG_RECAPTCHA_VERSION_DESC="Version 2.0 is the recommended version. Version 1.0 is required if using deprecated Global reCAPTCHA keys. It is no longer supported and will not work for new sites." +PLG_RECAPTCHA_VERSION_DESC="Version 2.0 is the recommended version." ; The following two strings are deprecated and will be removed with 4.0. They generate wrong plural detection in Crowdin. PLG_RECAPTCHA_VERSION_1="1.0" PLG_RECAPTCHA_VERSION_2="2.0" diff --git a/installation/sql/mysql/joomla.sql b/installation/sql/mysql/joomla.sql index 32d131a542bf0..3205e710a613e 100644 --- a/installation/sql/mysql/joomla.sql +++ b/installation/sql/mysql/joomla.sql @@ -1642,7 +1642,8 @@ INSERT INTO `#__postinstall_messages` (`extension_id`, `title_key`, `description (700, 'COM_CPANEL_MSG_STATS_COLLECTION_TITLE', 'COM_CPANEL_MSG_STATS_COLLECTION_BODY', '', 'com_cpanel', 1, 'message', '', '', 'admin://components/com_admin/postinstall/statscollection.php', 'admin_postinstall_statscollection_condition', '3.5.0', 1), (700, 'PLG_SYSTEM_UPDATENOTIFICATION_POSTINSTALL_UPDATECACHETIME', 'PLG_SYSTEM_UPDATENOTIFICATION_POSTINSTALL_UPDATECACHETIME_BODY', 'PLG_SYSTEM_UPDATENOTIFICATION_POSTINSTALL_UPDATECACHETIME_ACTION', 'plg_system_updatenotification', 1, 'action', 'site://plugins/system/updatenotification/postinstall/updatecachetime.php', 'updatecachetime_postinstall_action', 'site://plugins/system/updatenotification/postinstall/updatecachetime.php', 'updatecachetime_postinstall_condition', '3.6.3', 1), (700, 'COM_CPANEL_MSG_JOOMLA40_PRE_CHECKS_TITLE', 'COM_CPANEL_MSG_JOOMLA40_PRE_CHECKS_BODY', '', 'com_cpanel', 1, 'message', '', '', 'admin://components/com_admin/postinstall/joomla40checks.php', 'admin_postinstall_joomla40checks_condition', '3.7.0', 1), -(700, 'TPL_HATHOR_MESSAGE_POSTINSTALL_TITLE', 'TPL_HATHOR_MESSAGE_POSTINSTALL_BODY', 'TPL_HATHOR_MESSAGE_POSTINSTALL_ACTION', 'tpl_hathor', 1, 'action', 'admin://templates/hathor/postinstall/hathormessage.php', 'hathormessage_postinstall_action', 'admin://templates/hathor/postinstall/hathormessage.php', 'hathormessage_postinstall_condition', '3.7.0', 1); +(700, 'TPL_HATHOR_MESSAGE_POSTINSTALL_TITLE', 'TPL_HATHOR_MESSAGE_POSTINSTALL_BODY', 'TPL_HATHOR_MESSAGE_POSTINSTALL_ACTION', 'tpl_hathor', 1, 'action', 'admin://templates/hathor/postinstall/hathormessage.php', 'hathormessage_postinstall_action', 'admin://templates/hathor/postinstall/hathormessage.php', 'hathormessage_postinstall_condition', '3.7.0', 1), +(700, 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_TITLE', 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_BODY', 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_ACTION', 'plg_captcha_recaptcha', 1, 'action', 'site://plugins/captcha/recaptcha/postinstall/actions.php', 'recaptcha_postinstall_action', 'site://plugins/captcha/recaptcha/postinstall/actions.php', 'recaptcha_postinstall_condition', '3.9.0', 1); -- -------------------------------------------------------- diff --git a/installation/sql/postgresql/joomla.sql b/installation/sql/postgresql/joomla.sql index abfa4e5ce739f..f6486aedbecbb 100644 --- a/installation/sql/postgresql/joomla.sql +++ b/installation/sql/postgresql/joomla.sql @@ -1625,7 +1625,8 @@ INSERT INTO "#__postinstall_messages" ("extension_id", "title_key", "description (700, 'COM_CPANEL_MSG_STATS_COLLECTION_TITLE', 'COM_CPANEL_MSG_STATS_COLLECTION_BODY', '', 'com_cpanel', 1, 'message', '', '', 'admin://components/com_admin/postinstall/statscollection.php', 'admin_postinstall_statscollection_condition', '3.5.0', 1), (700, 'PLG_SYSTEM_UPDATENOTIFICATION_POSTINSTALL_UPDATECACHETIME', 'PLG_SYSTEM_UPDATENOTIFICATION_POSTINSTALL_UPDATECACHETIME_BODY', 'PLG_SYSTEM_UPDATENOTIFICATION_POSTINSTALL_UPDATECACHETIME_ACTION', 'plg_system_updatenotification', 1, 'action', 'site://plugins/system/updatenotification/postinstall/updatecachetime.php', 'updatecachetime_postinstall_action', 'site://plugins/system/updatenotification/postinstall/updatecachetime.php', 'updatecachetime_postinstall_condition', '3.6.3', 1), (700, 'COM_CPANEL_MSG_JOOMLA40_PRE_CHECKS_TITLE', 'COM_CPANEL_MSG_JOOMLA40_PRE_CHECKS_BODY', '', 'com_cpanel', 1, 'message', '', '', 'admin://components/com_admin/postinstall/joomla40checks.php', 'admin_postinstall_joomla40checks_condition', '3.7.0', 1), -(700, 'TPL_HATHOR_MESSAGE_POSTINSTALL_TITLE', 'TPL_HATHOR_MESSAGE_POSTINSTALL_BODY', 'TPL_HATHOR_MESSAGE_POSTINSTALL_ACTION', 'tpl_hathor', 1, 'action', 'admin://templates/hathor/postinstall/hathormessage.php', 'hathormessage_postinstall_action', 'admin://templates/hathor/postinstall/hathormessage.php', 'hathormessage_postinstall_condition', '3.7.0', 1); +(700, 'TPL_HATHOR_MESSAGE_POSTINSTALL_TITLE', 'TPL_HATHOR_MESSAGE_POSTINSTALL_BODY', 'TPL_HATHOR_MESSAGE_POSTINSTALL_ACTION', 'tpl_hathor', 1, 'action', 'admin://templates/hathor/postinstall/hathormessage.php', 'hathormessage_postinstall_action', 'admin://templates/hathor/postinstall/hathormessage.php', 'hathormessage_postinstall_condition', '3.7.0', 1), +(700, 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_TITLE', 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_BODY', 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_ACTION', 'plg_captcha_recaptcha', 1, 'action', 'site://plugins/captcha/recaptcha/postinstall/actions.php', 'recaptcha_postinstall_action', 'site://plugins/captcha/recaptcha/postinstall/actions.php', 'recaptcha_postinstall_condition', '3.9.0', 1); -- -- Table structure for table `#__redirect_links` diff --git a/installation/sql/sqlazure/joomla.sql b/installation/sql/sqlazure/joomla.sql index a7d4a96fbbe91..357a42380a988 100644 --- a/installation/sql/sqlazure/joomla.sql +++ b/installation/sql/sqlazure/joomla.sql @@ -2340,7 +2340,8 @@ INSERT INTO "#__postinstall_messages" ("extension_id", "title_key", "description (700, 'COM_CPANEL_MSG_STATS_COLLECTION_TITLE', 'COM_CPANEL_MSG_STATS_COLLECTION_BODY', '', 'com_cpanel', 1, 'message', '', '', 'admin://components/com_admin/postinstall/statscollection.php', 'admin_postinstall_statscollection_condition', '3.5.0', 1), (700, 'PLG_SYSTEM_UPDATENOTIFICATION_POSTINSTALL_UPDATECACHETIME', 'PLG_SYSTEM_UPDATENOTIFICATION_POSTINSTALL_UPDATECACHETIME_BODY', 'PLG_SYSTEM_UPDATENOTIFICATION_POSTINSTALL_UPDATECACHETIME_ACTION', 'plg_system_updatenotification', 1, 'action', 'site://plugins/system/updatenotification/postinstall/updatecachetime.php', 'updatecachetime_postinstall_action', 'site://plugins/system/updatenotification/postinstall/updatecachetime.php', 'updatecachetime_postinstall_condition', '3.6.3', 1), (700, 'COM_CPANEL_MSG_JOOMLA40_PRE_CHECKS_TITLE', 'COM_CPANEL_MSG_JOOMLA40_PRE_CHECKS_BODY', '', 'com_cpanel', 1, 'message', '', '', 'admin://components/com_admin/postinstall/joomla40checks.php', 'admin_postinstall_joomla40checks_condition', '3.7.0', 1), -(700, 'TPL_HATHOR_MESSAGE_POSTINSTALL_TITLE', 'TPL_HATHOR_MESSAGE_POSTINSTALL_BODY', 'TPL_HATHOR_MESSAGE_POSTINSTALL_ACTION', 'tpl_hathor', 1, 'action', 'admin://templates/hathor/postinstall/hathormessage.php', 'hathormessage_postinstall_action', 'admin://templates/hathor/postinstall/hathormessage.php', 'hathormessage_postinstall_condition', '3.7.0', 1); +(700, 'TPL_HATHOR_MESSAGE_POSTINSTALL_TITLE', 'TPL_HATHOR_MESSAGE_POSTINSTALL_BODY', 'TPL_HATHOR_MESSAGE_POSTINSTALL_ACTION', 'tpl_hathor', 1, 'action', 'admin://templates/hathor/postinstall/hathormessage.php', 'hathormessage_postinstall_action', 'admin://templates/hathor/postinstall/hathormessage.php', 'hathormessage_postinstall_condition', '3.7.0', 1) +(700, 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_TITLE', 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_BODY', 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_ACTION', 'plg_captcha_recaptcha', 1, 'action', 'site://plugins/captcha/recaptcha/postinstall/actions.php', 'recaptcha_postinstall_action', 'site://plugins/captcha/recaptcha/postinstall/actions.php', 'recaptcha_postinstall_condition', '3.9.0', 1); -- -- Table structure for table `#__redirect_links` diff --git a/plugins/captcha/recaptcha/postinstall/actions.php b/plugins/captcha/recaptcha/postinstall/actions.php new file mode 100644 index 0000000000000..7945bee1cdf98 --- /dev/null +++ b/plugins/captcha/recaptcha/postinstall/actions.php @@ -0,0 +1,48 @@ +getQuery(true) + ->select('*') + ->from($db->qn('#__extensions')) + ->where($db->qn('name') . ' = ' . $db->q('plg_captcha_recaptcha')) + ->where($db->qn('enabled') . ' = ' . $db->q('1')) + ->where($db->qn('params') . ' LIKE ' . $db->q('%1.0%')); + $db->setQuery($query); + $enabled_plugins = $db->loadObjectList(); + + return count($enabled_plugins) === 1; +} + +/** + * Open the reCAPTCHA plugin so that they can update the settings to V2 and new keys. + * + * @return void + * + * @since __DEPLOY_VERSION__ + */ +function recaptcha_postinstall_action() +{ + $url = 'index.php?option=com_plugins&task=plugin.edit&extension_id=439'; + JFactory::getApplication()->redirect($url); +} From 0d068f6c9058718ef78ccc2d6c2d79b033f0d006 Mon Sep 17 00:00:00 2001 From: Brian Teeman Date: Mon, 12 Feb 2018 15:35:59 +0000 Subject: [PATCH 2/6] CS - new lines --- .../com_admin/sql/updates/postgresql/3.9.0-2018-02-12.sql | 2 +- .../com_admin/sql/updates/sqlazure/3.9.0-2018-02-12.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-02-12.sql b/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-02-12.sql index 168b254cb2968..c14757ffe5fad 100644 --- a/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-02-12.sql +++ b/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-02-12.sql @@ -1,3 +1,3 @@ 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") VALUES -(700, 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_TITLE', 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_BODY', 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_ACTION', 'plg_captcha_recaptcha', 1, 'action', 'site://plugins/captcha/recaptcha/postinstall/actions.php', 'recaptcha_postinstall_action', 'site://plugins/captcha/recaptcha/postinstall/actions.php', 'recaptcha_postinstall_condition', '3.9.0', 1); \ No newline at end of file +(700, 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_TITLE', 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_BODY', 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_ACTION', 'plg_captcha_recaptcha', 1, 'action', 'site://plugins/captcha/recaptcha/postinstall/actions.php', 'recaptcha_postinstall_action', 'site://plugins/captcha/recaptcha/postinstall/actions.php', 'recaptcha_postinstall_condition', '3.9.0', 1); diff --git a/administrator/components/com_admin/sql/updates/sqlazure/3.9.0-2018-02-12.sql b/administrator/components/com_admin/sql/updates/sqlazure/3.9.0-2018-02-12.sql index 168b254cb2968..c14757ffe5fad 100644 --- a/administrator/components/com_admin/sql/updates/sqlazure/3.9.0-2018-02-12.sql +++ b/administrator/components/com_admin/sql/updates/sqlazure/3.9.0-2018-02-12.sql @@ -1,3 +1,3 @@ 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") VALUES -(700, 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_TITLE', 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_BODY', 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_ACTION', 'plg_captcha_recaptcha', 1, 'action', 'site://plugins/captcha/recaptcha/postinstall/actions.php', 'recaptcha_postinstall_action', 'site://plugins/captcha/recaptcha/postinstall/actions.php', 'recaptcha_postinstall_condition', '3.9.0', 1); \ No newline at end of file +(700, 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_TITLE', 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_BODY', 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_ACTION', 'plg_captcha_recaptcha', 1, 'action', 'site://plugins/captcha/recaptcha/postinstall/actions.php', 'recaptcha_postinstall_action', 'site://plugins/captcha/recaptcha/postinstall/actions.php', 'recaptcha_postinstall_condition', '3.9.0', 1); From 6415134bf4a8c1aed3807d88a4d0feef8d2dc6b3 Mon Sep 17 00:00:00 2001 From: Brian Teeman Date: Mon, 12 Feb 2018 17:12:23 +0000 Subject: [PATCH 3/6] use query to find the extension_id and not haardcoded --- plugins/captcha/recaptcha/postinstall/actions.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/plugins/captcha/recaptcha/postinstall/actions.php b/plugins/captcha/recaptcha/postinstall/actions.php index 7945bee1cdf98..39d97e4087db4 100644 --- a/plugins/captcha/recaptcha/postinstall/actions.php +++ b/plugins/captcha/recaptcha/postinstall/actions.php @@ -43,6 +43,15 @@ function recaptcha_postinstall_condition() */ function recaptcha_postinstall_action() { - $url = 'index.php?option=com_plugins&task=plugin.edit&extension_id=439'; + $db = JFactory::getDbo(); + + $query = $db->getQuery(true) + ->select('extension_id') + ->from($db->qn('#__extensions')) + ->where($db->qn('name') . ' = ' . $db->q('plg_captcha_recaptcha')); + $db->setQuery($query); + $e_id = $db->loadResult(); + + $url = 'index.php?option=com_plugins&task=plugin.edit&extension_id=' . $e_id; JFactory::getApplication()->redirect($url); } From 6d86bfda09e788be28b4be0aef8282758cb47843 Mon Sep 17 00:00:00 2001 From: Brian Teeman Date: Mon, 12 Feb 2018 17:22:51 +0000 Subject: [PATCH 4/6] docblock --- plugins/captcha/recaptcha/postinstall/actions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/captcha/recaptcha/postinstall/actions.php b/plugins/captcha/recaptcha/postinstall/actions.php index 39d97e4087db4..56f6f0c63c006 100644 --- a/plugins/captcha/recaptcha/postinstall/actions.php +++ b/plugins/captcha/recaptcha/postinstall/actions.php @@ -14,7 +14,7 @@ * Checks if the plugin is enabled and reCAPTCHA V1 is being used. If true then the * message about reCAPTCHA v1 EOL should be displayed. * - * @return integer + * @return boolean * * @since __DEPLOY_VERSION__ */ From eb826e7b8e5af8a7d41ab18a42a2e2a466b397b8 Mon Sep 17 00:00:00 2001 From: Brian Teeman Date: Wed, 14 Feb 2018 19:22:43 +0000 Subject: [PATCH 5/6] 3.8.6 --- .../mysql/{3.9.0-2018-02-12.sql => 3.8.6-2018-02-14.sql} | 2 +- .../postgresql/{3.9.0-2018-02-12.sql => 3.8.6-2018-02-14.sql} | 2 +- .../sqlazure/{3.9.0-2018-02-12.sql => 3.8.6-2018-02-14.sql} | 2 +- installation/sql/mysql/joomla.sql | 2 +- installation/sql/postgresql/joomla.sql | 2 +- installation/sql/sqlazure/joomla.sql | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) rename administrator/components/com_admin/sql/updates/mysql/{3.9.0-2018-02-12.sql => 3.8.6-2018-02-14.sql} (90%) rename administrator/components/com_admin/sql/updates/postgresql/{3.9.0-2018-02-12.sql => 3.8.6-2018-02-14.sql} (90%) rename administrator/components/com_admin/sql/updates/sqlazure/{3.9.0-2018-02-12.sql => 3.8.6-2018-02-14.sql} (90%) diff --git a/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-02-12.sql b/administrator/components/com_admin/sql/updates/mysql/3.8.6-2018-02-14.sql similarity index 90% rename from administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-02-12.sql rename to administrator/components/com_admin/sql/updates/mysql/3.8.6-2018-02-14.sql index a693f7635aaec..955e669aada97 100644 --- a/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-02-12.sql +++ b/administrator/components/com_admin/sql/updates/mysql/3.8.6-2018-02-14.sql @@ -1,3 +1,3 @@ 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`) VALUES -(700, 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_TITLE', 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_BODY', 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_ACTION', 'plg_captcha_recaptcha', 1, 'action', 'site://plugins/captcha/recaptcha/postinstall/actions.php', 'recaptcha_postinstall_action', 'site://plugins/captcha/recaptcha/postinstall/actions.php', 'recaptcha_postinstall_condition', '3.9.0', 1); +(700, 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_TITLE', 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_BODY', 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_ACTION', 'plg_captcha_recaptcha', 1, 'action', 'site://plugins/captcha/recaptcha/postinstall/actions.php', 'recaptcha_postinstall_action', 'site://plugins/captcha/recaptcha/postinstall/actions.php', 'recaptcha_postinstall_condition', '3.8.6', 1); diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-02-12.sql b/administrator/components/com_admin/sql/updates/postgresql/3.8.6-2018-02-14.sql similarity index 90% rename from administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-02-12.sql rename to administrator/components/com_admin/sql/updates/postgresql/3.8.6-2018-02-14.sql index c14757ffe5fad..8c57ae40bb5fb 100644 --- a/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-02-12.sql +++ b/administrator/components/com_admin/sql/updates/postgresql/3.8.6-2018-02-14.sql @@ -1,3 +1,3 @@ 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") VALUES -(700, 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_TITLE', 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_BODY', 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_ACTION', 'plg_captcha_recaptcha', 1, 'action', 'site://plugins/captcha/recaptcha/postinstall/actions.php', 'recaptcha_postinstall_action', 'site://plugins/captcha/recaptcha/postinstall/actions.php', 'recaptcha_postinstall_condition', '3.9.0', 1); +(700, 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_TITLE', 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_BODY', 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_ACTION', 'plg_captcha_recaptcha', 1, 'action', 'site://plugins/captcha/recaptcha/postinstall/actions.php', 'recaptcha_postinstall_action', 'site://plugins/captcha/recaptcha/postinstall/actions.php', 'recaptcha_postinstall_condition', '3.8.6', 1); diff --git a/administrator/components/com_admin/sql/updates/sqlazure/3.9.0-2018-02-12.sql b/administrator/components/com_admin/sql/updates/sqlazure/3.8.6-2018-02-14.sql similarity index 90% rename from administrator/components/com_admin/sql/updates/sqlazure/3.9.0-2018-02-12.sql rename to administrator/components/com_admin/sql/updates/sqlazure/3.8.6-2018-02-14.sql index c14757ffe5fad..8c57ae40bb5fb 100644 --- a/administrator/components/com_admin/sql/updates/sqlazure/3.9.0-2018-02-12.sql +++ b/administrator/components/com_admin/sql/updates/sqlazure/3.8.6-2018-02-14.sql @@ -1,3 +1,3 @@ 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") VALUES -(700, 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_TITLE', 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_BODY', 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_ACTION', 'plg_captcha_recaptcha', 1, 'action', 'site://plugins/captcha/recaptcha/postinstall/actions.php', 'recaptcha_postinstall_action', 'site://plugins/captcha/recaptcha/postinstall/actions.php', 'recaptcha_postinstall_condition', '3.9.0', 1); +(700, 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_TITLE', 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_BODY', 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_ACTION', 'plg_captcha_recaptcha', 1, 'action', 'site://plugins/captcha/recaptcha/postinstall/actions.php', 'recaptcha_postinstall_action', 'site://plugins/captcha/recaptcha/postinstall/actions.php', 'recaptcha_postinstall_condition', '3.8.6', 1); diff --git a/installation/sql/mysql/joomla.sql b/installation/sql/mysql/joomla.sql index 3205e710a613e..ceeef4b235a1f 100644 --- a/installation/sql/mysql/joomla.sql +++ b/installation/sql/mysql/joomla.sql @@ -1643,7 +1643,7 @@ INSERT INTO `#__postinstall_messages` (`extension_id`, `title_key`, `description (700, 'PLG_SYSTEM_UPDATENOTIFICATION_POSTINSTALL_UPDATECACHETIME', 'PLG_SYSTEM_UPDATENOTIFICATION_POSTINSTALL_UPDATECACHETIME_BODY', 'PLG_SYSTEM_UPDATENOTIFICATION_POSTINSTALL_UPDATECACHETIME_ACTION', 'plg_system_updatenotification', 1, 'action', 'site://plugins/system/updatenotification/postinstall/updatecachetime.php', 'updatecachetime_postinstall_action', 'site://plugins/system/updatenotification/postinstall/updatecachetime.php', 'updatecachetime_postinstall_condition', '3.6.3', 1), (700, 'COM_CPANEL_MSG_JOOMLA40_PRE_CHECKS_TITLE', 'COM_CPANEL_MSG_JOOMLA40_PRE_CHECKS_BODY', '', 'com_cpanel', 1, 'message', '', '', 'admin://components/com_admin/postinstall/joomla40checks.php', 'admin_postinstall_joomla40checks_condition', '3.7.0', 1), (700, 'TPL_HATHOR_MESSAGE_POSTINSTALL_TITLE', 'TPL_HATHOR_MESSAGE_POSTINSTALL_BODY', 'TPL_HATHOR_MESSAGE_POSTINSTALL_ACTION', 'tpl_hathor', 1, 'action', 'admin://templates/hathor/postinstall/hathormessage.php', 'hathormessage_postinstall_action', 'admin://templates/hathor/postinstall/hathormessage.php', 'hathormessage_postinstall_condition', '3.7.0', 1), -(700, 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_TITLE', 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_BODY', 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_ACTION', 'plg_captcha_recaptcha', 1, 'action', 'site://plugins/captcha/recaptcha/postinstall/actions.php', 'recaptcha_postinstall_action', 'site://plugins/captcha/recaptcha/postinstall/actions.php', 'recaptcha_postinstall_condition', '3.9.0', 1); +(700, 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_TITLE', 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_BODY', 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_ACTION', 'plg_captcha_recaptcha', 1, 'action', 'site://plugins/captcha/recaptcha/postinstall/actions.php', 'recaptcha_postinstall_action', 'site://plugins/captcha/recaptcha/postinstall/actions.php', 'recaptcha_postinstall_condition', '3.8.6', 1); -- -------------------------------------------------------- diff --git a/installation/sql/postgresql/joomla.sql b/installation/sql/postgresql/joomla.sql index f6486aedbecbb..6ac7c372043de 100644 --- a/installation/sql/postgresql/joomla.sql +++ b/installation/sql/postgresql/joomla.sql @@ -1626,7 +1626,7 @@ INSERT INTO "#__postinstall_messages" ("extension_id", "title_key", "description (700, 'PLG_SYSTEM_UPDATENOTIFICATION_POSTINSTALL_UPDATECACHETIME', 'PLG_SYSTEM_UPDATENOTIFICATION_POSTINSTALL_UPDATECACHETIME_BODY', 'PLG_SYSTEM_UPDATENOTIFICATION_POSTINSTALL_UPDATECACHETIME_ACTION', 'plg_system_updatenotification', 1, 'action', 'site://plugins/system/updatenotification/postinstall/updatecachetime.php', 'updatecachetime_postinstall_action', 'site://plugins/system/updatenotification/postinstall/updatecachetime.php', 'updatecachetime_postinstall_condition', '3.6.3', 1), (700, 'COM_CPANEL_MSG_JOOMLA40_PRE_CHECKS_TITLE', 'COM_CPANEL_MSG_JOOMLA40_PRE_CHECKS_BODY', '', 'com_cpanel', 1, 'message', '', '', 'admin://components/com_admin/postinstall/joomla40checks.php', 'admin_postinstall_joomla40checks_condition', '3.7.0', 1), (700, 'TPL_HATHOR_MESSAGE_POSTINSTALL_TITLE', 'TPL_HATHOR_MESSAGE_POSTINSTALL_BODY', 'TPL_HATHOR_MESSAGE_POSTINSTALL_ACTION', 'tpl_hathor', 1, 'action', 'admin://templates/hathor/postinstall/hathormessage.php', 'hathormessage_postinstall_action', 'admin://templates/hathor/postinstall/hathormessage.php', 'hathormessage_postinstall_condition', '3.7.0', 1), -(700, 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_TITLE', 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_BODY', 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_ACTION', 'plg_captcha_recaptcha', 1, 'action', 'site://plugins/captcha/recaptcha/postinstall/actions.php', 'recaptcha_postinstall_action', 'site://plugins/captcha/recaptcha/postinstall/actions.php', 'recaptcha_postinstall_condition', '3.9.0', 1); +(700, 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_TITLE', 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_BODY', 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_ACTION', 'plg_captcha_recaptcha', 1, 'action', 'site://plugins/captcha/recaptcha/postinstall/actions.php', 'recaptcha_postinstall_action', 'site://plugins/captcha/recaptcha/postinstall/actions.php', 'recaptcha_postinstall_condition', '3.8.6', 1); -- -- Table structure for table `#__redirect_links` diff --git a/installation/sql/sqlazure/joomla.sql b/installation/sql/sqlazure/joomla.sql index 357a42380a988..2815ea5c573ef 100644 --- a/installation/sql/sqlazure/joomla.sql +++ b/installation/sql/sqlazure/joomla.sql @@ -2341,7 +2341,7 @@ INSERT INTO "#__postinstall_messages" ("extension_id", "title_key", "description (700, 'PLG_SYSTEM_UPDATENOTIFICATION_POSTINSTALL_UPDATECACHETIME', 'PLG_SYSTEM_UPDATENOTIFICATION_POSTINSTALL_UPDATECACHETIME_BODY', 'PLG_SYSTEM_UPDATENOTIFICATION_POSTINSTALL_UPDATECACHETIME_ACTION', 'plg_system_updatenotification', 1, 'action', 'site://plugins/system/updatenotification/postinstall/updatecachetime.php', 'updatecachetime_postinstall_action', 'site://plugins/system/updatenotification/postinstall/updatecachetime.php', 'updatecachetime_postinstall_condition', '3.6.3', 1), (700, 'COM_CPANEL_MSG_JOOMLA40_PRE_CHECKS_TITLE', 'COM_CPANEL_MSG_JOOMLA40_PRE_CHECKS_BODY', '', 'com_cpanel', 1, 'message', '', '', 'admin://components/com_admin/postinstall/joomla40checks.php', 'admin_postinstall_joomla40checks_condition', '3.7.0', 1), (700, 'TPL_HATHOR_MESSAGE_POSTINSTALL_TITLE', 'TPL_HATHOR_MESSAGE_POSTINSTALL_BODY', 'TPL_HATHOR_MESSAGE_POSTINSTALL_ACTION', 'tpl_hathor', 1, 'action', 'admin://templates/hathor/postinstall/hathormessage.php', 'hathormessage_postinstall_action', 'admin://templates/hathor/postinstall/hathormessage.php', 'hathormessage_postinstall_condition', '3.7.0', 1) -(700, 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_TITLE', 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_BODY', 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_ACTION', 'plg_captcha_recaptcha', 1, 'action', 'site://plugins/captcha/recaptcha/postinstall/actions.php', 'recaptcha_postinstall_action', 'site://plugins/captcha/recaptcha/postinstall/actions.php', 'recaptcha_postinstall_condition', '3.9.0', 1); +(700, 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_TITLE', 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_BODY', 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_ACTION', 'plg_captcha_recaptcha', 1, 'action', 'site://plugins/captcha/recaptcha/postinstall/actions.php', 'recaptcha_postinstall_action', 'site://plugins/captcha/recaptcha/postinstall/actions.php', 'recaptcha_postinstall_condition', '3.8.6', 1); -- -- Table structure for table `#__redirect_links` From 4c7434fb1536aa9a27771ab827d1c6d628ee8e99 Mon Sep 17 00:00:00 2001 From: Brian Teeman Date: Wed, 14 Feb 2018 23:53:57 +0000 Subject: [PATCH 6/6] Update actions.php --- plugins/captcha/recaptcha/postinstall/actions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/captcha/recaptcha/postinstall/actions.php b/plugins/captcha/recaptcha/postinstall/actions.php index 56f6f0c63c006..f1fbe96d416e1 100644 --- a/plugins/captcha/recaptcha/postinstall/actions.php +++ b/plugins/captcha/recaptcha/postinstall/actions.php @@ -23,10 +23,10 @@ function recaptcha_postinstall_condition() $db = JFactory::getDbo(); $query = $db->getQuery(true) - ->select('*') + ->select('1') ->from($db->qn('#__extensions')) ->where($db->qn('name') . ' = ' . $db->q('plg_captcha_recaptcha')) - ->where($db->qn('enabled') . ' = ' . $db->q('1')) + ->where($db->qn('enabled') . ' = 1') ->where($db->qn('params') . ' LIKE ' . $db->q('%1.0%')); $db->setQuery($query); $enabled_plugins = $db->loadObjectList();