aboutsummaryrefslogtreecommitdiff
path: root/mod/apiadmin/views/default/object
diff options
context:
space:
mode:
Diffstat (limited to 'mod/apiadmin/views/default/object')
-rw-r--r--mod/apiadmin/views/default/object/api_key.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/mod/apiadmin/views/default/object/api_key.php b/mod/apiadmin/views/default/object/api_key.php
new file mode 100644
index 000000000..fdfe9af54
--- /dev/null
+++ b/mod/apiadmin/views/default/object/api_key.php
@@ -0,0 +1,31 @@
+<?php
+ global $CONFIG;
+
+ $entity = $vars['entity'];
+
+ $icon = elgg_view(
+ 'graphics/icon', array(
+ 'entity' => $entity,
+ 'size' => 'small',
+ )
+ );
+
+
+ $public_label = elgg_echo('apiadmin:public');
+ $private_label = elgg_echo('apiadmin:private');
+ $revoke_label = elgg_echo('apiadmin:revoke');
+
+
+ $info = "<div><p><b>{$entity->title}</b> <a href=\"{$CONFIG->url}actions/apiadmin/revokekey?keyid={$entity->guid}\">$revoke_label</a></p></div>";
+ $info .= "<div><p><b>$public_label:</b> {$entity->public}<br />";
+ if (isadminloggedin()) {
+ // Only show secret portion to admins
+
+ // Fetch key
+ $keypair = get_api_user($CONFIG->site_id, $entity->public);
+
+ $info .= "<b>$private_label:</b> {$keypair->secret}</p></div>";
+ }
+
+ echo elgg_view_listing($icon, $info);
+?> \ No newline at end of file