From c176389f34a5a35da8ee0bae2717e47c15063ebc Mon Sep 17 00:00:00 2001 From: Achim Ennenbach Date: Mon, 27 Aug 2018 20:10:31 +0200 Subject: [PATCH 1/6] Added update routine from 2.1.9 to 2.2.0 --- e107_admin/update_routines.php | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/e107_admin/update_routines.php b/e107_admin/update_routines.php index 41a5a6154..6e12cd0b7 100644 --- a/e107_admin/update_routines.php +++ b/e107_admin/update_routines.php @@ -122,6 +122,8 @@ if (!$dont_check_update) $LAN_UPDATE_4 = deftrue('LAN_UPDATE_4',"Update from [x] to [y]"); // in case language-pack hasn't been upgraded. $LAN_UPDATE_5 = deftrue('LAN_UPDATE_5', "Core database structure"); + $dbupdate['219_to_220'] = array('master'=>false, 'title'=> e107::getParser()->lanVars($LAN_UPDATE_4, array('2.1.9','2.2.0')), 'message'=> null, 'hide_when_complete'=>true); + $dbupdate['218_to_219'] = array('master'=>false, 'title'=> e107::getParser()->lanVars($LAN_UPDATE_4, array('2.1.8','2.1.9')), 'message'=> null, 'hide_when_complete'=>true); $dbupdate['217_to_218'] = array('master'=>false, 'title'=> e107::getParser()->lanVars($LAN_UPDATE_4, array('2.1.7','2.1.8')), 'message'=> null, 'hide_when_complete'=>true); @@ -564,6 +566,21 @@ function update_core_database($type = '') } + function update_219_to_220($type='') + { + $sql = e107::getDb(); + $just_check = ($type == 'do') ? false : true; + + // add new pref contact_privacypolicy + if (!e107::getPref('contact_privacypolicy', '')) + { + e107::getConfig()->setPref('contact_privacypolicy', '')->save(false, true); + } + + return $just_check; + } + + function update_218_to_219($type='') { $sql = e107::getDb(); @@ -598,15 +615,15 @@ function update_core_database($type = '') $e_user_list = e107::getPref('e_user_list'); - if(empty($e_user_list['user'])) // check e107_plugins/user/e_user.php is registered. - { - if($just_check) - { - return update_needed("user/e_user.php need to be registered"); // NO LAN. - } - e107::getPlug()->clearCache()->buildAddonPrefLists(); - } + if(empty($e_user_list['user'])) // check e107_plugins/user/e_user.php is registered. + { + if($just_check) + { + return update_needed("user/e_user.php need to be registered"); // NO LAN. + } + + } // Make sure, that the pref "post_script" contains one of the allowed userclasses From c165fad9f08e7d335dab2f3352aaac5b02a24c48 Mon Sep 17 00:00:00 2001 From: Achim Ennenbach Date: Mon, 27 Aug 2018 20:11:55 +0200 Subject: [PATCH 2/6] Added new pref for a privacy policy url in contact forms (incl. Lans) --- e107_admin/prefs.php | 19 +++++++++++++++++-- e107_languages/English/admin/lan_prefs.php | 3 +++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/e107_admin/prefs.php b/e107_admin/prefs.php index 4cac5ecac..b55432e19 100644 --- a/e107_admin/prefs.php +++ b/e107_admin/prefs.php @@ -516,7 +516,16 @@ $text .= "
".PRFLAN_274."
- + + + + + ".$frm->text('contact_privacypolicy', $pref['contact_privacypolicy'], 200, array('size'=>'xxlarge'))." +
".PRFLAN_278."
+ + + + ".$frm->textarea('contact_filter', $pref['contact_filter'], 5, 59, array('size'=>'xxlarge'))." @@ -526,7 +535,6 @@ $text .= "
- "; @@ -1114,6 +1122,13 @@ else } } +// add new pref contact_privacypolicy +if (!isset($pref['contact_privacypolicy'])) +{ + $pref['contact_privacypolicy'] = ''; + $savePrefs = true; +} + if ($savePrefs) $core_pref->setPref($pref)->save(false, true); diff --git a/e107_languages/English/admin/lan_prefs.php b/e107_languages/English/admin/lan_prefs.php index 274fd147a..e1d92cf8a 100644 --- a/e107_languages/English/admin/lan_prefs.php +++ b/e107_languages/English/admin/lan_prefs.php @@ -295,3 +295,6 @@ define("PRFLAN_273", "Lifetime in seconds. 0 = until the browser is closed. "); define("PRFLAN_274", "Contact form will only be visible to this userclass group."); define("PRFLAN_275", "View this page using https (SSL) to modify this option"); define("PRFLAN_276", "PHP Default (Preferred)"); + +define("PRFLAN_277", "URL to the Privacy Policy"); +define("PRFLAN_278", "Make sure the url exists! It's best to use an absolute url."); From 986633d117d898fbd5cc57767d4362702f7ff156 Mon Sep 17 00:00:00 2001 From: Achim Ennenbach Date: Mon, 27 Aug 2018 20:12:54 +0200 Subject: [PATCH 3/6] fixes #3375 added GDPR Agreement checkbox to contact form (incl. Lans) --- .../shortcodes/batch/contact_shortcodes.php | 21 +++++++++++++++++++ e107_core/templates/contact_template.php | 15 +++++++++++++ e107_languages/English/lan_contact.php | 4 ++++ 3 files changed, 40 insertions(+) diff --git a/e107_core/shortcodes/batch/contact_shortcodes.php b/e107_core/shortcodes/batch/contact_shortcodes.php index a027fd912..2be64fbbb 100644 --- a/e107_core/shortcodes/batch/contact_shortcodes.php +++ b/e107_core/shortcodes/batch/contact_shortcodes.php @@ -168,6 +168,27 @@ class contact_shortcodes extends e_shortcode return ""; } + function sc_contact_gdpr_check($parm='') + { + $parm['class'] = (!empty($parm['class'])) ? $parm['class'] : ''; + $parm = array_merge(array('required'=>1), $parm); + return e107::getForm()->checkbox('gdpr', 1,false, $parm); + } + + function sc_contact_gdpr_link($parm='') + { + $pp = e107::getPref('contact_privacypolicy', ''); + if (!$pp) + { + return ''; + } + $class = (!empty($parm['class'])) ? $parm['class'] : ''; + $link = e107::getParser()->lanVars('[z]', array($class, $pp, LANCONTACT_22)); + $text = e107::getParser()->lanVars(LANCONTACT_23, $link); + return $text; + } + + } ?> diff --git a/e107_core/templates/contact_template.php b/e107_core/templates/contact_template.php index 2c115e93a..5f983aeea 100644 --- a/e107_core/templates/contact_template.php +++ b/e107_core/templates/contact_template.php @@ -51,6 +51,12 @@ $CONTACT_TEMPLATE['menu'] = ' {CONTACT_BODY=rows=5&cols=30} +
+
+ +
{CONTACT_GDPR_LINK}
+
+
{CONTACT_SUBMIT_BUTTON} '; @@ -97,6 +103,15 @@ $CONTACT_TEMPLATE['menu'] = ' {CONTACT_IMAGECODE} {CONTACT_IMAGECODE_INPUT} +
+
+ +
{CONTACT_GDPR_LINK}
+
+
+ + +
{CONTACT_SUBMIT_BUTTON}
diff --git a/e107_languages/English/lan_contact.php b/e107_languages/English/lan_contact.php index fb0c02047..6ac74db5c 100644 --- a/e107_languages/English/lan_contact.php +++ b/e107_languages/English/lan_contact.php @@ -37,5 +37,9 @@ define("LANCONTACT_17", "Please enter your name."); define("LANCONTACT_18", "Please enter your e-mail address."); define("LANCONTACT_19", "Please enter the subject for your e-mail."); define("LANCONTACT_20", "Please enter your message for us."); +define("LANCONTACT_21", "I consent to having this website store my submitted information so they can respond to my inquiry"); // By using this form, you agree to the storage and processing of your data through this site."); +define("LANCONTACT_22", "Privacy policy"); +define("LANCONTACT_23", "You can find our privacy policy here: [x]"); +define("LANCONTACT_24", "GDPR Agreement"); From c0557966eca66fd7cbec3636cce0499511f93ceb Mon Sep 17 00:00:00 2001 From: Achim Ennenbach Date: Tue, 28 Aug 2018 10:23:55 +0200 Subject: [PATCH 4/6] Moved new prefs from update_routines.php to default_install.xml --- e107_admin/update_routines.php | 17 ----------------- e107_core/xml/default_install.xml | 2 ++ 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/e107_admin/update_routines.php b/e107_admin/update_routines.php index 6e12cd0b7..190fe0090 100644 --- a/e107_admin/update_routines.php +++ b/e107_admin/update_routines.php @@ -122,8 +122,6 @@ if (!$dont_check_update) $LAN_UPDATE_4 = deftrue('LAN_UPDATE_4',"Update from [x] to [y]"); // in case language-pack hasn't been upgraded. $LAN_UPDATE_5 = deftrue('LAN_UPDATE_5', "Core database structure"); - $dbupdate['219_to_220'] = array('master'=>false, 'title'=> e107::getParser()->lanVars($LAN_UPDATE_4, array('2.1.9','2.2.0')), 'message'=> null, 'hide_when_complete'=>true); - $dbupdate['218_to_219'] = array('master'=>false, 'title'=> e107::getParser()->lanVars($LAN_UPDATE_4, array('2.1.8','2.1.9')), 'message'=> null, 'hide_when_complete'=>true); $dbupdate['217_to_218'] = array('master'=>false, 'title'=> e107::getParser()->lanVars($LAN_UPDATE_4, array('2.1.7','2.1.8')), 'message'=> null, 'hide_when_complete'=>true); @@ -566,21 +564,6 @@ function update_core_database($type = '') } - function update_219_to_220($type='') - { - $sql = e107::getDb(); - $just_check = ($type == 'do') ? false : true; - - // add new pref contact_privacypolicy - if (!e107::getPref('contact_privacypolicy', '')) - { - e107::getConfig()->setPref('contact_privacypolicy', '')->save(false, true); - } - - return $just_check; - } - - function update_218_to_219($type='') { $sql = e107::getDb(); diff --git a/e107_core/xml/default_install.xml b/e107_core/xml/default_install.xml index 72b91c60e..bdfd35b67 100644 --- a/e107_core/xml/default_install.xml +++ b/e107_core/xml/default_install.xml @@ -149,6 +149,8 @@ '', )]]> + + 0 80 /usr/X11R6/bin/ From 72897dcc17768bfbfddc49cd182cf209e6490b8d Mon Sep 17 00:00:00 2001 From: Achim Ennenbach Date: Tue, 28 Aug 2018 12:28:41 +0200 Subject: [PATCH 5/6] Added new pref section GPDR and moved the "privacy policy" pref to this section Added another pref for "terms and conditions" --- e107_admin/prefs.php | 49 +++++++++++++++------- e107_languages/English/admin/lan_prefs.php | 7 +++- 2 files changed, 39 insertions(+), 17 deletions(-) diff --git a/e107_admin/prefs.php b/e107_admin/prefs.php index b55432e19..347268b9a 100644 --- a/e107_admin/prefs.php +++ b/e107_admin/prefs.php @@ -517,14 +517,6 @@ $text .= "
- - - - ".$frm->text('contact_privacypolicy', $pref['contact_privacypolicy'], 200, array('size'=>'xxlarge'))." -
".PRFLAN_278."
- - - @@ -558,6 +550,39 @@ $text .= "
"; +// GDPR Settings ----------------------------- +$text .= " +
+ ".PRFLAN_277." + + + + + + + + + + + + + + + + +
+ ".$frm->text('gdpr_privacypolicy', $pref['gdpr_privacypolicy'], 200, array('size'=>'xxlarge'))." +
".PRFLAN_279."
+
+ ".$frm->text('gdpr_termsandconditions', $pref['gdpr_termsandconditions'], 200, array('size'=>'xxlarge'))." +
".PRFLAN_281."
+
+ ".pref_submit('display')." +
+"; + + + $text .= "
".PRFLAN_13." @@ -1122,13 +1147,6 @@ else } } -// add new pref contact_privacypolicy -if (!isset($pref['contact_privacypolicy'])) -{ - $pref['contact_privacypolicy'] = ''; - $savePrefs = true; -} - if ($savePrefs) $core_pref->setPref($pref)->save(false, true); @@ -2058,6 +2076,7 @@ function prefs_adminmenu() $var['core-prefs-header1']['header'] = LAN_BASIC_OPTIONS; $var['core-prefs-main']['text'] = PRFLAN_1; $var['core-prefs-email']['text'] = PRFLAN_254; + $var['core-prefs-gdpr']['text'] = PRFLAN_277; $var['core-prefs-registration']['text'] = PRFLAN_28; $var['core-prefs-signup']['text'] = PRFLAN_19; // $var['core-prefs-sociallogin']['text'] = "Social Options"; // Moved into plugin. diff --git a/e107_languages/English/admin/lan_prefs.php b/e107_languages/English/admin/lan_prefs.php index e1d92cf8a..9c47d2db0 100644 --- a/e107_languages/English/admin/lan_prefs.php +++ b/e107_languages/English/admin/lan_prefs.php @@ -296,5 +296,8 @@ define("PRFLAN_274", "Contact form will only be visible to this userclass group. define("PRFLAN_275", "View this page using https (SSL) to modify this option"); define("PRFLAN_276", "PHP Default (Preferred)"); -define("PRFLAN_277", "URL to the Privacy Policy"); -define("PRFLAN_278", "Make sure the url exists! It's best to use an absolute url."); +define("PRFLAN_277", "GDPR Settings"); +define("PRFLAN_278", "URL to the Privacy Policy"); +define("PRFLAN_279", "Make sure the url exists! It's best to use an absolute url. This setting will be used on all places that require a consent from the user (e.g. signup, contact form/menu, etc.)."); +define("PRFLAN_280", "URL to the website terms and conditions"); +define("PRFLAN_281", "Make sure the url exists! It's best to use an absolute url. This setting will be used on all places that require a consent from the user (e.g. signup, contact form/menu, etc.)."); From 97aa3fb560b558d05cf7973a3d1a385986dfabdd Mon Sep 17 00:00:00 2001 From: Achim Ennenbach Date: Tue, 28 Aug 2018 12:29:20 +0200 Subject: [PATCH 6/6] adapted shortcode to the new pref name gpdr_privacypolicy --- e107_core/shortcodes/batch/contact_shortcodes.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/e107_core/shortcodes/batch/contact_shortcodes.php b/e107_core/shortcodes/batch/contact_shortcodes.php index 2be64fbbb..f69274360 100644 --- a/e107_core/shortcodes/batch/contact_shortcodes.php +++ b/e107_core/shortcodes/batch/contact_shortcodes.php @@ -177,13 +177,13 @@ class contact_shortcodes extends e_shortcode function sc_contact_gdpr_link($parm='') { - $pp = e107::getPref('contact_privacypolicy', ''); + $pp = e107::getPref('gdpr_privacypolicy', ''); if (!$pp) { return ''; } $class = (!empty($parm['class'])) ? $parm['class'] : ''; - $link = e107::getParser()->lanVars('[z]', array($class, $pp, LANCONTACT_22)); + $link = sprintf('%s', $class, $pp, LANCONTACT_22); $text = e107::getParser()->lanVars(LANCONTACT_23, $link); return $text; }