diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-12-03 15:43:36 -0500 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-12-03 15:43:36 -0500 |
commit | b8f7532e5c7e8b8be3ab199fca3dadd0d22be4cd (patch) | |
tree | 435eb1e72df595875547547f939493a6a6b7c512 /app/Template | |
parent | 23d862aef8891130bc7eaeaa25513a9895b44c95 (diff) |
Add personal API access token
Diffstat (limited to 'app/Template')
-rw-r--r-- | app/Template/user_api_access/show.php | 17 | ||||
-rw-r--r-- | app/Template/user_view/sidebar.php | 5 |
2 files changed, 22 insertions, 0 deletions
diff --git a/app/Template/user_api_access/show.php b/app/Template/user_api_access/show.php new file mode 100644 index 00000000..3d58e0d5 --- /dev/null +++ b/app/Template/user_api_access/show.php @@ -0,0 +1,17 @@ +<div class="page-header"> + <h2><?= t('API User Access') ?></h2> +</div> + +<p class="alert"> + <?php if (empty($user['api_access_token'])): ?> + <?= t('No personal API access token registered.') ?> + <?php else: ?> + <?= t('Your personal API access token is "%s"', $user['api_access_token']) ?> + <?php endif ?> +</p> + +<?php if (! empty($user['api_access_token'])): ?> + <?= $this->url->link(t('Remove your token'), 'UserApiAccessController', 'remove', array('user_id' => $user['id']), true, 'btn btn-red') ?> +<?php endif ?> + +<?= $this->url->link(t('Generate a new token'), 'UserApiAccessController', 'generate', array('user_id' => $user['id']), true, 'btn btn-blue') ?> diff --git a/app/Template/user_view/sidebar.php b/app/Template/user_view/sidebar.php index a80daefa..ef494e42 100644 --- a/app/Template/user_view/sidebar.php +++ b/app/Template/user_view/sidebar.php @@ -90,6 +90,11 @@ <?= $this->url->link(t('Integrations'), 'UserViewController', 'integrations', array('user_id' => $user['id'])) ?> </li> <?php endif ?> + <?php if ($this->user->hasAccess('UserApiAccessController', 'show')): ?> + <li <?= $this->app->checkMenuSelection('UserApiAccessController', 'show') ?>> + <?= $this->url->link(t('API'), 'UserApiAccessController', 'show', array('user_id' => $user['id'])) ?> + </li> + <?php endif ?> <?php endif ?> <?php if ($this->user->hasAccess('UserCredentialController', 'changeAuthentication')): ?> |