2011021800-1.8_svn-goodbye_walled_garden-083121a656d06894.php 931 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. * Elgg 1.8-svn upgrade 2011021800
  4. * goodbye_walled_garden
  5. *
  6. * Removes the Walled Garden plugin in favor of new system settings
  7. */
  8. global $CONFIG;
  9. $access = elgg_set_ignore_access(TRUE);
  10. if (elgg_is_active_plugin('walledgarden')) {
  11. disable_plugin('walledgarden');
  12. set_config('allow_registration', FALSE);
  13. set_config('walled_garden', TRUE);
  14. } else {
  15. set_config('allow_registration', TRUE);
  16. set_config('walled_garden', FALSE);
  17. }
  18. // this was for people who manually set the config option
  19. $disable_registration = elgg_get_config('disable_registration');
  20. if ($disable_registration !== null) {
  21. $allow_registration = !$disable_registration;
  22. elgg_save_config('allow_registration', $allow_registration);
  23. $site = elgg_get_site_entity();
  24. $query = "DELETE FROM {$CONFIG->dbprefix}config
  25. WHERE name = 'disable_registration' AND site_guid = $site->guid";
  26. delete_data($query);
  27. }
  28. elgg_set_ignore_access($access);