diff options
-rw-r--r-- | apps/files/templates/part.list.php | 2 | ||||
-rw-r--r-- | apps/files_sharing/css/authenticate.css | 26 | ||||
-rw-r--r-- | apps/files_sharing/public.php | 2 | ||||
-rw-r--r-- | apps/files_sharing/templates/authenticate.php | 7 | ||||
-rw-r--r-- | config/config.sample.php | 3 | ||||
-rw-r--r-- | core/css/apps.css | 4 | ||||
-rw-r--r-- | core/css/styles.css | 3 | ||||
-rw-r--r-- | core/img/actions/confirm.png | bin | 0 -> 132 bytes | |||
-rw-r--r-- | core/img/actions/confirm.svg | 6 | ||||
-rw-r--r-- | core/templates/layout.base.php | 1 | ||||
-rw-r--r-- | core/templates/layout.guest.php | 1 | ||||
-rw-r--r-- | core/templates/layout.user.php | 1 | ||||
-rw-r--r-- | lib/base.php | 7 | ||||
-rw-r--r-- | lib/private/files/view.php | 5 | ||||
-rw-r--r-- | tests/lib/files/view.php | 18 |
15 files changed, 80 insertions, 6 deletions
diff --git a/apps/files/templates/part.list.php b/apps/files/templates/part.list.php index 0679da334de..a6d2e44f34f 100644 --- a/apps/files/templates/part.list.php +++ b/apps/files/templates/part.list.php @@ -36,7 +36,7 @@ $totalsize = 0; ?> <?php else: ?> <a class="name" href="<?php p(rtrim($_['downloadURL'],'/').'/'.trim($directory,'/').'/'.$name); ?>"> <label class="filetext" title="" for="select-<?php p($file['fileid']); ?>"></label> - <span class="nametext"><?php print_unescaped(htmlspecialchars($file['basename']));?><span class='extension'><?php p($file['extension']);?></span> + <span class="nametext"><?php print_unescaped(htmlspecialchars($file['basename']));?><span class='extension'><?php p($file['extension']);?></span></span> </a> <?php endif; ?> <?php if($file['type'] == 'dir'):?> diff --git a/apps/files_sharing/css/authenticate.css b/apps/files_sharing/css/authenticate.css new file mode 100644 index 00000000000..cebe906dd59 --- /dev/null +++ b/apps/files_sharing/css/authenticate.css @@ -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; +} diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php index eff38dcc0fd..8bdbc8524e6 100644 --- a/apps/files_sharing/public.php +++ b/apps/files_sharing/public.php @@ -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(); diff --git a/apps/files_sharing/templates/authenticate.php b/apps/files_sharing/templates/authenticate.php index 2c89b5df3f6..6b98e6c9f34 100644 --- a/apps/files_sharing/templates/authenticate.php +++ b/apps/files_sharing/templates/authenticate.php @@ -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> diff --git a/config/config.sample.php b/config/config.sample.php index a9b868ca9cf..9a24c9364e0 100644 --- a/config/config.sample.php +++ b/config/config.sample.php @@ -148,6 +148,9 @@ $CONFIG = array( (watch out, this option can increase the size of your log file)*/ "log_query" => false, +/* Enable or disable the logging of IP addresses in case of webform auth failures */ +"log_authfailip" => false, + /* * Configure the size in bytes log rotation should happen, 0 or false disables the rotation. * This rotates the current owncloud logfile to a new name, this way the total log usage diff --git a/core/css/apps.css b/core/css/apps.css index 49fb189f384..f68f53d6999 100644 --- a/core/css/apps.css +++ b/core/css/apps.css @@ -104,8 +104,8 @@ padding-left: 32px; } #app-navigation > .with-icon ul li > a { - padding-left: 48px; - background-position: 24px center; + padding-left: 68px; + background-position: 44px center; } #app-navigation .open { diff --git a/core/css/styles.css b/core/css/styles.css index be53b67c858..728fd47bc9f 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -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; @@ -253,6 +254,8 @@ input[type="submit"].enabled { } #body-login p.info a { font-weight: bold; + padding: 13px; + margin: -13px; } #body-login #submit.login { margin-right:7px; } /* quick fix for log in button not being aligned with input fields, should be properly fixed by input field width later */ diff --git a/core/img/actions/confirm.png b/core/img/actions/confirm.png Binary files differnew file mode 100644 index 00000000000..3021d4c27d6 --- /dev/null +++ b/core/img/actions/confirm.png diff --git a/core/img/actions/confirm.svg b/core/img/actions/confirm.svg new file mode 100644 index 00000000000..6b69c1d6c4f --- /dev/null +++ b/core/img/actions/confirm.svg @@ -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> diff --git a/core/templates/layout.base.php b/core/templates/layout.base.php index ea10c3042b5..8caa9a0bbea 100644 --- a/core/templates/layout.base.php +++ b/core/templates/layout.base.php @@ -11,6 +11,7 @@ <?php p($theme->getTitle()); ?> </title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <meta name="viewport" content="width=device-width; initial-scale=1.0;"> <link rel="shortcut icon" href="<?php print_unescaped(image_path('', 'favicon.png')); ?>" /> <link rel="apple-touch-icon-precomposed" href="<?php print_unescaped(image_path('', 'favicon-touch.png')); ?>" /> <?php foreach ($_['cssfiles'] as $cssfile): ?> diff --git a/core/templates/layout.guest.php b/core/templates/layout.guest.php index 9c9eb63382f..cecd97ace27 100644 --- a/core/templates/layout.guest.php +++ b/core/templates/layout.guest.php @@ -11,6 +11,7 @@ <?php p($theme->getTitle()); ?> </title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <meta name="viewport" content="width=device-width; initial-scale=1.0;"> <meta name="apple-itunes-app" content="app-id=543672169"> <link rel="shortcut icon" href="<?php print_unescaped(image_path('', 'favicon.png')); ?>" /> <link rel="apple-touch-icon-precomposed" href="<?php print_unescaped(image_path('', 'favicon-touch.png')); ?>" /> diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php index fcca43624fe..39cc43fc465 100644 --- a/core/templates/layout.user.php +++ b/core/templates/layout.user.php @@ -14,6 +14,7 @@ </title> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" content="width=device-width; initial-scale=1.0;"> <meta name="apple-itunes-app" content="app-id=543672169"> <link rel="shortcut icon" href="<?php print_unescaped(image_path('', 'favicon.png')); ?>" /> <link rel="apple-touch-icon-precomposed" href="<?php print_unescaped(image_path('', 'favicon-touch.png')); ?>" /> diff --git a/lib/base.php b/lib/base.php index b0b2dca502f..ff4ca588213 100644 --- a/lib/base.php +++ b/lib/base.php @@ -760,6 +760,13 @@ class OC { // logon via web form elseif (OC::tryFormLogin()) { $error[] = 'invalidpassword'; + if ( OC_Config::getValue('log_authfailip', false) ) { + OC_Log::write('core', 'Login failed: user \''.$_POST["user"].'\' , wrong password, IP:'.$_SERVER['REMOTE_ADDR'], + OC_Log::WARN); + } else { + OC_Log::write('core', 'Login failed: user \''.$_POST["user"].'\' , wrong password, IP:set log_authfailip=true in conf', + OC_Log::WARN); + } } OC_Util::displayLoginPage(array_unique($error)); diff --git a/lib/private/files/view.php b/lib/private/files/view.php index 086e7487a6a..a56135d9b3c 100644 --- a/lib/private/files/view.php +++ b/lib/private/files/view.php @@ -712,7 +712,10 @@ class View { return false; } $defaultRoot = Filesystem::getRoot(); - return (strlen($this->fakeRoot) >= strlen($defaultRoot)) && (substr($this->fakeRoot, 0, strlen($defaultRoot)) === $defaultRoot); + if($this->fakeRoot === $defaultRoot){ + return true; + } + return (strlen($this->fakeRoot) > strlen($defaultRoot)) && (substr($this->fakeRoot, 0, strlen($defaultRoot) + 1) === $defaultRoot . '/'); } private function runHooks($hooks, $path, $post = false) { diff --git a/tests/lib/files/view.php b/tests/lib/files/view.php index 205afba707b..0cc86d6651a 100644 --- a/tests/lib/files/view.php +++ b/tests/lib/files/view.php @@ -398,6 +398,24 @@ class View extends \PHPUnit_Framework_TestCase { $this->createHookPath = $params['path']; } + /** + * @medium + */ + function testViewHooksIfRootStartsTheSame() { + $storage1 = $this->getTestStorage(); + $storage2 = $this->getTestStorage(); + $defaultRoot = \OC\Files\Filesystem::getRoot(); + \OC\Files\Filesystem::mount($storage1, array(), '/'); + \OC\Files\Filesystem::mount($storage2, array(), $defaultRoot . '_substorage'); + \OC_Hook::connect('OC_Filesystem', 'post_write', $this, 'dummyHook'); + + $subView = new \OC\Files\View($defaultRoot . '_substorage'); + $this->hookPath = null; + + $subView->file_put_contents('/foo.txt', 'asd'); + $this->assertNull($this->hookPath); + } + public function testEditNoCreateHook() { $storage1 = $this->getTestStorage(); $storage2 = $this->getTestStorage(); |