aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/api.php
diff options
context:
space:
mode:
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-09-24 14:02:25 +0000
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-09-24 14:02:25 +0000
commit40108e73df02d828d85cf4c90202277e400f550b (patch)
tree7ec81b73f0da121a6c5403952f266f7cf728cd68 /engine/lib/api.php
parent086c820cdcab834fe252ff2e76fa84afd491a3f2 (diff)
downloadelgg-40108e73df02d828d85cf4c90202277e400f550b.tar.gz
elgg-40108e73df02d828d85cf4c90202277e400f550b.tar.bz2
Added remove_api_user function
git-svn-id: https://code.elgg.org/elgg/trunk@2111 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/api.php')
-rw-r--r--engine/lib/api.php19
1 files changed, 18 insertions, 1 deletions
diff --git a/engine/lib/api.php b/engine/lib/api.php
index 3b84e9341..ac4e5edbd 100644
--- a/engine/lib/api.php
+++ b/engine/lib/api.php
@@ -647,7 +647,7 @@
}
/**
- * Find an API User's details based on the provided public api key.
+ * Find an API User's details based on the provided public api key. These users are not users in the traditional sense.
*
* @param int $site_guid The GUID of the site.
* @param string $api_key The API Key
@@ -664,6 +664,23 @@
}
/**
+ * Revoke an api user key.
+ *
+ * @param int $site_guid The GUID of the site.
+ * @param string $api_key The API Key (public).
+ */
+ function remove_api_user($site_guid, $api_key)
+ {
+ global $CONFIG;
+
+ $keypair = get_api_user($site_guid, $api_key);
+ if ($keypair)
+ return delete_data("DELETE from {$CONFIG->dbprefix}api_users where id={$keypair->id}");
+
+ return false;
+ }
+
+ /**
* This function looks at the super-global variable $_SERVER and extracts the various
* header variables needed to pass to the validation functions after performing basic validation.
*