summaryrefslogtreecommitdiffstats
path: root/core/templates
diff options
context:
space:
mode:
authorCyrille Bollu <cyrpub@bollu.be>2022-02-05 20:49:17 +0100
committerCyrille Bollu <cyrpub@bollu.be>2022-04-11 21:58:24 +0200
commitc6a5c07041d2e5d20771409aede8b755d28372ac (patch)
tree71051efd25c16bed5a419eb1670477f1f5471933 /core/templates
parent60f946aba5862102a81100b09e26b37b6d59a3fa (diff)
downloadnextcloud-server-c6a5c07041d2e5d20771409aede8b755d28372ac.tar.gz
nextcloud-server-c6a5c07041d2e5d20771409aede8b755d28372ac.zip
Adds a "Request password" button to the public share authentication page for shares
of type TYPE_EMAIL, when the "video verification" checkbox isn't checked. Users accessing non-anonymous public shares (TYPE_EMAIL shares) can now request a temporary password themselves. - Creates a migration step for the files_sharing app to add the 'password_expiration_time' attribute to the oc_shares table. - Makes share temporary passwords' expiration time configurable via a system value. - Adds a system config value to allow permanent share passwords -Fixes a typo in a comment in apps/files_sharing/src/components/SharingEntryLink.vue See https://github.com/nextcloud/server/issues/31005 Signed-off-by: Cyrille Bollu <cyrpub@bollu.be>
Diffstat (limited to 'core/templates')
-rw-r--r--core/templates/publicshareauth.php59
1 files changed, 57 insertions, 2 deletions
diff --git a/core/templates/publicshareauth.php b/core/templates/publicshareauth.php
index 96c5bc89111..74303ce02ea 100644
--- a/core/templates/publicshareauth.php
+++ b/core/templates/publicshareauth.php
@@ -5,7 +5,13 @@
style('core', 'publicshareauth');
script('core', 'publicshareauth');
?>
-<form method="post">
+
+<!-- password prompt form. It should be hidden when we show the email prompt form -->
+<?php if (!isset($_['identityOk'])): ?>
+ <form method="post" id="password-input-form">
+<?php else: ?>
+ <form method="post" id="password-input-form" style="display:none;">
+<?php endif; ?>
<fieldset class="warning">
<?php if (!isset($_['wrongpw'])): ?>
<div class="warning-info"><?php p($l->t('This share is password-protected')); ?></div>
@@ -21,8 +27,57 @@
autocomplete="new-password" autocapitalize="off" autocorrect="off"
autofocus />
<input type="hidden" name="sharingToken" value="<?php p($_['share']->getToken()) ?>" id="sharingToken">
- <input type="submit" id="password-submit"
+ <input type="hidden" name="sharingType" value="<?php p($_['share']->getShareType()) ?>" id="sharingType">
+ <input type="submit" id="password-submit"
class="svg icon-confirm input-button-inline" value="" disabled="disabled" />
</p>
</fieldset>
</form>
+
+<!-- email prompt form. It should initially be hidden -->
+<?php if (isset($_['identityOk'])): ?>
+ <form method="post" id="email-input-form">
+<?php else: ?>
+ <form method="post" id="email-input-form" style="display:none;">
+<?php endif; ?>
+ <fieldset class="warning">
+ <div class="warning-info" id="email-prompt"><?php p($l->t('Please type in your email address to request a temporary password')); ?></div>
+ <p>
+ <input type="email" id="email" name="identityToken" placeholder="<?php p($l->t('Email address')); ?>" />
+ <input type="submit" id="password-request" name="passwordRequest" class="svg icon-confirm input-button-inline" value="" disabled="disabled"/>
+ <input type="hidden" name="requesttoken" value="<?php p($_['requesttoken']) ?>" />
+ <input type="hidden" name="sharingToken" value="<?php p($_['share']->getToken()) ?>" id="sharingToken">
+ <input type="hidden" name="sharingType" value="<?php p($_['share']->getShareType()) ?>" id="sharingType">
+ </p>
+ <?php if (isset($_['identityOk'])): ?>
+ <?php if ($_['identityOk']): ?>
+ <div class="warning-info" id="identification-success"><?php p($l->t('Password sent!')); ?></div>
+ <?php else: ?>
+ <div class="warning" id="identification-failure"><?php p($l->t('You are not authorized to request a password for this share')); ?></div>
+ <?php endif; ?>
+ <?php endif; ?>
+ </fieldset>
+</form>
+
+<!-- request password button -->
+<?php if (!isset($_['identityOk']) && $_['share']->getShareType() === $_['share']::TYPE_EMAIL && !$_['share']->getSendPasswordByTalk()): ?>
+ <input type="button"
+ id="request-password-button-not-talk"
+ value="<?php p($l->t('Request password')); ?>"
+ class="primary" />
+<?php endif; ?>
+
+<!-- back to showShare button -->
+<form method="get">
+ <fieldset>
+ <input type="submit"
+ id="request-password-back-button"
+ value="<?php p($l->t('Back')); ?>"
+ class="primary"
+<?php if (isset($_['identityOk'])): ?>
+ style="display:block;" />
+<?php else: ?>
+ style="display:none;" />
+<?php endif; ?>
+ </fieldset>
+</form>