diff options
author | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-09-24 15:09:49 +0000 |
---|---|---|
committer | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-09-24 15:09:49 +0000 |
commit | 0bf17c03c2de8423045bf59b83d1e6d12ed7ca42 (patch) | |
tree | c0e2b9a30e617d92392974139c605f5cde931fc6 /mod/apiadmin/views/default | |
parent | 745cdb1c22401bd62cf8e3d9754bcaceab2617f3 (diff) | |
download | elgg-0bf17c03c2de8423045bf59b83d1e6d12ed7ca42.tar.gz elgg-0bf17c03c2de8423045bf59b83d1e6d12ed7ca42.tar.bz2 |
Introducing API key administration panel
git-svn-id: https://code.elgg.org/elgg/trunk@2114 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/apiadmin/views/default')
-rw-r--r-- | mod/apiadmin/views/default/apiadmin/forms/add_key.php | 13 | ||||
-rw-r--r-- | mod/apiadmin/views/default/object/api_key.php | 31 |
2 files changed, 44 insertions, 0 deletions
diff --git a/mod/apiadmin/views/default/apiadmin/forms/add_key.php b/mod/apiadmin/views/default/apiadmin/forms/add_key.php new file mode 100644 index 000000000..d45ab64c1 --- /dev/null +++ b/mod/apiadmin/views/default/apiadmin/forms/add_key.php @@ -0,0 +1,13 @@ +<?php + $ref_label = elgg_echo('apiadmin:yourref'); + $ref_control = elgg_view('input/text', array('internalname' => 'ref')); + $gen_control = elgg_view('input/submit', array('value' => elgg_echo('apiadmin:generate'))); + + $form_body = <<< END + <div> + <p>$ref_label: $ref_control $gen_control</p> + </div> +END; + + echo elgg_view('input/form', array('action' => "{$vars['url']}actions/apiadmin/generate", "body" => $form_body)); +?>
\ No newline at end of file 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 |