aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/upgrades/2010050701.php
blob: e327abdde1e01fa7d80b062e357d35abd91af6a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
/**
 * Removes the Walled Garden plugin in favor of new system settings
 */

$access = elgg_set_ignore_access(TRUE);

if (elgg_is_active_plugin('walledgarden')) {
	disable_plugin('walledgarden');
	set_config('allow_registration', FALSE);
	set_config('walled_garden', TRUE);
} else {
	set_config('allow_registration', TRUE);
	set_config('walled_garden', FALSE);
}

$disable_registration = elgg_get_config('disable_registration');
$allow_registration = !$disable_registration;
elgg_save_config('allow_registration', $allow_registration);

elgg_set_ignore_access($access);