diff options
-rw-r--r-- | apps/files/appinfo/remote.php | 1 | ||||
-rw-r--r-- | core/css/styles.css | 13 | ||||
-rw-r--r-- | core/templates/update.admin.php (renamed from core/templates/update.php) | 0 | ||||
-rw-r--r-- | core/templates/update.user.php | 8 | ||||
-rw-r--r-- | files/webdav.php | 30 | ||||
-rw-r--r-- | lib/base.php | 12 | ||||
-rw-r--r-- | lib/private/connector/sabre/file.php | 2 | ||||
-rw-r--r-- | lib/private/connector/sabre/filesplugin.php | 73 | ||||
-rw-r--r-- | lib/private/connector/sabre/node.php | 23 | ||||
-rw-r--r-- | lib/private/filechunking.php | 10 | ||||
-rw-r--r-- | settings/css/settings.css | 4 |
11 files changed, 135 insertions, 41 deletions
diff --git a/apps/files/appinfo/remote.php b/apps/files/appinfo/remote.php index 75c80cd49f3..9f290796205 100644 --- a/apps/files/appinfo/remote.php +++ b/apps/files/appinfo/remote.php @@ -48,6 +48,7 @@ $defaults = new OC_Defaults(); $server->addPlugin(new Sabre_DAV_Auth_Plugin($authBackend, $defaults->getName())); $server->addPlugin(new Sabre_DAV_Locks_Plugin($lockBackend)); $server->addPlugin(new Sabre_DAV_Browser_Plugin(false)); // Show something in the Browser, but no upload +$server->addPlugin(new OC_Connector_Sabre_FilesPlugin()); $server->addPlugin(new OC_Connector_Sabre_AbortedUploadDetectionPlugin()); $server->addPlugin(new OC_Connector_Sabre_QuotaPlugin()); $server->addPlugin(new OC_Connector_Sabre_MaintenancePlugin()); diff --git a/core/css/styles.css b/core/css/styles.css index 62ee0e56cae..868829b1c58 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -202,7 +202,7 @@ input[type="submit"].enabled { -moz-box-sizing:border-box; box-sizing:border-box; } #leftcontent, .leftcontent { - position:relative; overflow:auto; width:20em; height:100%; + position:relative; overflow:auto; width:256px; height:100%; background:#f8f8f8; border-right:1px solid #ddd; -moz-box-sizing:border-box; box-sizing:border-box; } @@ -211,7 +211,11 @@ input[type="submit"].enabled { #leftcontent li.active, .leftcontent li.active { font-weight:bold; } #leftcontent li:hover, .leftcontent li:hover { color:#333; background:#ddd; } #leftcontent a { height:100%; display:block; margin:0; padding:0 1em 0 0; float:left; } -#rightcontent, .rightcontent { position:fixed; top:6.4em; left:24.5em; overflow:auto } +#rightcontent, .rightcontent { position:fixed; top:89px; left: 336px; overflow:auto } + +#controls + .leftcontent{ + top: 44px; +} #emptycontent { font-size: 1.5em; @@ -441,6 +445,11 @@ label.infield { cursor:text !important; top:1.05em; left:.85em; } cursor: default; } +#body-login .update { + text-align: center; + color: #ccc; +} + #body-user .warning, #body-settings .warning { margin-top: 8px; padding: 5px; diff --git a/core/templates/update.php b/core/templates/update.admin.php index a652d5f195a..a652d5f195a 100644 --- a/core/templates/update.php +++ b/core/templates/update.admin.php diff --git a/core/templates/update.user.php b/core/templates/update.user.php new file mode 100644 index 00000000000..bb93f0fad00 --- /dev/null +++ b/core/templates/update.user.php @@ -0,0 +1,8 @@ +<ul> + <li class='update'> + <?php p($l->t('This ownCloud instance is currently being updated, which may take a while.')) ?><br/><br/> + <?php p($l->t('Please reload this page after a short time to continue using ownCloud.')) ?><br/><br/> + <?php p($l->t('Contact your system administrator if this message persists or appeared unexpectedly.')) ?><br/><br/> + <?php p($l->t('Thank you for your patience.')); ?><br/><br/> + </li> +</ul> diff --git a/files/webdav.php b/files/webdav.php deleted file mode 100644 index 87dd0191969..00000000000 --- a/files/webdav.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php - -/** - * ownCloud - * - * @author Frank Karlitschek - * @author Jakob Sack - * @copyright 2012 Frank Karlitschek frank@owncloud.org - * @copyright 2011 Jakob Sack kde@jakobsack.de - * - * 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/>. - * - */ - -// only need filesystem apps -$RUNTIME_APPTYPES=array('filesystem', 'authentication'); -require_once '../lib/base.php'; -$baseuri = OC::$WEBROOT. '/files/webdav.php'; -require_once 'apps/files/appinfo/remote.php'; diff --git a/lib/base.php b/lib/base.php index 62427fa568c..240dd1c12b6 100644 --- a/lib/base.php +++ b/lib/base.php @@ -224,7 +224,9 @@ class OC { header('Retry-After: 120'); // render error page - OC_Template::printErrorPage('ownCloud is in maintenance mode'); + $tmpl = new OC_Template('', 'update.user', 'guest'); + $tmpl->printPage(); + die(); } } @@ -240,7 +242,7 @@ class OC { $minimizerJS = new OC_Minimizer_JS(); $minimizerJS->clearCache(); OC_Util::addscript('update'); - $tmpl = new OC_Template('', 'update', 'guest'); + $tmpl = new OC_Template('', 'update.admin', 'guest'); $tmpl->assign('version', OC_Util::getVersionString()); $tmpl->printPage(); exit(); @@ -688,7 +690,11 @@ class OC { } // Handle WebDAV if ($_SERVER['REQUEST_METHOD'] == 'PROPFIND') { - header('location: ' . OC_Helper::linkToRemote('webdav')); + // not allowed any more to prevent people + // mounting this root directly. + // Users need to mount remote.php/webdav instead. + header('HTTP/1.1 405 Method Not Allowed'); + header('Status: 405 Method Not Allowed'); return; } diff --git a/lib/private/connector/sabre/file.php b/lib/private/connector/sabre/file.php index 0fa5e0b0528..919bb1fc6f4 100644 --- a/lib/private/connector/sabre/file.php +++ b/lib/private/connector/sabre/file.php @@ -222,7 +222,7 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements Sabre_D if (isset($_SERVER['CONTENT_LENGTH'])) { $expected = $_SERVER['CONTENT_LENGTH']; if ($bytesWritten != $expected) { - $chunk_handler->cleanup(); + $chunk_handler->remove($info['index']); throw new Sabre_DAV_Exception_BadRequest( 'expected filesize ' . $expected . ' got ' . $bytesWritten); } diff --git a/lib/private/connector/sabre/filesplugin.php b/lib/private/connector/sabre/filesplugin.php new file mode 100644 index 00000000000..ac781825672 --- /dev/null +++ b/lib/private/connector/sabre/filesplugin.php @@ -0,0 +1,73 @@ +<?php + +/** + * ownCloud + * + * @author Thomas Müller + * @copyright 2013 Thomas Müller <thomas.mueller@tmit.eu> + * + * @license AGPL3 + */ + +class OC_Connector_Sabre_FilesPlugin extends Sabre_DAV_ServerPlugin +{ + + // namespace + const NS_OWNCLOUD = 'http://owncloud.org/ns'; + + /** + * Reference to main server object + * + * @var Sabre_DAV_Server + */ + private $server; + + /** + * This initializes the plugin. + * + * This function is called by Sabre_DAV_Server, after + * addPlugin is called. + * + * This method should set up the required event subscriptions. + * + * @param Sabre_DAV_Server $server + * @return void + */ + public function initialize(Sabre_DAV_Server $server) { + + $server->xmlNamespaces[self::NS_OWNCLOUD] = 'oc'; + $server->protectedProperties[] = '{' . self::NS_OWNCLOUD . '}id'; + + $this->server = $server; + $this->server->subscribeEvent('beforeGetProperties', array($this, 'beforeGetProperties')); + } + + /** + * Adds all ownCloud-specific properties + * + * @param string $path + * @param Sabre_DAV_INode $node + * @param array $requestedProperties + * @param array $returnedProperties + * @return void + */ + public function beforeGetProperties($path, Sabre_DAV_INode $node, array &$requestedProperties, array &$returnedProperties) { + + if ($node instanceof OC_Connector_Sabre_Node) { + + $fileid_propertyname = '{' . self::NS_OWNCLOUD . '}id'; + if (array_search($fileid_propertyname, $requestedProperties)) { + unset($requestedProperties[array_search($fileid_propertyname, $requestedProperties)]); + } + + /** @var $node OC_Connector_Sabre_Node */ + $fileId = $node->getFileId(); + if (!is_null($fileId)) { + $returnedProperties[200][$fileid_propertyname] = $fileId; + } + + } + + } + +} diff --git a/lib/private/connector/sabre/node.php b/lib/private/connector/sabre/node.php index 3c2ad60f1dd..76fbc251100 100644 --- a/lib/private/connector/sabre/node.php +++ b/lib/private/connector/sabre/node.php @@ -45,6 +45,7 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr * @var string */ protected $path; + /** * node fileinfo cache * @var array @@ -211,6 +212,7 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr * properties should be returned */ public function getProperties($properties) { + if (is_null($this->property_cache)) { $sql = 'SELECT * FROM `*PREFIX*properties` WHERE `userid` = ? AND `propertypath` = ?'; $result = OC_DB::executeAudited( $sql, array( OC_User::getUser(), $this->path ) ); @@ -236,8 +238,11 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr $props = array(); foreach($properties as $property) { - if (isset($this->property_cache[$property])) $props[$property] = $this->property_cache[$property]; + if (isset($this->property_cache[$property])) { + $props[$property] = $this->property_cache[$property]; + } } + return $props; } @@ -260,4 +265,20 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr } return $this->fileView; } + + /** + * @return mixed + */ + public function getFileId() + { + $this->getFileinfoCache(); + + if (isset($this->fileinfo_cache['fileid'])) { + $instanceId = OC_Util::getInstanceId(); + $id = sprintf('%08d', $this->fileinfo_cache['fileid']); + return $instanceId . $id; + } + + return null; + } } diff --git a/lib/private/filechunking.php b/lib/private/filechunking.php index 0dfce696cda..aa4f73c7c05 100644 --- a/lib/private/filechunking.php +++ b/lib/private/filechunking.php @@ -85,6 +85,16 @@ class OC_FileChunking { } } + /** + * Removes one specific chunk + * @param $index + */ + public function remove($index) { + $cache = $this->getCache(); + $prefix = $this->getPrefix(); + $cache->remove($prefix.$index); + } + public function signature_split($orgfile, $input) { $info = unpack('n', fread($input, 2)); $blocksize = $info[1]; diff --git a/settings/css/settings.css b/settings/css/settings.css index b47075241df..6eef96c2dc1 100644 --- a/settings/css/settings.css +++ b/settings/css/settings.css @@ -58,10 +58,6 @@ tr:hover>td.remove>a, tr:hover>td.password>img,tr:hover>td.displayName>img, tr:h tr:hover>td.remove>a { float:right; } li.selected { background-color:#ddd; } table.grid { width:100%; } -#leftcontent, .leftcontent { - width: 256px; -} -#rightcontent, .rightcontent { top: 80px; left: 336px; } #rightcontent { padding-left: 10px; } div.quota { float: right; |