diff options
-rw-r--r-- | apps/user_ldap/lib/access.php | 2 | ||||
-rw-r--r-- | core/css/styles.css | 8 | ||||
-rw-r--r-- | lib/files/mapper.php | 16 | ||||
-rw-r--r-- | lib/files/storage/local.php | 4 | ||||
-rw-r--r-- | lib/files/storage/mappedlocal.php | 5 | ||||
-rwxr-xr-x | lib/util.php | 4 | ||||
-rw-r--r-- | tests/lib/files/storage/mappedlocal.php | 40 |
7 files changed, 71 insertions, 8 deletions
diff --git a/apps/user_ldap/lib/access.php b/apps/user_ldap/lib/access.php index 057ae17c308..4aa8ae8e8a4 100644 --- a/apps/user_ldap/lib/access.php +++ b/apps/user_ldap/lib/access.php @@ -57,8 +57,8 @@ abstract class Access { \OCP\Util::writeLog('user_ldap', 'LDAP resource not available.', \OCP\Util::DEBUG); return false; } - $rr = @ldap_read($cr, $dn, $filter, array($attr)); $dn = $this->DNasBaseParameter($dn); + $rr = @ldap_read($cr, $dn, $filter, array($attr)); if(!is_resource($rr)) { \OCP\Util::writeLog('user_ldap', 'readAttribute failed for DN '.$dn, \OCP\Util::DEBUG); //in case an error occurs , e.g. object does not exist diff --git a/core/css/styles.css b/core/css/styles.css index b8b6188671e..b41c205c21b 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -164,7 +164,7 @@ input[name="adminpass-clone"] { padding-left:1.8em; width:11.7em !important; } } .groupmiddle input { margin-top:0; margin-bottom:0; - border-top:0; border-radius:0; + border-top:0; border-bottom:0; border-radius:0; box-shadow:0 1px 1px #fff,0 1px 0 #ddd inset; } .groupbottom input { @@ -178,7 +178,11 @@ input[name="adminpass-clone"] { padding-left:1.8em; width:11.7em !important; } #login .groupmiddle label, #login .groupbottom label { top:.65em; } p.infield { position:relative; } label.infield { cursor:text !important; top:1.05em; left:.85em; } -#login form label.infield { position:absolute; font-size:19px; color:#aaa; white-space:nowrap; padding-left:1.4em; } +#login form label.infield { /* labels are ellipsized when too long, keep them short */ + position:absolute; width:90%; padding-left:1.4em; + font-size:19px; color:#aaa; + white-space:nowrap; overflow:hidden; text-overflow:ellipsis; +} #login #databaseField .infield { padding-left:0; } #login form input[type="checkbox"]+label { position:relative; margin:0; font-size:1em; text-shadow:#fff 0 1px 0; } #login form .errors { background:#fed7d7; border:1px solid #f00; list-style-indent:inside; margin:0 0 2em; padding:1em; } diff --git a/lib/files/mapper.php b/lib/files/mapper.php index 71b665e49bb..2d29a8532b6 100644 --- a/lib/files/mapper.php +++ b/lib/files/mapper.php @@ -117,6 +117,9 @@ class Mapper $query = \OC_DB::prepare('SELECT * FROM `*PREFIX*file_map` WHERE `logic_path_hash` = ?'); $result = $query->execute(array(md5($logicPath))); $result = $result->fetchRow(); + if ($result === false) { + return null; + } return $result['physic_path']; } @@ -160,11 +163,16 @@ class Mapper $sluggedElements = array(); // skip slugging the drive letter on windows - TODO: test if local path - if (strpos(strtolower(php_uname('s')), 'win') !== false) { + if (\OC_Util::runningOnWindows()) { $sluggedElements[]= $pathElements[0]; array_shift($pathElements); } foreach ($pathElements as $pathElement) { + // remove empty elements + if (empty($pathElement)) { + continue; + } + // TODO: remove file ext before slugify on last element $sluggedElements[] = self::slugify($pathElement); } @@ -177,6 +185,12 @@ class Mapper array_pop($sluggedElements); array_push($sluggedElements, $last.'-'.$index); } + + // on non-windows systems add the leading / if necessary + if (!\OC_Util::runningOnWindows() and $path[0] === '/') { + return DIRECTORY_SEPARATOR.implode(DIRECTORY_SEPARATOR, $sluggedElements); + } + return implode(DIRECTORY_SEPARATOR, $sluggedElements); } diff --git a/lib/files/storage/local.php b/lib/files/storage/local.php index 9fe01135866..aaa3c0fab49 100644 --- a/lib/files/storage/local.php +++ b/lib/files/storage/local.php @@ -9,7 +9,9 @@ namespace OC\Files\Storage; if (\OC_Util::runningOnWindows()) { - require_once 'mappedlocal.php'; + class Local extends MappedLocal { + + } } else { /** diff --git a/lib/files/storage/mappedlocal.php b/lib/files/storage/mappedlocal.php index 80dd79bc41f..218465d8eef 100644 --- a/lib/files/storage/mappedlocal.php +++ b/lib/files/storage/mappedlocal.php @@ -10,7 +10,7 @@ namespace OC\Files\Storage; /** * for local filestore, we only have to map the paths */ -class Local extends \OC\Files\Storage\Common{ +class MappedLocal extends \OC\Files\Storage\Common{ protected $datadir; private $mapper; @@ -329,6 +329,9 @@ class Local extends \OC\Files\Storage\Common{ if(strpos($path, '/') === 0) { $path = substr($path, 1); } + if ($path === false) { + return ''; + } return $path; } diff --git a/lib/util.php b/lib/util.php index 81ad2df3ac6..a4e7271adcd 100755 --- a/lib/util.php +++ b/lib/util.php @@ -74,7 +74,7 @@ class OC_Util { */ public static function getVersion() { // hint: We only can count up. So the internal version number of ownCloud 4.5 will be 4.90.0. This is not visible to the user - return array(4, 91, 10); + return array(4, 92, 10); } /** @@ -82,7 +82,7 @@ class OC_Util { * @return string */ public static function getVersionString() { - return '5.0 pre alpha'; + return '5.0 alpha 1'; } /** diff --git a/tests/lib/files/storage/mappedlocal.php b/tests/lib/files/storage/mappedlocal.php new file mode 100644 index 00000000000..b483f3a1954 --- /dev/null +++ b/tests/lib/files/storage/mappedlocal.php @@ -0,0 +1,40 @@ +<?php +/** +* ownCloud +* +* @author Robin Appelman +* @copyright 2012 Robin Appelman icewind@owncloud.com +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE +* License as published by the Free Software Foundation; either +* version 3 of the License, or any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU AFFERO GENERAL PUBLIC LICENSE for more details. +* +* You should have received a copy of the GNU Affero General Public +* License along with this library. If not, see <http://www.gnu.org/licenses/>. +* +*/ + +namespace Test\Files\Storage; + +class MappedLocal extends Storage { + /** + * @var string tmpDir + */ + private $tmpDir; + public function setUp() { + $this->tmpDir=\OC_Helper::tmpFolder(); + $this->instance=new \OC\Files\Storage\MappedLocal(array('datadir'=>$this->tmpDir)); + } + + public function tearDown() { + \OC_Helper::rmdirr($this->tmpDir); + unset($this->instance); + } +} + |