aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/upgrades/2010062301.php
blob: 96fd6c8109b356f71f12ae1d9f073c7856f08883 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php

/**
 * Change ownership of group ACLs to group entity
 */

elgg_set_ignore_access(TRUE);

$params = array('type' => 'group',
				'limit' => 0);
$groups = elgg_get_entities($params);
if ($groups) {
	foreach ($groups as $group) {
		$acl = $group->group_acl;

		$query = "UPDATE {$CONFIG->dbprefix}access_collections SET owner_guid = $group->guid WHERE id = $acl";
		update_data($query);
	}
}
elgg_set_ignore_access(FALSE);