diff --git a/public_html/admin/install/classes/installer.class.php b/public_html/admin/install/classes/installer.class.php index adada994d..f32a1510f 100644 --- a/public_html/admin/install/classes/installer.class.php +++ b/public_html/admin/install/classes/installer.class.php @@ -2923,8 +2923,15 @@ private function doDatabaseUpgrades($currentGlVersion, $checkForMessage = false) break; case '2.2.0': - // there were no database changes in 2.2.0 - + require_once $_CONF['path'] . 'sql/updates/' . $_DB_dbms . '_2.2.0_to_2.2.1.php'; + if ($checkForMessage) { + $retval = upgrade_message220(); + if (is_array($retval)) { + $this->upgradeMessages = array_merge($this->upgradeMessages, $retval); + } + } else { + $this->updateDB($_SQL, $progress); + } $currentGlVersion = '2.2.1'; break; diff --git a/public_html/admin/install/devel-db-update.php b/public_html/admin/install/devel-db-update.php index 405ca19de..dd367a05a 100644 --- a/public_html/admin/install/devel-db-update.php +++ b/public_html/admin/install/devel-db-update.php @@ -61,6 +61,74 @@ exit; } +function update_DatabaseFor221() +{ + global $_TABLES, $_CONF, $_PLUGINS, $use_innodb, $_DB_table_prefix, $gl_devel_version; + + // *************************************** + // Add database Geeklog Core updates here. + // NOTE: Cannot use ones found in normal upgrade script as no checks are performed to see if already done. + + // ************************************* + // Fix Group Assignments from Geeklog Install + + // Remove Admin User (2) from all default groups assignments from the install except Root (1), All Users (2), Logged-In Users (13) + $_SQL[] = "DELETE FROM {$_TABLES['group_assignments']} WHERE (ug_main_grp_id != 1 AND ug_main_grp_id != 2 AND ug_main_grp_id != 13) AND ug_uid = 2 AND ug_grp_id IS NULL"; + + // Remove All Users (2) from any other group (should be just for users) + $_SQL[] = "DELETE FROM {$_TABLES['group_assignments']} WHERE ug_main_grp_id = 2 AND ug_uid IS NULL AND ug_grp_id > 0"; + // Remove Root Group (1) from All Users Group (2) (which all users already belong too) + $_SQL[] = "DELETE FROM {$_TABLES['group_assignments']} WHERE ug_main_grp_id = 2 AND ug_uid IS NULL AND ug_grp_id = 1"; + // ************************************* + + // Remove unused Vars table record (originally inserted by devel-db-update script on previous version upgrades) + $_SQL[] = "DELETE FROM {$_TABLES['vars']} WHERE name = 'geeklog'"; + + + // *************************************** + // Core Plugin Updates Here + + // Staticpages + //$_SQL[] = "UPDATE {$_TABLES['plugins']} SET pi_version='1.7.0', pi_gl_version='". VERSION ."' WHERE pi_name='staticpages'"; + + + // SpamX + //$_SQL[] = "UPDATE {$_TABLES['plugins']} SET pi_version='1.3.5' WHERE pi_name='spamx'"; + + + // Links + //$_SQL[] = "UPDATE {$_TABLES['plugins']} SET pi_version='2.1.6' WHERE pi_name='links'"; + + + // Polls + //$_SQL[] = "UPDATE {$_TABLES['plugins']} SET pi_version='2.1.9' WHERE pi_name='polls'"; + + // XMLSiteMap + //$_SQL[] = "UPDATE {$_TABLES['plugins']} SET pi_version='2.0.1', pi_gl_version='". VERSION ."', pi_homepage='https://www.geeklog.net' WHERE pi_name='xmlsitemap'"; + + // Calendar + //$_SQL[] = "UPDATE {$_TABLES['plugins']} SET pi_version='1.1.6', pi_gl_version='". VERSION ."', pi_homepage='https://www.geeklog.net' WHERE pi_name='calendar'"; + + + + if ($use_innodb) { + $statements = count($_SQL); + for ($i = 0; $i < $statements; $i++) { + $_SQL[$i] = str_replace('MyISAM', 'InnoDB', $_SQL[$i]); + } + } + + foreach ($_SQL as $sql) { + DB_query($sql,1); + } + + // update Geeklog version number + DB_query("INSERT INTO {$_TABLES['vars']} SET value='$gl_devel_version',name='database_version'",1); + DB_query("UPDATE {$_TABLES['vars']} SET value='$gl_devel_version' WHERE name='database_version'",1); + + return true; +} + function update_DatabaseFor220() { global $_TABLES, $_CONF, $_PLUGINS, $use_innodb, $_DB_table_prefix, $gl_devel_version; diff --git a/public_html/admin/install/language/chinese_simplified_utf-8.php b/public_html/admin/install/language/chinese_simplified_utf-8.php index 4e050faca..da4873d62 100644 --- a/public_html/admin/install/language/chinese_simplified_utf-8.php +++ b/public_html/admin/install/language/chinese_simplified_utf-8.php @@ -343,7 +343,9 @@ 18 => 'Comment Signatures', 19 => "Comment Signatures before Geeklog 2.2.0 where stored with the comment. Now they are added when the comment is viewed. For backwards compatibility the upgrade will remove all comment signatures stored directly\n with the comment (so comment signatures will not display twice).", 20 => 'Plugin Compatibility', - 21 => 'Geeklog internally has undergone some changes which may affect compatibility of some older plugins which have not been updated in a while. Please make sure all the plugins you have installed have been updated to the latest version before upgrading Geeklog to v2.2.0.

