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

	global $CONFIG;
	
	admin_gatekeeper();
	action_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']);
?>