]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix password screen for public shares
authorMorris Jobke <morris.jobke@gmail.com>
Mon, 7 Oct 2013 15:38:27 +0000 (17:38 +0200)
committerMorris Jobke <morris.jobke@gmail.com>
Mon, 7 Oct 2013 15:38:27 +0000 (17:38 +0200)
 * Works in IE8, 9, 10, Firefox 24 and Chromium 30
 * Credits to Julian Müller @Julian1998

apps/files_sharing/css/authenticate.css [new file with mode: 0644]
apps/files_sharing/public.php
apps/files_sharing/templates/authenticate.php
core/css/styles.css
core/img/actions/confirm.png [new file with mode: 0644]
core/img/actions/confirm.svg [new file with mode: 0644]

diff --git a/apps/files_sharing/css/authenticate.css b/apps/files_sharing/css/authenticate.css
new file mode 100644 (file)
index 0000000..cebe906
--- /dev/null
@@ -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;
+}
index eff38dcc0fd5fce37baf3d39ae3206381d1cfdfa..8bdbc8524e6dfc483e38f8b27a32944eb920ec65 100644 (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();
index 2c89b5df3f6a5a90a4d99bb618d534225cf3fb2d..6b98e6c9f34aeaa7c7c6fe371656613648d29009 100644 (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>
index 6406bcd7e636d0ab3d6d20b7e493f9466ddd07d7..a1ecd123983884b943383772019f1aaf75f34f20 100644 (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;
diff --git a/core/img/actions/confirm.png b/core/img/actions/confirm.png
new file mode 100644 (file)
index 0000000..ccde88f
Binary files /dev/null and b/core/img/actions/confirm.png differ
diff --git a/core/img/actions/confirm.svg b/core/img/actions/confirm.svg
new file mode 100644 (file)
index 0000000..bb3f9db
--- /dev/null
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="16"
+   height="16"
+   id="svg3875"
+   version="1.1"
+   inkscape:version="0.48.3.1 r9886"
+   sodipodi:docname="confirm.svg"
+   inkscape:export-filename="confirm.png"
+   inkscape:export-xdpi="90"
+   inkscape:export-ydpi="90">
+  <defs
+     id="defs3877" />
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="3.1681699"
+     inkscape:cx="89.389296"
+     inkscape:cy="-6.0573678"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="true"
+     inkscape:window-width="1366"
+     inkscape:window-height="744"
+     inkscape:window-x="0"
+     inkscape:window-y="24"
+     inkscape:window-maximized="1" />
+  <metadata
+     id="metadata3880">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(0,-1036.3622)">
+    <path
+       style="fill:#000000;fill-opacity:1;stroke:none"
+       d="m 1,1047.3622 0,-6 7,0 0,-4 7,7 -7,7 0,-4 z"
+       id="path3086"
+       inkscape:connector-curvature="0"
+       sodipodi:nodetypes="cccccccc" />
+  </g>
+</svg>