If you still wish to upgrade Geeklog to v2.2.0 and you are not sure about a plugin please post a question about it on our Geeklog Forum. Else, you can also disable or uninstall the plugin and then perform the Geeklog upgrade.

If you do perform the upgrade and run into problems you can then use the Geeklog Emergency Rescue Tool to disable the plugin with the issue.' + 21 => 'Geeklog internally has undergone some changes which may affect compatibility of some older plugins which have not been updated in a while. Please make sure all the plugins you have installed have been updated to the latest version before upgrading Geeklog to v2.2.0.

If you still wish to upgrade Geeklog to v2.2.0 and you are not sure about a plugin please post a question about it on our Geeklog Forum. Else, you can also disable or uninstall the plugin and then perform the Geeklog upgrade.

If you do perform the upgrade and run into problems you can then use the Geeklog Emergency Rescue Tool to disable the plugin with the issue.', + 22 => 'Default Security Group Assignments', + 23 => 'User security group assignments for groups "Root" and "All Users" will be fixed along with the security group assignments for the "Admin" (2) user. The "Admin" user had duplicate permissions in some cases and these will be removed after this upgrade.' ); // +---------------------------------------------------------------------------+ diff --git a/public_html/admin/install/language/chinese_traditional_utf-8.php b/public_html/admin/install/language/chinese_traditional_utf-8.php index 2c98a21b1..dc1907676 100644 --- a/public_html/admin/install/language/chinese_traditional_utf-8.php +++ b/public_html/admin/install/language/chinese_traditional_utf-8.php @@ -343,7 +343,9 @@ 18 => 'Comment Signatures', 19 => "Comment Signatures before Geeklog 2.2.0 where stored with the comment. Now they are added when the comment is viewed. For backwards compatibility the upgrade will remove all comment signatures stored directly\n with the comment (so comment signatures will not display twice).", 20 => 'Plugin Compatibility', - 21 => 'Geeklog internally has undergone some changes which may affect compatibility of some older plugins which have not been updated in a while. Please make sure all the plugins you have installed have been updated to the latest version before upgrading Geeklog to v2.2.0.

If you still wish to upgrade Geeklog to v2.2.0 and you are not sure about a plugin please post a question about it on our Geeklog Forum. Else, you can also disable or uninstall the plugin and then perform the Geeklog upgrade.

If you do perform the upgrade and run into problems you can then use the Geeklog Emergency Rescue Tool to disable the plugin with the issue.' + 21 => 'Geeklog internally has undergone some changes which may affect compatibility of some older plugins which have not been updated in a while. Please make sure all the plugins you have installed have been updated to the latest version before upgrading Geeklog to v2.2.0.

If you still wish to upgrade Geeklog to v2.2.0 and you are not sure about a plugin please post a question about it on our Geeklog Forum. Else, you can also disable or uninstall the plugin and then perform the Geeklog upgrade.

