<?php /** * Elgg friends: delete collection action * * @package Elgg.Core * @subpackage Friends.Collections */ $collection_id = (int) get_input('collection'); // check the ACL exists and we can edit if (!can_edit_access_collection($collection_id)) { register_error(elgg_echo("friends:collectiondeletefailed")); forward(REFERER); } if (delete_access_collection($collection_id)) { system_message(elgg_echo("friends:collectiondeleted")); } else { register_error(elgg_echo("friends:collectiondeletefailed")); } forward(REFERER);
public function testJoinLeaveGroupACL() { if (!elgg_is_active_plugin('groups')) { return; } $group = new ElggGroup(); $group->name = 'Test group'; $group->save(); $result = $group->join($this->user); $this->assertTrue($result); // disable security since we run as admin $ia = elgg_set_ignore_access(false); // need to set the page owner to emulate being in a group context. // this is kinda hacky. elgg_set_page_owner_guid($group->getGUID()); if ($result) { $can_edit = can_edit_access_collection($group->group_acl, $this->user->guid); $this->assertTrue($can_edit); } $result = $group->leave($this->user); $this->assertTrue($result); if ($result) { $can_edit = can_edit_access_collection($group->group_acl, $this->user->guid); $this->assertFalse($can_edit); } elgg_set_ignore_access($ia); $group->delete(); }