diff --git a/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-04-01.sql b/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-04-01.sql new file mode 100644 index 0000000000000..b3f2e8f22664d --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-04-01.sql @@ -0,0 +1,5 @@ +INSERT INTO `#__extensions` (`extension_id`, `package_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `custom_data`, `system_data`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES +(481, 0, 'plg_user_privacyconsent', 'plugin', 'privacyconsent', 'user', 0, 0, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0); +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_USER_PRIVACYCONSENT_POSTINSTALL_TITLE', 'PLG_USER_PRIVACYCONSENT_POSTINSTALL_BODY', '', 'plg_user_privacyconsent', 1, 'message', '', '', '', '', '3.9.0', 1); diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-04-01.sql b/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-04-01.sql new file mode 100644 index 0000000000000..9b9efce4fdd2a --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-04-01.sql @@ -0,0 +1,5 @@ +INSERT INTO "#__extensions" ("extension_id", "package_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "custom_data", "system_data", "checked_out", "checked_out_time", "ordering", "state") VALUES +(481, 0, 'plg_user_privacyconsent', 'plugin', 'privacyconsent', 'user', 0, 0, 1, 0, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0); +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_USER_PRIVACYCONSENT_POSTINSTALL_TITLE', 'PLG_USER_PRIVACYCONSENT_POSTINSTALL_BODY', '', 'plg_user_privacyconsent', 1, 'message', '', '', '', '', '3.9.0', 1); \ No newline at end of file diff --git a/administrator/components/com_admin/sql/updates/sqlazure/3.9.0-2018-04-01.sql b/administrator/components/com_admin/sql/updates/sqlazure/3.9.0-2018-04-01.sql new file mode 100644 index 0000000000000..be3ae1c227a2d --- /dev/null +++ b/administrator/components/com_admin/sql/updates/sqlazure/3.9.0-2018-04-01.sql @@ -0,0 +1,5 @@ +INSERT INTO "#__extensions" ("extension_id", "package_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "custom_data", "system_data", "checked_out", "checked_out_time", "ordering", "state") VALUES +(481, 0, 'plg_user_privacyconsent', 'plugin', 'privacyconsent', 'user', 0, 0, 1, 0, '', '', '', '', 0, '1990-01-01 00:00:00', 0, 0); +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_USER_PRIVACYCONSENT_POSTINSTALL_TITLE', 'PLG_USER_PRIVACYCONSENT_POSTINSTALL_BODY', '', 'plg_user_privacyconsent', 1, 'message', '', '', '', '', '3.9.0', 1); diff --git a/administrator/language/en-GB/en-GB.plg_user_privacyconsent.ini b/administrator/language/en-GB/en-GB.plg_user_privacyconsent.ini new file mode 100644 index 0000000000000..7e22d31ed2f75 --- /dev/null +++ b/administrator/language/en-GB/en-GB.plg_user_privacyconsent.ini @@ -0,0 +1,23 @@ +; Joomla! Project +; Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. +; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php +; Note : All ini files need to be saved as UTF-8 + +PLG_USER_PRIVACYCONSENT_BODY="
The user consented to storing their user information using the IP address %s
The user agent string of the user's browser was:
%s
This information was automatically recorded when the user submitted their details on the web site and checked the confirm box
" +PLG_USER_PRIVACYCONSENT_FIELD_ARTICLE_DESC="Select the desired Privacy article from the list." +PLG_USER_PRIVACYCONSENT_FIELD_ARTICLE_LABEL="Privacy Article" +PLG_USER_PRIVACYCONSENT_FIELD_DESC="Read the full privacy policy" +PLG_USER_PRIVACYCONSENT_FIELD_ERROR="Agreement to the site's Privacy Policy is required." +PLG_USER_PRIVACYCONSENT_FIELD_LABEL="Privacy Policy" +PLG_USER_PRIVACYCONSENT_LABEL="Web Site Privacy" +PLG_USER_PRIVACYCONSENT_NOTE_FIELD_DEFAULT="By signing up to this web site and agreeing to the Privacy Policy you agree to this web site storing your information." +PLG_USER_PRIVACYCONSENT_NOTE_FIELD_DESC="Write a summary of the site's privacy policy." +PLG_USER_PRIVACYCONSENT_NOTE_FIELD_LABEL="Short Privacy Policy" +PLG_USER_PRIVACYCONSENT_OPTION_AGREE="I agree" +PLG_USER_PRIVACYCONSENT_POSTINSTALL_TITLE="Privacy Policy (GDPR) Plugin" +PLG_USER_PRIVACYCONSENT_POSTINSTALL_BODY="This is a basic plugin to request user's consent to the site's privacy policy. Existing users who have not consented yet will be redirected on login to update their profile." +PLG_USER_PRIVACYCONSENT_REDIRECT_MESSAGE_DEFAULT="Please confirm that you consent to this web site storing your information by agreeing to the privacy policy." +PLG_USER_PRIVACYCONSENT_REDIRECT_MESSAGE_DESC="Custom message to be displayed on redirect. If left blank then the default message will be used." +PLG_USER_PRIVACYCONSENT_REDIRECT_MESSAGE_LABEL="Redirect Message" +PLG_USER_PRIVACYCONSENT_SUBJECT="Privacy Policy" +PLG_USER_PRIVACYCONSENT_XML_DESCRIPTION="Basic plugin to request user's consent to the site's privacy policy. Existing users who have not consented yet will be redirected on login to update their profile." diff --git a/administrator/language/en-GB/en-GB.plg_user_privacyconsent.sys.ini b/administrator/language/en-GB/en-GB.plg_user_privacyconsent.sys.ini new file mode 100644 index 0000000000000..ac4a81f877bec --- /dev/null +++ b/administrator/language/en-GB/en-GB.plg_user_privacyconsent.sys.ini @@ -0,0 +1,7 @@ +; Joomla! Project +; Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. +; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php +; Note : All ini files need to be saved as UTF-8 + +PLG_USER_PRIVACYCONSENT="User - Privacy Consent" +PLG_USER_PRIVACYCONSENT_XML_DESCRIPTION="Basic plugin to request user's consent to the site's privacy policy. Existing users who have not consented yet will be redirected on login to update their profile." \ No newline at end of file diff --git a/installation/sql/mysql/joomla.sql b/installation/sql/mysql/joomla.sql index 72dddaa5bb888..361d4df8a6dcb 100644 --- a/installation/sql/mysql/joomla.sql +++ b/installation/sql/mysql/joomla.sql @@ -643,6 +643,7 @@ INSERT INTO `#__extensions` (`extension_id`, `package_id`, `name`, `type`, `elem (478, 0, 'plg_editors-xtd_fields', 'plugin', 'fields', 'editors-xtd', 0, 1, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0), (479, 0, 'plg_sampledata_blog', 'plugin', 'blog', 'sampledata', 0, 1, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0), (480, 0, 'plg_system_sessiongc', 'plugin', 'sessiongc', 'system', 0, 1, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0), +(481, 0, 'plg_user_privacyconsent', 'plugin', 'privacyconsent', 'user', 0, 0, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0), (503, 0, 'beez3', 'template', 'beez3', '', 0, 1, 1, 0, '', '{"wrapperSmall":"53","wrapperLarge":"72","sitetitle":"","sitedescription":"","navposition":"center","templatecolor":"nature"}', '', '', 0, '0000-00-00 00:00:00', 0, 0), (504, 0, 'hathor', 'template', 'hathor', '', 1, 1, 1, 0, '', '{"showSiteName":"0","colourChoice":"0","boldText":"0"}', '', '', 0, '0000-00-00 00:00:00', 0, 0), (506, 0, 'protostar', 'template', 'protostar', '', 0, 1, 1, 0, '', '{"templateColor":"","logoFile":"","googleFont":"1","googleFontName":"Open+Sans","fluidContainer":"0"}', '', '', 0, '0000-00-00 00:00:00', 0, 0), @@ -1644,7 +1645,8 @@ 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.8.6', 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), +(700, 'PLG_USER_PRIVACYCONSENT_POSTINSTALL_TITLE', 'PLG_USER_PRIVACYCONSENT_POSTINSTALL_BODY', '', 'plg_user_privacyconsent', 1, 'message', '', '', '', '', '3.9.0', 1); -- -------------------------------------------------------- diff --git a/installation/sql/postgresql/joomla.sql b/installation/sql/postgresql/joomla.sql index d5686a2e6f61c..ea523ad5b294e 100644 --- a/installation/sql/postgresql/joomla.sql +++ b/installation/sql/postgresql/joomla.sql @@ -657,6 +657,7 @@ INSERT INTO "#__extensions" ("extension_id", "package_id", "name", "type", "elem (478, 0, 'plg_editors-xtd_fields', 'plugin', 'fields', 'editors-xtd', 0, 1, 1, 0, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0), (479, 0, 'plg_sampledata_blog', 'plugin', 'blog', 'sampledata', 0, 1, 1, 0, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0), (480, 0, 'plg_system_sessiongc', 'plugin', 'sessiongc', 'system', 0, 1, 1, 0, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0), +(481, 0, 'plg_user_privacyconsent', 'plugin', 'privacyconsent', 'user', 0, 0, 1, 0, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0); (503, 0, 'beez3', 'template', 'beez3', '', 0, 1, 1, 0, '', '{"wrapperSmall":"53","wrapperLarge":"72","sitetitle":"","sitedescription":"","navposition":"center","templatecolor":"nature"}', '', '', 0, '1970-01-01 00:00:00', 0, 0), (504, 0, 'hathor', 'template', 'hathor', '', 1, 1, 1, 0, '', '{"showSiteName":"0","colourChoice":"0","boldText":"0"}', '', '', 0, '1970-01-01 00:00:00', 0, 0), (506, 0, 'protostar', 'template', 'protostar', '', 0, 1, 1, 0, '', '{"templateColor":"","logoFile":"","googleFont":"1","googleFontName":"Open+Sans","fluidContainer":"0"}', '', '', 0, '1970-01-01 00:00:00', 0, 0), @@ -1627,7 +1628,8 @@ 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.8.6', 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), +(700, 'PLG_USER_PRIVACYCONSENT_POSTINSTALL_TITLE', 'PLG_USER_PRIVACYCONSENT_POSTINSTALL_BODY', '', 'plg_user_privacyconsent', 1, 'message', '', '', '', '', '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 49e643241b005..7b25a96744804 100644 --- a/installation/sql/sqlazure/joomla.sql +++ b/installation/sql/sqlazure/joomla.sql @@ -872,6 +872,7 @@ INSERT INTO "#__extensions" ("extension_id", "package_id", "name", "type", "elem (478, 0, 'plg_editors-xtd_fields', 'plugin', 'fields', 'editors-xtd', 0, 1, 1, 0, '', '', '', '', 0, '1900-01-01 00:00:00', 0, 0), (479, 0, 'plg_sampledata_blog', 'plugin', 'blog', 'sampledata', 0, 1, 1, 0, '', '', '', '', 0, '1900-01-01 00:00:00', 0, 0), (480, 0, 'plg_system_sessiongc', 'plugin', 'sessiongc', 'system', 0, 1, 1, 0, '', '', '', '', 0, '1900-01-01 00:00:00', 0, 0), +(481, 0, 'plg_user_privacyconsent', 'plugin', 'privacyconsent', 'user', 0, 0, 1, 0, '', '', '', '', 0, '1900-01-01 00:00:00', 0, 0); (503, 0, 'beez3', 'template', 'beez3', '', 0, 1, 1, 0, '', '{"wrapperSmall":"53","wrapperLarge":"72","sitetitle":"","sitedescription":"","navposition":"center","templatecolor":"nature"}', '', '', 0, '1900-01-01 00:00:00', 0, 0), (504, 0, 'hathor', 'template', 'hathor', '', 1, 1, 1, 0, '', '{"showSiteName":"0","colourChoice":"0","boldText":"0"}', '', '', 0, '1900-01-01 00:00:00', 0, 0), (506, 0, 'protostar', 'template', 'protostar', '', 0, 1, 1, 0, '', '{"templateColor":"","logoFile":"","googleFont":"1","googleFontName":"Open+Sans","fluidContainer":"0"}', '', '', 0, '1900-01-01 00:00:00', 0, 0), @@ -2342,7 +2343,8 @@ 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.8.6', 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), +(700, 'PLG_USER_PRIVACYCONSENT_POSTINSTALL_TITLE', 'PLG_USER_PRIVACYCONSENT_POSTINSTALL_BODY', '', 'plg_user_privacyconsent', 1, 'message', '', '', '', '', '3.9.0', 1); -- -- Table structure for table `#__redirect_links` diff --git a/libraries/src/Extension/ExtensionHelper.php b/libraries/src/Extension/ExtensionHelper.php index 373fd1b6f6bee..86dd57e5f1d94 100644 --- a/libraries/src/Extension/ExtensionHelper.php +++ b/libraries/src/Extension/ExtensionHelper.php @@ -234,6 +234,7 @@ class ExtensionHelper // Core plugin extensions - user array('plugin', 'contactcreator', 'user', 0), array('plugin', 'joomla', 'user', 0), + array('plugin', 'privacyconsent', 'user', 0), array('plugin', 'profile', 'user', 0), // Core template extensions - administrator diff --git a/plugins/user/privacyconsent/field/privacy.php b/plugins/user/privacyconsent/field/privacy.php new file mode 100644 index 0000000000000..834986ea14acc --- /dev/null +++ b/plugins/user/privacyconsent/field/privacy.php @@ -0,0 +1,136 @@ +element['note']) ? $this->element['note'] : Text::_('PLG_USER_PRIVACYCONSENT_NOTE_FIELD_DEFAULT'); + + echo '