diff options
| author | 2015-07-22 22:58:00 +0200 | |
|---|---|---|
| committer | 2015-07-22 22:58:00 +0200 | |
| commit | 8751c344f384e19dd2fd2f0b5607ecc2aac58541 (patch) | |
| tree | c1f0f46fcd4b1ed47500cbbe1ded094c0e0d954d /app/views/user/profile.phtml | |
| parent | 669c41114f60a5a31253bed766f52e1840e00599 (diff) | |
Ask password to user before deleting its account
See https://github.com/FreshRSS/FreshRSS/issues/679
Diffstat (limited to 'app/views/user/profile.phtml')
| -rw-r--r-- | app/views/user/profile.phtml | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/app/views/user/profile.phtml b/app/views/user/profile.phtml index 11097e546..7ae2c7ede 100644 --- a/app/views/user/profile.phtml +++ b/app/views/user/profile.phtml @@ -18,11 +18,11 @@ </div> <div class="form-group"> - <label class="group-name" for="passwordPlain"><?php echo _t('conf.profile.password_form'); ?></label> + <label class="group-name" for="newPasswordPlain"><?php echo _t('conf.profile.password_form'); ?></label> <div class="group-controls"> <div class="stick"> - <input type="password" id="passwordPlain" name="passwordPlain" autocomplete="off" pattern=".{7,}" <?php echo cryptAvailable() ? '' : 'disabled="disabled" '; ?>/> - <a class="btn toggle-password" data-toggle="passwordPlain"><?php echo _i('key'); ?></a> + <input type="password" id="newPasswordPlain" name="newPasswordPlain" autocomplete="off" pattern=".{7,}" <?php echo cryptAvailable() ? '' : 'disabled="disabled" '; ?>/> + <a class="btn toggle-password" data-toggle="newPasswordPlain"><?php echo _i('key'); ?></a> </div> <?php echo _i('help'); ?> <?php echo _t('conf.profile.password_format'); ?> <noscript><b><?php echo _t('gen.js.should_be_activated'); ?></b></noscript> @@ -59,21 +59,30 @@ </form> <?php if (!FreshRSS_Auth::hasAccess('admin')) { ?> - <form method="post" action="<?php echo _url('user', 'delete'); ?>"> + <form id="crypto-form" method="post" action="<?php echo _url('user', 'delete'); ?>"> <legend><?php echo _t('conf.profile.delete'); ?></legend> <p class="alert alert-warn"><span class="alert-head"><?php echo _t('gen.short.attention'); ?></span> <?php echo _t('conf.profile.delete.warn'); ?></p> + <div class="form-group"> + <label class="group-name" for="passwordPlain"><?php echo _t('gen.auth.password'); ?></label> + <div class="group-controls"> + <input type="password" id="passwordPlain" required="required" /> + <input type="hidden" id="challenge" name="challenge" /><br /> + <noscript><strong><?php echo _t('gen.js.should_be_activated'); ?></strong></noscript> + </div> + </div> + <div class="form-group form-actions"> <div class="group-controls"> <?php $redirect_url = urlencode(Minz_Url::display( - array('c' => 'index', 'a' => 'index'), + array('c' => 'user', 'a' => 'profile'), 'php', true )); ?> <input type="hidden" name="r" value="<?php echo $redirect_url; ?>" /> - <input type="hidden" name="username" value="<?php echo Minz_Session::param('currentUser', '_'); ?>" /> + <input type="hidden" name="username" id="username" value="<?php echo Minz_Session::param('currentUser', '_'); ?>" /> <button type="submit" class="btn btn-attention confirm"><?php echo _t('gen.action.remove'); ?></button> </div> </div> |
