Merge pull request #5182 from owncloud/fix-sharring-with-password-screen

Fix password screen for public shares
This commit is contained in:
Morris Jobke 2013-10-10 04:49:47 -07:00
commit cf554fd804
6 changed files with 40 additions and 2 deletions

View File

@ -0,0 +1,26 @@
#body-login form label.infield {
width: 190px;
padding: 10px;
left: 8px;
top: 8px;
}
#password {
width: 190px !important;
padding: 10px;
margin: 6px;
}
input[type="submit"]{
width: 45px;
height: 45px;
margin: 6px;
background-image: url('%webroot%/core/img/actions/confirm.svg');
background-repeat: no-repeat;
background-position: center;
}
#body-login input[type="submit"] {
position: absolute;
top: 0px;
}

View File

@ -77,6 +77,7 @@ if (isset($path)) {
$hasher = new PasswordHash(8, $forcePortable);
if (!($hasher->CheckPassword($password.OC_Config::getValue('passwordsalt', ''),
$linkItem['share_with']))) {
OCP\Util::addStyle('files_sharing', 'authenticate');
$tmpl = new OCP\Template('files_sharing', 'authenticate', 'guest');
$tmpl->assign('URL', $url);
$tmpl->assign('wrongpw', true);
@ -101,6 +102,7 @@ if (isset($path)) {
|| \OC::$session->get('public_link_authenticated') !== $linkItem['id']
) {
// Prompt for password
OCP\Util::addStyle('files_sharing', 'authenticate');
$tmpl = new OCP\Template('files_sharing', 'authenticate', 'guest');
$tmpl->assign('URL', $url);
$tmpl->printPage();

View File

@ -1,12 +1,15 @@
<form action="<?php p($_['URL']); ?>" method="post">
<fieldset>
<?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>
<div class="warning"><?php p($l->t('The password is wrong. Try again.')); ?></div>
<?php endif; ?>
<p class="infield">
<label for="password" class="infield"><?php p($l->t('Password')); ?></label>
<input type="password" name="password" id="password" placeholder="" value="" autofocus />
<input type="submit" value="<?php p($l->t('Submit')); ?>" />
<input type="submit" value="" class="svg" />
</p>
</fieldset>
</form>

View File

@ -237,6 +237,7 @@ input[type="submit"].enabled {
#body-login p.info,
#body-login form fieldset legend,
#body-login #datadirContent label,
#body-login form fieldset .warning-info,
#body-login form input[type="checkbox"]+label {
text-align: center;
color: #ccc;

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 B

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2000/svg" height="16" width="16" version="1.1" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/">
<g transform="translate(0 -1036.4)">
<path d="m1 1047.4v-6h7v-4l7 7-7 7v-4z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 370 B