If you do perform the upgrade and run into problems you can then use the Geeklog Emergency Rescue Tool to disable the plugin with the issue.', + 22 => 'Default Security Group Assignments', + 23 => 'User security group assignments for groups "Root" and "All Users" will be fixed along with the security group assignments for the "Admin" (2) user. The "Admin" user had duplicate permissions in some cases and these will be removed after this upgrade.' ); // +---------------------------------------------------------------------------+ diff --git a/public_html/admin/install/language/english.php b/public_html/admin/install/language/english.php index ad667350f..e75e432b5 100644 --- a/public_html/admin/install/language/english.php +++ b/public_html/admin/install/language/english.php @@ -343,7 +343,9 @@ 19 => 'Comment Signatures before Geeklog 2.2.0 where stored with the comment. Now they are added when the comment is viewed. For backwards compatibility the upgrade will remove all comment signatures stored directly with the comment (so comment signatures will not display twice).', 20 => 'Plugin Compatibility', - 21 => 'Geeklog internally has undergone some changes which may affect compatibility of some older plugins which have not been updated in a while. Please make sure all the plugins you have installed have been updated to the latest version before upgrading Geeklog to v2.2.0.

If you still wish to upgrade Geeklog to v2.2.0 and you are not sure about a plugin please post a question about it on our Geeklog Forum. Else, you can also disable or uninstall the plugin and then perform the Geeklog upgrade.

If you do perform the upgrade and run into problems you can then use the Geeklog Emergency Rescue Tool to disable the plugin with the issue.' + 21 => 'Geeklog internally has undergone some changes which may affect compatibility of some older plugins which have not been updated in a while. Please make sure all the plugins you have installed have been updated to the latest version before upgrading Geeklog to v2.2.0.

If you still wish to upgrade Geeklog to v2.2.0 and you are not sure about a plugin please post a question about it on our Geeklog Forum. Else, you can also disable or uninstall the plugin and then perform the Geeklog upgrade.

If you do perform the upgrade and run into problems you can then use the Geeklog Emergency Rescue Tool to disable the plugin with the issue.', + 22 => 'Default Security Group Assignments', + 23 => 'User security group assignments for groups "Root" and "All Users" will be fixed along with the security group assignments for the "Admin" (2) user. The "Admin" user had duplicate permissions in some cases and these will be removed after this upgrade.' ); // +---------------------------------------------------------------------------+ diff --git a/public_html/admin/install/language/german.php b/public_html/admin/install/language/german.php index 72537f489..db67403f7 100644 --- a/public_html/admin/install/language/german.php +++ b/public_html/admin/install/language/german.php @@ -342,7 +342,9 @@ 18 => 'Comment Signatures', 19 => "Comment Signatures before Geeklog 2.2.0 where stored with the comment. Now they are added when the comment is viewed. For backwards compatibility the upgrade will remove all comment signatures stored directly\n with the comment (so comment signatures will not display twice).", 20 => 'Plugin Compatibility', - 21 => 'Geeklog internally has undergone some changes which may affect compatibility of some older plugins which have not been updated in a while. Please make sure all the plugins you have installed have been updated to the latest version before upgrading Geeklog to v2.2.0.

If you still wish to upgrade Geeklog to v2.2.0 and you are not sure about a plugin please post a question about it on our Geeklog Forum. Else, you can also disable or uninstall the plugin and then perform the Geeklog upgrade.

If you do perform the upgrade and run into problems you can then use the Geeklog Emergency Rescue Tool to disable the plugin with the issue.' + 21 => 'Geeklog internally has undergone some changes which may affect compatibility of some older plugins which have not been updated in a while. Please make sure all the plugins you have installed have been updated to the latest version before upgrading Geeklog to v2.2.0.

If you still wish to upgrade Geeklog to v2.2.0 and you are not sure about a plugin please post a question about it on our Geeklog Forum. Else, you can also disable or uninstall the plugin and then perform the Geeklog upgrade.

If you do perform the upgrade and run into problems you can then use the Geeklog Emergency Rescue Tool to disable the plugin with the issue.', + 22 => 'Default Security Group Assignments', + 23 => 'User security group assignments for groups "Root" and "All Users" will be fixed along with the security group assignments for the "Admin" (2) user. The "Admin" user had duplicate permissions in some cases and these will be removed after this upgrade.' ); // +---------------------------------------------------------------------------+ diff --git a/public_html/admin/install/language/hebrew_utf-8.php b/public_html/admin/install/language/hebrew_utf-8.php index a2f50fcc0..414167c17 100644 --- a/public_html/admin/install/language/hebrew_utf-8.php +++ b/public_html/admin/install/language/hebrew_utf-8.php @@ -337,7 +337,9 @@ 18 => 'Comment Signatures', 19 => "Comment Signatures before Geeklog 2.2.0 where stored with the comment. Now they are added when the comment is viewed. For backwards compatibility the upgrade will remove all comment signatures stored directly\n with the comment (so comment signatures will not display twice).", 20 => 'Plugin Compatibility', - 21 => 'Geeklog internally has undergone some changes which may affect compatibility of some older plugins which have not been updated in a while. Please make sure all the plugins you have installed have been updated to the latest version before upgrading Geeklog to v2.2.0.

