aboutsummaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2019-12-03 23:11:06 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2019-12-03 23:11:06 +0100
commitd0f1f9f141a58e090d210c221a7c1745378b96a3 (patch)
tree5d538ee048a14d29f8091d9e85cf391ada48ae83 /app/views
parent15b8ef8f40f249ace343696df216f2d61f8249d0 (diff)
Separate the update API password endpoint (#2675)
* Extract hashPassword method from userController * Extract and refactor fever key-related methods * Move update of API password to dedicated action * Simplify the controller by refactoring feverUtil * Add locales
Diffstat (limited to 'app/views')
-rw-r--r--app/views/user/profile.phtml37
1 files changed, 24 insertions, 13 deletions
diff --git a/app/views/user/profile.phtml b/app/views/user/profile.phtml
index b8bb5cee9..5357c2bfd 100644
--- a/app/views/user/profile.phtml
+++ b/app/views/user/profile.phtml
@@ -48,19 +48,6 @@
</div>
</div>
- <?php if (FreshRSS_Context::$system_conf->api_enabled) { ?>
- <div class="form-group">
- <label class="group-name" for="apiPasswordPlain"><?= _t('conf.profile.password_api') ?></label>
- <div class="group-controls">
- <div class="stick">
- <input type="password" id="apiPasswordPlain" name="apiPasswordPlain" autocomplete="new-password" pattern=".{7,}" <?= cryptAvailable() ? '' : 'disabled="disabled" ' ?>/>
- <a class="btn toggle-password" data-toggle="apiPasswordPlain"><?= _i('key') ?></a>
- </div>
- <?= _i('help') ?> <kbd><a href="../api/"><?= Minz_Url::display('/api/', 'html', true) ?></a></kbd>
- </div>
- </div>
- <?php } ?>
-
<?php if (FreshRSS_Auth::accessNeedsAction()) { ?>
<div class="form-group">
<label class="group-name" for="token"><?= _t('admin.auth.token') ?></label>
@@ -82,6 +69,30 @@
</div>
</form>
+ <?php if (FreshRSS_Context::$system_conf->api_enabled) { ?>
+ <form method="post" action="<?= _url('api', 'updatePassword') ?>">
+ <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
+ <legend><?= _t('conf.profile.api') ?></legend>
+
+ <div class="form-group">
+ <label class="group-name" for="apiPasswordPlain"><?= _t('conf.profile.password_api') ?></label>
+ <div class="group-controls">
+ <div class="stick">
+ <input type="password" id="apiPasswordPlain" name="apiPasswordPlain" autocomplete="new-password" pattern=".{7,}" <?= cryptAvailable() ? '' : 'disabled="disabled" ' ?>/>
+ <a class="btn toggle-password" data-toggle="apiPasswordPlain"><?= _i('key') ?></a>
+ </div>
+ <?= _i('help') ?> <kbd><a href="../api/"><?= Minz_Url::display('/api/', 'html', true) ?></a></kbd>
+ </div>
+ </div>
+
+ <div class="form-group form-actions">
+ <div class="group-controls">
+ <button type="submit" class="btn btn-important"><?= _t('gen.action.submit') ?></button>
+ </div>
+ </div>
+ </form>
+ <?php } ?>
+
<?php if (!FreshRSS_Auth::hasAccess('admin')) { ?>
<form id="crypto-form" method="post" action="<?= _url('user', 'delete') ?>">
<input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />