diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2018-06-21 10:09:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-21 10:09:20 +0200 |
commit | 8ebc3d90a0876d243c889108f3a95219c0863458 (patch) | |
tree | a7fce3b4416ab1c86f1704b67fedd72555c9b348 /core | |
parent | f9c98d86212f14b006fdf99251e35093d5026e80 (diff) | |
parent | a596b062f520469ca52eed10a407fc4cf8891239 (diff) | |
download | nextcloud-server-8ebc3d90a0876d243c889108f3a95219c0863458.tar.gz nextcloud-server-8ebc3d90a0876d243c889108f3a95219c0863458.zip |
Merge pull request #9518 from nextcloud/feature/5986/public_share_controller_middleware
Public share middleware & controller
Diffstat (limited to 'core')
-rw-r--r-- | core/css/publicshareauth.css | 27 | ||||
-rw-r--r-- | core/js/publicshareauth.js | 9 | ||||
-rw-r--r-- | core/templates/publicshareauth.php | 27 |
3 files changed, 63 insertions, 0 deletions
diff --git a/core/css/publicshareauth.css b/core/css/publicshareauth.css new file mode 100644 index 00000000000..7f83e0b41e7 --- /dev/null +++ b/core/css/publicshareauth.css @@ -0,0 +1,27 @@ +form fieldset { + display: flex !important; + flex-direction: column; +} + +#password { + margin-right: 0 !important; + border-top-right-radius: 0; + border-bottom-right-radius: 0; + height: 45px; + box-sizing: border-box; + flex: 1 1 auto; + width: 100% !important; + min-width: 0; /* FF hack for to override default value */ +} + +input[type='submit'] { + width: 45px; + height: 45px; + margin-left: 0 !important; + border-top-left-radius: 0; + border-bottom-left-radius: 0; +} + +fieldset > p { + display: inline-flex; +} diff --git a/core/js/publicshareauth.js b/core/js/publicshareauth.js new file mode 100644 index 00000000000..7f3f0d0a7d4 --- /dev/null +++ b/core/js/publicshareauth.js @@ -0,0 +1,9 @@ +$(document).ready(function(){ + $('#password').on('keyup input change', function() { + if ($('#password').val().length > 0) { + $('#password-submit').prop('disabled', false); + } else { + $('#password-submit').prop('disabled', true); + } + }); +}); diff --git a/core/templates/publicshareauth.php b/core/templates/publicshareauth.php new file mode 100644 index 00000000000..adcc2853f87 --- /dev/null +++ b/core/templates/publicshareauth.php @@ -0,0 +1,27 @@ +<?php + /** @var $_ array */ + /** @var $l \OCP\IL10N */ + style('core', 'guest'); + style('core', 'publicshareauth'); + script('core', 'publicshareauth'); +?> +<form method="post"> + <fieldset class="warning"> + <?php if (!isset($_['wrongpw'])): ?> + <div class="warning-info"><?php p($l->t('This share is password-protected')); ?></div> + <?php endif; ?> + <?php if (isset($_['wrongpw'])): ?> + <div class="warning"><?php p($l->t('The password is wrong. Try again.')); ?></div> + <?php endif; ?> + <p> + <label for="password" class="infield"><?php p($l->t('Password')); ?></label> + <input type="hidden" name="requesttoken" value="<?php p($_['requesttoken']) ?>" /> + <input type="password" name="password" id="password" + placeholder="<?php p($l->t('Password')); ?>" value="" + autocomplete="new-password" autocapitalize="off" autocorrect="off" + autofocus /> + <input type="submit" id="password-submit" + class="svg icon-confirm input-button-inline" value="" disabled="disabled" /> + </p> + </fieldset> +</form> |