If you still wish to upgrade Geeklog to v2.2.0 and you are not sure about a plugin please post a question about it on our Geeklog Forum. Else, you can also disable or uninstall the plugin and then perform the Geeklog upgrade.

If you do perform the upgrade and run into problems you can then use the Geeklog Emergency Rescue Tool to disable the plugin with the issue.' + 21 => 'Geeklog internally has undergone some changes which may affect compatibility of some older plugins which have not been updated in a while. Please make sure all the plugins you have installed have been updated to the latest version before upgrading Geeklog to v2.2.0.

If you still wish to upgrade Geeklog to v2.2.0 and you are not sure about a plugin please post a question about it on our Geeklog Forum. Else, you can also disable or uninstall the plugin and then perform the Geeklog upgrade.

If you do perform the upgrade and run into problems you can then use the Geeklog Emergency Rescue Tool to disable the plugin with the issue.', + 22 => 'Default Security Group Assignments', + 23 => 'User security group assignments for groups "Root" and "All Users" will be fixed along with the security group assignments for the "Admin" (2) user. The "Admin" user had duplicate permissions in some cases and these will be removed after this upgrade.' ); // +---------------------------------------------------------------------------+ diff --git a/public_html/admin/install/language/japanese_utf-8.php b/public_html/admin/install/language/japanese_utf-8.php index d03eee9f4..f4ba8ce1b 100644 --- a/public_html/admin/install/language/japanese_utf-8.php +++ b/public_html/admin/install/language/japanese_utf-8.php @@ -344,7 +344,9 @@ 18 => 'Comment Signatures', 19 => "Comment Signatures before Geeklog 2.2.0 where stored with the comment. Now they are added when the comment is viewed. For backwards compatibility the upgrade will remove all comment signatures stored directly\n with the comment (so comment signatures will not display twice).", 20 => 'Plugin Compatibility', - 21 => 'Geeklog internally has undergone some changes which may affect compatibility of some older plugins which have not been updated in a while. Please make sure all the plugins you have installed have been updated to the latest version before upgrading Geeklog to v2.2.0.

If you still wish to upgrade Geeklog to v2.2.0 and you are not sure about a plugin please post a question about it on our Geeklog Forum. Else, you can also disable or uninstall the plugin and then perform the Geeklog upgrade.

If you do perform the upgrade and run into problems you can then use the Geeklog Emergency Rescue Tool to disable the plugin with the issue.' + 21 => 'Geeklog internally has undergone some changes which may affect compatibility of some older plugins which have not been updated in a while. Please make sure all the plugins you have installed have been updated to the latest version before upgrading Geeklog to v2.2.0.

If you still wish to upgrade Geeklog to v2.2.0 and you are not sure about a plugin please post a question about it on our Geeklog Forum. Else, you can also disable or uninstall the plugin and then perform the Geeklog upgrade.

If you do perform the upgrade and run into problems you can then use the Geeklog Emergency Rescue Tool to disable the plugin with the issue.', + 22 => 'Default Security Group Assignments', + 23 => 'User security group assignments for groups "Root" and "All Users" will be fixed along with the security group assignments for the "Admin" (2) user. The "Admin" user had duplicate permissions in some cases and these will be removed after this upgrade.' ); // +---------------------------------------------------------------------------+ diff --git a/public_html/admin/install/language/polish.php b/public_html/admin/install/language/polish.php index 97bcd1248..1bd5de6ec 100644 --- a/public_html/admin/install/language/polish.php +++ b/public_html/admin/install/language/polish.php @@ -342,7 +342,9 @@ 18 => 'Comment Signatures', 19 => "Comment Signatures before Geeklog 2.2.0 where stored with the comment. Now they are added when the comment is viewed. For backwards compatibility the upgrade will remove all comment signatures stored directly\n with the comment (so comment signatures will not display twice).", 20 => 'Plugin Compatibility', - 21 => 'Geeklog internally has undergone some changes which may affect compatibility of some older plugins which have not been updated in a while. Please make sure all the plugins you have installed have been updated to the latest version before upgrading Geeklog to v2.2.0.

