aboutsummaryrefslogtreecommitdiff
path: root/mod/apiadmin/actions/revokekey.php
blob: eeb5dd791f58c5db7fc8b15345c220c9d4bbec2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php

	global $CONFIG;
	
	admin_gatekeeper();
	
	$key = (int)get_input('keyid');
	
	$obj = get_entity($key);
	
	if (($obj) && ($obj instanceof ElggObject) && ($obj->subtype == get_subtype_id('object', 'api_key')))
	{
		if ($obj->delete())
			system_message(elgg_echo('apiadmin:keyrevoked'));
		else
			register_error(elgg_echo('apiadmin:keynotrevoked'));
	}
	else
		register_error(elgg_echo('apiadmin:keynotrevoked'));
		
	forward($_SERVER['HTTP_REFERER']);
?>