From c176389f34a5a35da8ee0bae2717e47c15063ebc Mon Sep 17 00:00:00 2001 From: Achim Ennenbach Date: Mon, 27 Aug 2018 20:10:31 +0200 Subject: [PATCH] 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