Checks if there maybe is a typo in property declarations.
1 | <?php |
||
2 | /** |
||
3 | * Delete an invitation to join a group. |
||
4 | * |
||
5 | * @package ElggGroups |
||
6 | */ |
||
7 | |||
8 | $user_guid = (int) get_input('user_guid', elgg_get_logged_in_user_guid()); |
||
9 | $group_guid = (int) get_input('group_guid'); |
||
10 | |||
11 | $user = get_user($user_guid); |
||
12 | |||
13 | // invisible groups require overriding access to delete invite |
||
14 | $old_access = elgg_set_ignore_access(true); |
||
15 | $group = get_entity($group_guid); |
||
16 | elgg_set_ignore_access($old_access); |
||
17 | |||
18 | if (!$user && !($group instanceof \ElggGroup)) { |
||
19 | return elgg_error_response(); |
||
20 | } |
||
21 | |||
22 | // If join request made |
||
23 | $message = ''; |
||
24 | if (remove_entity_relationship($group->guid, 'invited', $user->guid)) { |
||
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
25 | $message = elgg_echo('groups:invitekilled'); |
||
26 | } |
||
27 | |||
28 | return elgg_ok_response('', $message); |
||
29 |