If you still wish to upgrade Geeklog to v2.2.0 and you are not sure about a plugin please post a question about it on our Geeklog Forum. Else, you can also disable or uninstall the plugin and then perform the Geeklog upgrade.

If you do perform the upgrade and run into problems you can then use the Geeklog Emergency Rescue Tool to disable the plugin with the issue.' + 21 => 'Geeklog internally has undergone some changes which may affect compatibility of some older plugins which have not been updated in a while. Please make sure all the plugins you have installed have been updated to the latest version before upgrading Geeklog to v2.2.0.

If you still wish to upgrade Geeklog to v2.2.0 and you are not sure about a plugin please post a question about it on our Geeklog Forum. Else, you can also disable or uninstall the plugin and then perform the Geeklog upgrade.

If you do perform the upgrade and run into problems you can then use the Geeklog Emergency Rescue Tool to disable the plugin with the issue.', + 22 => 'Default Security Group Assignments', + 23 => 'User security group assignments for groups "Root" and "All Users" will be fixed along with the security group assignments for the "Admin" (2) user. The "Admin" user had duplicate permissions in some cases and these will be removed after this upgrade.' ); // +---------------------------------------------------------------------------+ diff --git a/sql/mysql_tableanddata.php b/sql/mysql_tableanddata.php index 1dfe59433..9040af5f1 100644 --- a/sql/mysql_tableanddata.php +++ b/sql/mysql_tableanddata.php @@ -709,35 +709,26 @@ $_DATA[] = "INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (68, 'language.edit', 'Can manage Language Settings', 1)"; $_DATA[] = "INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (69, 'theme.edit', 'Can manage Theme Settings', 1)"; +// Anonymous User (1) and Admin User (2) belongs to All Users (2) $_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (2,1,NULL) "; -$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (2,NULL,1) "; +$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (2,2,NULL) "; +// Admin User (2) belongs to Logged-in Users (13) +$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (13,2,NULL) "; +// Admin User (2) belongs to everything so assign to Root Group (1) +$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (1,2,NULL) "; +// User Admin Group (9) belongs to Group Admin Group (11) +$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (9,NULL,11) "; +// Root Group Assignments - Belongs to every group except itself (1), All Users (2), Remote Users (7) +// Remember any NEW GROUPS needs to be added to Root Group $_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (3,NULL,1) "; $_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (4,NULL,1) "; +$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (5,NULL,1) "; $_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (6,NULL,1) "; +$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (8,NULL,1) "; $_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (9,NULL,1) "; $_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (10,NULL,1) "; $_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (11,NULL,1) "; -$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (13,2,NULL) "; -$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (12,2,NULL) "; -$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (11,2,NULL) "; -$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (2,NULL,12) "; -$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (2,NULL,10) "; -$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (2,NULL,9) "; -$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (2,NULL,6) "; -$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (2,NULL,4) "; -$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (2,NULL,3) "; $_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (12,NULL,1) "; -$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (9,NULL,11) "; -$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (2,NULL,11) "; -$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (10,2,NULL) "; -$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (9,2,NULL) "; -$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (6,2,NULL) "; -$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (4,2,NULL) "; -$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (3,2,NULL) "; -$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (2,2,NULL) "; -$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (1,2,NULL) "; -$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (5,NULL,1) "; -$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (8,NULL,1) "; $_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (14,NULL,1) "; $_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (15,NULL,1) "; $_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (16,NULL,1) "; diff --git a/sql/pgsql_tableanddata.php b/sql/pgsql_tableanddata.php index 8f6bba72d..c65ce416f 100644 --- a/sql/pgsql_tableanddata.php +++ b/sql/pgsql_tableanddata.php @@ -728,35 +728,26 @@ $_DATA[] = "INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES ((SELECT nextval('{$_TABLES['features']}_ft_id_seq')), 'language.edit', 'Can manage Language Settings', 1)"; $_DATA[] = "INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES ((SELECT nextval('{$_TABLES['features']}_ft_id_seq')), 'theme.edit', 'Can manage Theme Settings', 1)"; +// Anonymous User (1) and Admin User (2) belongs to All Users (2) $_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (2,1,NULL) "; -$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (2,NULL,1) "; +$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (2,2,NULL) "; +// Admin User (2) belongs to Logged-in Users (13) +$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (13,2,NULL) "; +// Admin User (2) belongs to everything so assign to Root Group (1) +$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (1,2,NULL) "; +// User Admin Group (9) belongs to Group Admin Group (11) +$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (9,NULL,11) "; +// Root Group Assignments - Belongs to every group except itself (1), All Users (2), Remote Users (7) +// Remember any NEW GROUPS needs to be added to Root Group $_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (3,NULL,1) "; $_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (4,NULL,1) "; +$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (5,NULL,1) "; $_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (6,NULL,1) "; +$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (8,NULL,1) "; $_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (9,NULL,1) "; $_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (10,NULL,1) "; $_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (11,NULL,1) "; -$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (13,2,NULL) "; -$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (12,2,NULL) "; -$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (11,2,NULL) "; -$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (2,NULL,12) "; -$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (2,NULL,10) "; -$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (2,NULL,9) "; -$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (2,NULL,6) "; -$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (2,NULL,4) "; -$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (2,NULL,3) "; $_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (12,NULL,1) "; -$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (9,NULL,11) "; -$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (2,NULL,11) "; -$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (10,2,NULL) "; -$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (9,2,NULL) "; -$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (6,2,NULL) "; -$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (4,2,NULL) "; -$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (3,2,NULL) "; -$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (2,2,NULL) "; -$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (1,2,NULL) "; -$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (5,NULL,1) "; -$_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (8,NULL,1) "; $_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (14,NULL,1) "; $_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (15,NULL,1) "; $_DATA[] = "INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES (16,NULL,1) "; diff --git a/sql/updates/mysql_2.2.0_to_2.2.1.php b/sql/updates/mysql_2.2.0_to_2.2.1.php new file mode 100644 index 000000000..587a89462 --- /dev/null +++ b/sql/updates/mysql_2.2.0_to_2.2.1.php @@ -0,0 +1,34 @@ + 0"; +// Remove Root Group (1) from All Users Group (2) (which all users already belong too) +$_SQL[] = "DELETE FROM {$_TABLES['group_assignments']} WHERE ug_main_grp_id = 2 AND ug_uid IS NULL AND ug_grp_id = 1"; +// ************************************* + +// Remove unused Vars table record (originally inserted by devel-db-update script) +$_SQL[] = "DELETE FROM {$_TABLES['vars']} WHERE name = 'geeklog'"; + + +/** + * Upgrade Messages + */ +function upgrade_message220() +{ + // 3 upgrade message types exist 'information', 'warning', 'error' + // error type means the user cannot continue upgrade until fixed + + // Fix User Security Group assignments for Groups: Root, Admin, All Users + // Fix User Security Group assignments for Users: Admin + $upgradeMessages['2.2.0'] = array( + 1 => array('warning', 22, 23), // Comment signatures will be removed from old comments + ); + + return $upgradeMessages; +} diff --git a/sql/updates/pgsql_2.2.0_to_2.2.1.php b/sql/updates/pgsql_2.2.0_to_2.2.1.php new file mode 100644 index 000000000..587a89462 --- /dev/null +++ b/sql/updates/pgsql_2.2.0_to_2.2.1.php @@ -0,0 +1,34 @@ + 0"; +// Remove Root Group (1) from All Users Group (2) (which all users already belong too) +$_SQL[] = "DELETE FROM {$_TABLES['group_assignments']} WHERE ug_main_grp_id = 2 AND ug_uid IS NULL AND ug_grp_id = 1"; +// ************************************* + +// Remove unused Vars table record (originally inserted by devel-db-update script) +$_SQL[] = "DELETE FROM {$_TABLES['vars']} WHERE name = 'geeklog'"; + + +/** + * Upgrade Messages + */ +function upgrade_message220() +{ + // 3 upgrade message types exist 'information', 'warning', 'error' + // error type means the user cannot continue upgrade until fixed + + // Fix User Security Group assignments for Groups: Root, Admin, All Users + // Fix User Security Group assignments for Users: Admin + $upgradeMessages['2.2.0'] = array( + 1 => array('warning', 22, 23), // Comment signatures will be removed from old comments + ); + + return $upgradeMessages; +}