summaryrefslogtreecommitdiffstats
path: root/core/lostpassword/templates
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2014-10-20 19:05:48 +0200
committerLukas Reschke <lukas@owncloud.com>2014-11-17 17:50:19 +0100
commit1b50d4f7ceb92fffe0d38f823f175cf7e419c69e (patch)
treeb11703a94164b5457675de66df285555b3582c34 /core/lostpassword/templates
parentaf7688ec17c260d3e227393e8e81438fe88b956c (diff)
downloadnextcloud-server-1b50d4f7ceb92fffe0d38f823f175cf7e419c69e.tar.gz
nextcloud-server-1b50d4f7ceb92fffe0d38f823f175cf7e419c69e.zip
Warn for password reset when files_encryption is enabled
This patch wil warn the user of the consequences when resetting the password and requires checking a checkbox (as we had in the past) to reset a password. Furthermore I updated the code to use our new classes and added some unit tests for it :dancers: Fixes https://github.com/owncloud/core/issues/11438
Diffstat (limited to 'core/lostpassword/templates')
-rw-r--r--core/lostpassword/templates/lostpassword.php20
-rw-r--r--core/lostpassword/templates/resetpassword.php9
2 files changed, 7 insertions, 22 deletions
diff --git a/core/lostpassword/templates/lostpassword.php b/core/lostpassword/templates/lostpassword.php
deleted file mode 100644
index 00dd139e71f..00000000000
--- a/core/lostpassword/templates/lostpassword.php
+++ /dev/null
@@ -1,20 +0,0 @@
-<?php
-//load the file we need
-OCP\Util::addStyle('lostpassword', 'lostpassword'); ?>
-<form action="<?php print_unescaped($_['link']) ?>" method="post">
- <fieldset>
- <div class="update"><?php p($l->t('You will receive a link to reset your password via Email.')); ?></div>
- <p>
- <input type="text" name="user" id="user" placeholder="<?php p($l->t( 'Username' )); ?>" value="" autocomplete="off" required autofocus />
- <label for="user" class="infield"><?php p($l->t( 'Username' )); ?></label>
- <img class="svg" src="<?php print_unescaped(image_path('', 'actions/user.svg')); ?>" alt=""/>
- <?php if ($_['isEncrypted']): ?>
- <br />
- <p class="warning"><?php p($l->t("Your files are encrypted. If you haven't enabled the recovery key, there will be no way to get your data back after your password is reset. If you are not sure what to do, please contact your administrator before you continue. Do you really want to continue?")); ?><br />
- <input type="checkbox" name="continue" value="Yes" />
- <?php p($l->t('Yes, I really want to reset my password now')); ?></p>
- <?php endif; ?>
- </p>
- <input type="submit" id="submit" value="<?php p($l->t('Reset')); ?>" />
- </fieldset>
-</form>
diff --git a/core/lostpassword/templates/resetpassword.php b/core/lostpassword/templates/resetpassword.php
index 118fe787116..ebd7bff2668 100644
--- a/core/lostpassword/templates/resetpassword.php
+++ b/core/lostpassword/templates/resetpassword.php
@@ -1,4 +1,10 @@
-<?php OCP\Util::addStyle('lostpassword', 'resetpassword'); ?>
+<?php
+/** @var array $_ */
+/** @var $l OC_L10N */
+style('lostpassword', 'resetpassword');
+script('core', 'lostpassword');
+?>
+
<form action="<?php print_unescaped($_['link']) ?>" id="reset-password" method="post">
<fieldset>
<p>
@@ -9,4 +15,3 @@
<input type="submit" id="submit" value="<?php p($l->t('Reset password')); ?>" />
</fieldset>
</form>
-<?php OCP\Util::addScript('core', 'lostpassword'); ?>