aboutsummaryrefslogtreecommitdiff
path: root/mod/apiadmin/actions/revokekey.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/apiadmin/actions/revokekey.php')
-rw-r--r--mod/apiadmin/actions/revokekey.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/mod/apiadmin/actions/revokekey.php b/mod/apiadmin/actions/revokekey.php
new file mode 100644
index 000000000..eeb5dd791
--- /dev/null
+++ b/mod/apiadmin/actions/revokekey.php
@@ -0,0 +1,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']);
+?> \ No newline at end of file