summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2013-05-21 23:35:19 +0200
committerRobin Appelman <icewind@owncloud.com>2013-05-21 23:35:19 +0200
commit81fd1badc3feb72c3a4e597c670e8adcdca525da (patch)
treedda3deee50551ebdffa8a9021b528ac29fdbf369 /lib
parentd7beac6d6f3ad588cee6c5ba8a2145b42fa184a2 (diff)
parentfb4d8ddf0a76da7e9f806b837f9cf23699671f75 (diff)
downloadnextcloud-server-81fd1badc3feb72c3a4e597c670e8adcdca525da.tar.gz
nextcloud-server-81fd1badc3feb72c3a4e597c670e8adcdca525da.zip
merge master into filecache_mtime
Diffstat (limited to 'lib')
-rw-r--r--lib/MDB2/Driver/sqlite3.php6
-rw-r--r--lib/api.php156
-rw-r--r--lib/autoloader.php126
-rw-r--r--lib/base.php95
-rw-r--r--lib/config.php30
-rw-r--r--lib/db.php47
-rw-r--r--lib/files.php22
-rw-r--r--lib/files/cache/backgroundwatcher.php104
-rw-r--r--lib/files/cache/cache.php81
-rw-r--r--lib/files/cache/legacy.php54
-rw-r--r--lib/files/cache/permissions.php15
-rw-r--r--lib/files/cache/scanner.php72
-rw-r--r--lib/files/cache/storage.php59
-rw-r--r--lib/files/cache/updater.php75
-rw-r--r--lib/files/cache/upgrade.php116
-rw-r--r--lib/files/filesystem.php74
-rw-r--r--lib/files/mapper.php41
-rw-r--r--lib/files/mount/manager.php120
-rw-r--r--lib/files/mount/mount.php (renamed from lib/files/mount.php)112
-rw-r--r--lib/files/storage/common.php34
-rw-r--r--lib/files/storage/local.php432
-rw-r--r--lib/files/storage/mappedlocal.php9
-rw-r--r--lib/files/storage/storage.php283
-rw-r--r--lib/files/view.php37
-rw-r--r--lib/helper.php48
-rw-r--r--lib/installer.php6
-rw-r--r--lib/json.php2
-rw-r--r--lib/l10n.php20
-rw-r--r--lib/l10n/ar.php44
-rw-r--r--lib/l10n/bg_BG.php4
-rw-r--r--lib/l10n/bn_BD.php10
-rw-r--r--lib/l10n/ca.php6
-rw-r--r--lib/l10n/cs_CZ.php10
-rw-r--r--lib/l10n/cy_GB.php52
-rw-r--r--lib/l10n/da.php14
-rw-r--r--lib/l10n/de.php12
-rw-r--r--lib/l10n/de_DE.php10
-rw-r--r--lib/l10n/el.php14
-rw-r--r--lib/l10n/eo.php11
-rw-r--r--lib/l10n/es.php8
-rw-r--r--lib/l10n/es_AR.php16
-rw-r--r--lib/l10n/et_EE.php25
-rw-r--r--lib/l10n/eu.php14
-rw-r--r--lib/l10n/fa.php2
-rw-r--r--lib/l10n/fi.php3
-rw-r--r--lib/l10n/fi_FI.php8
-rw-r--r--lib/l10n/fr.php8
-rw-r--r--lib/l10n/gl.php8
-rw-r--r--lib/l10n/he.php3
-rw-r--r--lib/l10n/hr.php2
-rw-r--r--lib/l10n/hu_HU.php10
-rw-r--r--lib/l10n/ia.php2
-rw-r--r--lib/l10n/id.php58
-rw-r--r--lib/l10n/is.php3
-rw-r--r--lib/l10n/it.php10
-rw-r--r--lib/l10n/ja_JP.php16
-rw-r--r--lib/l10n/ka_GE.php36
-rw-r--r--lib/l10n/ko.php3
-rw-r--r--lib/l10n/ku_IQ.php4
-rw-r--r--lib/l10n/lb.php3
-rw-r--r--lib/l10n/lt_LT.php13
-rw-r--r--lib/l10n/lv.php4
-rw-r--r--lib/l10n/mk.php5
-rw-r--r--lib/l10n/ms_MY.php2
-rw-r--r--lib/l10n/my_MM.php3
-rw-r--r--lib/l10n/nb_NO.php9
-rw-r--r--lib/l10n/nl.php6
-rw-r--r--lib/l10n/nn_NO.php14
-rw-r--r--lib/l10n/oc.php4
-rw-r--r--lib/l10n/pl.php16
-rw-r--r--lib/l10n/pt_BR.php4
-rw-r--r--lib/l10n/pt_PT.php12
-rw-r--r--lib/l10n/ro.php3
-rw-r--r--lib/l10n/ru.php10
-rw-r--r--lib/l10n/ru_RU.php36
-rw-r--r--lib/l10n/si_LK.php7
-rw-r--r--lib/l10n/sk_SK.php6
-rw-r--r--lib/l10n/sl.php40
-rw-r--r--lib/l10n/sq.php52
-rw-r--r--lib/l10n/sr.php7
-rw-r--r--lib/l10n/sr@latin.php2
-rw-r--r--lib/l10n/sv.php7
-rw-r--r--lib/l10n/ta_LK.php5
-rw-r--r--lib/l10n/te.php13
-rw-r--r--lib/l10n/th_TH.php9
-rw-r--r--lib/l10n/tr.php25
-rw-r--r--lib/l10n/ug.php19
-rw-r--r--lib/l10n/uk.php4
-rw-r--r--lib/l10n/vi.php7
-rw-r--r--lib/l10n/zh_CN.GB2312.php8
-rw-r--r--lib/l10n/zh_CN.php38
-rw-r--r--lib/l10n/zh_HK.php13
-rw-r--r--lib/l10n/zh_TW.php27
-rw-r--r--lib/legacy/filesystem.php (renamed from lib/filesystem.php)0
-rw-r--r--lib/legacy/filesystemview.php (renamed from lib/filesystemview.php)0
-rw-r--r--lib/log/owncloud.php3
-rw-r--r--lib/migrate.php9
-rw-r--r--lib/mimetypes.list.php12
-rw-r--r--lib/ocs/cloud.php60
-rw-r--r--lib/ocs/result.php50
-rw-r--r--lib/public/files.php10
-rw-r--r--lib/public/share.php81
-rw-r--r--lib/public/util.php1
-rwxr-xr-xlib/request.php13
-rw-r--r--lib/setup.php20
-rw-r--r--lib/template.php12
-rw-r--r--lib/templatelayout.php92
-rw-r--r--lib/updater.php46
-rw-r--r--lib/user.php14
-rw-r--r--lib/user/database.php6
-rwxr-xr-xlib/util.php105
-rw-r--r--lib/vcategories.php51
-rw-r--r--lib/vobject/compoundproperty.php70
-rw-r--r--lib/vobject/stringproperty.php80
114 files changed, 2669 insertions, 1201 deletions
diff --git a/lib/MDB2/Driver/sqlite3.php b/lib/MDB2/Driver/sqlite3.php
index 8f057cfb6e8..693ceffa01c 100644
--- a/lib/MDB2/Driver/sqlite3.php
+++ b/lib/MDB2/Driver/sqlite3.php
@@ -387,7 +387,7 @@ class MDB2_Driver_sqlite3 extends MDB2_Driver_Common
$php_errormsg = '';
$this->connection = new SQLite3($database_file);
if(is_callable(array($this->connection, 'busyTimeout'))) {//busy timout is only available in php>=5.3
- $this->connection->busyTimeout(100);
+ $this->connection->busyTimeout(60000);
}
$this->_lasterror = $this->connection->lastErrorMsg();
if (!$this->connection) {
@@ -892,10 +892,10 @@ class MDB2_Driver_sqlite3 extends MDB2_Driver_Common
$connection = $this->getConnection();
if (PEAR::isError($connection)) {
return $connection;
- }
+ }
$statement =$this->connection->prepare($query);
if (!$statement) {
- return $this->db->raiseError(MDB2_ERROR_NOT_FOUND, null, null,
+ return $this->raiseError(MDB2_ERROR_NOT_FOUND, null, null,
'unable to prepare statement: '.$query);
}
diff --git a/lib/api.php b/lib/api.php
index 70e3028b68a..fc76836995b 100644
--- a/lib/api.php
+++ b/lib/api.php
@@ -33,21 +33,20 @@ class OC_API {
const USER_AUTH = 1;
const SUBADMIN_AUTH = 2;
const ADMIN_AUTH = 3;
-
- private static $server;
-
+
/**
- * initialises the OAuth store and server
+ * API Response Codes
*/
- private static function init() {
- self::$server = new OC_OAuth_Server(new OC_OAuth_Store());
- }
-
+ const RESPOND_UNAUTHORISED = 997;
+ const RESPOND_SERVER_ERROR = 996;
+ const RESPOND_NOT_FOUND = 998;
+ const RESPOND_UNKNOWN_ERROR = 999;
+
/**
* api actions
*/
protected static $actions = array();
-
+
/**
* registers an api call
* @param string $method the http method
@@ -58,7 +57,7 @@ class OC_API {
* @param array $defaults
* @param array $requirements
*/
- public static function register($method, $url, $action, $app,
+ public static function register($method, $url, $action, $app,
$authLevel = OC_API::USER_AUTH,
$defaults = array(),
$requirements = array()) {
@@ -71,9 +70,9 @@ class OC_API {
->action('OC_API', 'call');
self::$actions[$name] = array();
}
- self::$actions[$name] = array('app' => $app, 'action' => $action, 'authlevel' => $authLevel);
+ self::$actions[$name][] = array('app' => $app, 'action' => $action, 'authlevel' => $authLevel);
}
-
+
/**
* handles an api call
* @param array $parameters
@@ -86,29 +85,103 @@ class OC_API {
parse_str(file_get_contents("php://input"), $parameters['_delete']);
}
$name = $parameters['_route'];
- // Check authentication and availability
- if(self::isAuthorised(self::$actions[$name])) {
- if(is_callable(self::$actions[$name]['action'])) {
- $response = call_user_func(self::$actions[$name]['action'], $parameters);
- if(!($response instanceof OC_OCS_Result)) {
- $response = new OC_OCS_Result(null, 996, 'Internal Server Error');
- }
- } else {
- $response = new OC_OCS_Result(null, 998, 'Api method not found');
+ // Foreach registered action
+ $responses = array();
+ foreach(self::$actions[$name] as $action) {
+ // Check authentication and availability
+ if(!self::isAuthorised($action)) {
+ $responses[] = array(
+ 'app' => $action['app'],
+ 'response' => new OC_OCS_Result(null, OC_API::RESPOND_UNAUTHORISED, 'Unauthorised'),
+ );
+ continue;
}
- } else {
- header('WWW-Authenticate: Basic realm="Authorization Required"');
- header('HTTP/1.0 401 Unauthorized');
- $response = new OC_OCS_Result(null, 997, 'Unauthorised');
+ if(!is_callable($action['action'])) {
+ $responses[] = array(
+ 'app' => $action['app'],
+ 'response' => new OC_OCS_Result(null, OC_API::RESPOND_NOT_FOUND, 'Api method not found'),
+ );
+ continue;
+ }
+ // Run the action
+ $responses[] = array(
+ 'app' => $action['app'],
+ 'response' => call_user_func($action['action'], $parameters),
+ );
}
- // Send the response
+ $response = self::mergeResponses($responses);
$formats = array('json', 'xml');
+
$format = !empty($_GET['format']) && in_array($_GET['format'], $formats) ? $_GET['format'] : 'xml';
- self::respond($response, $format);
- // logout the user to be stateless
OC_User::logout();
+
+ self::respond($response, $format);
}
+
+ /**
+ * merge the returned result objects into one response
+ * @param array $responses
+ */
+ private static function mergeResponses($responses) {
+ $response = array();
+ // Sort into shipped and thirdparty
+ $shipped = array(
+ 'succeeded' => array(),
+ 'failed' => array(),
+ );
+ $thirdparty = array(
+ 'succeeded' => array(),
+ 'failed' => array(),
+ );
+
+ foreach($responses as $response) {
+ if(OC_App::isShipped($response['app']) || ($response['app'] === 'core')) {
+ if($response['response']->succeeded()) {
+ $shipped['succeeded'][$response['app']] = $response['response'];
+ } else {
+ $shipped['failed'][$response['app']] = $response['response'];
+ }
+ } else {
+ if($response['response']->succeeded()) {
+ $thirdparty['succeeded'][$response['app']] = $response['response'];
+ } else {
+ $thirdparty['failed'][$response['app']] = $response['response'];
+ }
+ }
+ }
+
+ // Remove any error responses if there is one shipped response that succeeded
+ if(!empty($shipped['succeeded'])) {
+ $responses = array_merge($shipped['succeeded'], $thirdparty['succeeded']);
+ } else if(!empty($shipped['failed'])) {
+ // Which shipped response do we use if they all failed?
+ // They may have failed for different reasons (different status codes)
+ // Which reponse code should we return?
+ // Maybe any that are not OC_API::RESPOND_SERVER_ERROR
+ $response = reset($shipped['failed']);
+ return $response;
+ } elseif(!empty($thirdparty['failed'])) {
+ // Return the third party failure result
+ $response = reset($thirdparty['failed']);
+ return $response;
+ } else {
+ $responses = array_merge($shipped['succeeded'], $thirdparty['succeeded']);
+ }
+ // Merge the successful responses
+ $meta = array();
+ $data = array();
+ foreach($responses as $app => $response) {
+ if(OC_App::isShipped($app)) {
+ $data = array_merge_recursive($response->getData(), $data);
+ } else {
+ $data = array_merge_recursive($data, $response->getData());
+ }
+ }
+ $result = new OC_OCS_Result($data, 100);
+ return $result;
+ }
+
/**
* authenticate the api call
* @param array $action the action details as supplied to OC_API::register()
@@ -132,7 +205,8 @@ class OC_API {
return false;
} else {
$subAdmin = OC_SubAdmin::isSubAdmin($user);
- if($subAdmin) {
+ $admin = OC_User::isAdminUser($user);
+ if($subAdmin || $admin) {
return true;
} else {
return false;
@@ -153,25 +227,35 @@ class OC_API {
return false;
break;
}
- }
-
+ }
+
/**
* http basic auth
* @return string|false (username, or false on failure)
*/
- private static function loginUser(){
+ private static function loginUser(){
$authUser = isset($_SERVER['PHP_AUTH_USER']) ? $_SERVER['PHP_AUTH_USER'] : '';
$authPw = isset($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : '';
return OC_User::login($authUser, $authPw) ? $authUser : false;
}
-
+
/**
* respond to a call
- * @param int|array $result the result from the api method
+ * @param OC_OCS_Result $result
* @param string $format the format xml|json
*/
private static function respond($result, $format='xml') {
- $response = array('ocs' => $result->getResult());
+ // Send 401 headers if unauthorised
+ if($result->getStatusCode() === self::RESPOND_UNAUTHORISED) {
+ header('WWW-Authenticate: Basic realm="Authorisation Required"');
+ header('HTTP/1.0 401 Unauthorized');
+ }
+ $response = array(
+ 'ocs' => array(
+ 'meta' => $result->getMeta(),
+ 'data' => $result->getData(),
+ ),
+ );
if ($format == 'json') {
OC_JSON::encodedPrint($response);
} else if ($format == 'xml') {
@@ -203,5 +287,5 @@ class OC_API {
}
}
}
-
+
}
diff --git a/lib/autoloader.php b/lib/autoloader.php
new file mode 100644
index 00000000000..9615838a9a2
--- /dev/null
+++ b/lib/autoloader.php
@@ -0,0 +1,126 @@
+<?php
+/**
+ * Copyright (c) 2013 Robin Appelman <icewind@owncloud.com>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+namespace OC;
+
+class Autoloader {
+ private $useGlobalClassPath = true;
+
+ private $prefixPaths = array();
+
+ private $classPaths = array();
+
+ /**
+ * Add a custom prefix to the autoloader
+ *
+ * @param string $prefix
+ * @param string $path
+ */
+ public function registerPrefix($prefix, $path) {
+ $this->prefixPaths[$prefix] = $path;
+ }
+
+ /**
+ * Add a custom classpath to the autoloader
+ *
+ * @param string $class
+ * @param string $path
+ */
+ public function registerClass($class, $path) {
+ $this->classPaths[$class] = $path;
+ }
+
+ /**
+ * disable the usage of the global classpath \OC::$CLASSPATH
+ */
+ public function disableGlobalClassPath() {
+ $this->useGlobalClassPath = false;
+ }
+
+ /**
+ * enable the usage of the global classpath \OC::$CLASSPATH
+ */
+ public function enableGlobalClassPath() {
+ $this->useGlobalClassPath = true;
+ }
+
+ /**
+ * get the possible paths for a class
+ *
+ * @param string $class
+ * @return array|bool an array of possible paths or false if the class is not part of ownCloud
+ */
+ public function findClass($class) {
+ $class = trim($class, '\\');
+
+ $paths = array();
+ if (array_key_exists($class, $this->classPaths)) {
+ $paths[] = $this->classPaths[$class];
+ } else if ($this->useGlobalClassPath and array_key_exists($class, \OC::$CLASSPATH)) {
+ $paths[] = \OC::$CLASSPATH[$class];
+ /**
+ * @TODO: Remove this when necessary
+ * Remove "apps/" from inclusion path for smooth migration to mutli app dir
+ */
+ if (strpos(\OC::$CLASSPATH[$class], 'apps/') === 0) {
+ \OC_Log::write('core', 'include path for class "' . $class . '" starts with "apps/"', \OC_Log::DEBUG);
+ $paths[] = str_replace('apps/', '', \OC::$CLASSPATH[$class]);
+ }
+ } elseif (strpos($class, 'OC_') === 0) {
+ // first check for legacy classes if underscores are used
+ $paths[] = 'legacy/' . strtolower(str_replace('_', '/', substr($class, 3)) . '.php');
+ $paths[] = strtolower(str_replace('_', '/', substr($class, 3)) . '.php');
+ } elseif (strpos($class, 'OC\\') === 0) {
+ $paths[] = strtolower(str_replace('\\', '/', substr($class, 3)) . '.php');
+ } elseif (strpos($class, 'OCP\\') === 0) {
+ $paths[] = 'public/' . strtolower(str_replace('\\', '/', substr($class, 4)) . '.php');
+ } elseif (strpos($class, 'OCA\\') === 0) {
+ list(, $app, $rest) = explode('\\', $class, 3);
+ $app = strtolower($app);
+ foreach (\OC::$APPSROOTS as $appDir) {
+ if (stream_resolve_include_path($appDir['path'] . '/' . $app)) {
+ $paths[] = $appDir['path'] . '/' . $app . '/' . strtolower(str_replace('\\', '/', $rest) . '.php');
+ // If not found in the root of the app directory, insert '/lib' after app id and try again.
+ $paths[] = $appDir['path'] . '/' . $app . '/lib/' . strtolower(str_replace('\\', '/', $rest) . '.php');
+ }
+ }
+ } elseif (strpos($class, 'Test_') === 0) {
+ $paths[] = 'tests/lib/' . strtolower(str_replace('_', '/', substr($class, 5)) . '.php');
+ } elseif (strpos($class, 'Test\\') === 0) {
+ $paths[] = 'tests/lib/' . strtolower(str_replace('\\', '/', substr($class, 5)) . '.php');
+ } else {
+ foreach ($this->prefixPaths as $prefix => $dir) {
+ if (0 === strpos($class, $prefix)) {
+ $path = str_replace('\\', DIRECTORY_SEPARATOR, $class) . '.php';
+ $path = str_replace('_', DIRECTORY_SEPARATOR, $path);
+ $paths[] = $dir . '/' . $path;
+ }
+ }
+ }
+ return $paths;
+ }
+
+ /**
+ * Load the specified class
+ *
+ * @param string $class
+ * @return bool
+ */
+ public function load($class) {
+ $paths = $this->findClass($class);
+
+ if (is_array($paths)) {
+ foreach ($paths as $path) {
+ if ($fullPath = stream_resolve_include_path($path)) {
+ require_once $fullPath;
+ }
+ }
+ }
+ return false;
+ }
+}
diff --git a/lib/base.php b/lib/base.php
index 59b861ffce1..7d7e690aa6f 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -75,52 +75,9 @@ class OC {
protected static $router = null;
/**
- * SPL autoload
+ * @var \OC\Autoloader $loader
*/
- public static function autoload($className) {
- if (array_key_exists($className, OC::$CLASSPATH)) {
- $path = OC::$CLASSPATH[$className];
- /** @TODO: Remove this when necessary
- Remove "apps/" from inclusion path for smooth migration to mutli app dir
- */
- if (strpos($path, 'apps/') === 0) {
- OC_Log::write('core', 'include path for class "' . $className . '" starts with "apps/"', OC_Log::DEBUG);
- $path = str_replace('apps/', '', $path);
- }
- } elseif (strpos($className, 'OC_') === 0) {
- $path = strtolower(str_replace('_', '/', substr($className, 3)) . '.php');
- } elseif (strpos($className, 'OC\\') === 0) {
- $path = strtolower(str_replace('\\', '/', substr($className, 3)) . '.php');
- } elseif (strpos($className, 'OCP\\') === 0) {
- $path = 'public/' . strtolower(str_replace('\\', '/', substr($className, 3)) . '.php');
- } elseif (strpos($className, 'OCA\\') === 0) {
- foreach (self::$APPSROOTS as $appDir) {
- $path = $appDir['path'] . '/' . strtolower(str_replace('\\', '/', substr($className, 3)) . '.php');
- $fullPath = stream_resolve_include_path($path);
- if (file_exists($fullPath)) {
- require_once $fullPath;
- return false;
- }
- }
- } elseif (strpos($className, 'Sabre_') === 0) {
- $path = str_replace('_', '/', $className) . '.php';
- } elseif (strpos($className, 'Symfony\\Component\\Routing\\') === 0) {
- $path = 'symfony/routing/' . str_replace('\\', '/', $className) . '.php';
- } elseif (strpos($className, 'Sabre\\VObject') === 0) {
- $path = str_replace('\\', '/', $className) . '.php';
- } elseif (strpos($className, 'Test_') === 0) {
- $path = 'tests/lib/' . strtolower(str_replace('_', '/', substr($className, 5)) . '.php');
- } elseif (strpos($className, 'Test\\') === 0) {
- $path = 'tests/lib/' . strtolower(str_replace('\\', '/', substr($className, 5)) . '.php');
- } else {
- return false;
- }
-
- if ($fullPath = stream_resolve_include_path($path)) {
- require_once $fullPath;
- }
- return false;
- }
+ public static $loader = null;
public static function initPaths() {
// calculate the root directories
@@ -276,7 +233,7 @@ class OC {
OC_Config::setValue('maintenance', true);
OC_Log::write('core',
'starting upgrade from ' . $installedVersion . ' to ' . $currentVersion,
- OC_Log::DEBUG);
+ OC_Log::WARN);
$minimizerCSS = new OC_Minimizer_CSS();
$minimizerCSS->clearCache();
$minimizerJS = new OC_Minimizer_JS();
@@ -321,6 +278,10 @@ class OC {
// prevents javascript from accessing php session cookies
ini_set('session.cookie_httponly', '1;');
+ // set the cookie path to the ownCloud directory
+ $cookie_path = OC::$WEBROOT ?: '/';
+ ini_set('session.cookie_path', $cookie_path);
+
// set the session name to the instance id - which is unique
session_name(OC_Util::getInstanceId());
@@ -352,7 +313,7 @@ class OC {
// session timeout
if (isset($_SESSION['LAST_ACTIVITY']) && (time() - $_SESSION['LAST_ACTIVITY'] > 60*60*24)) {
if (isset($_COOKIE[session_name()])) {
- setcookie(session_name(), '', time() - 42000, '/');
+ setcookie(session_name(), '', time() - 42000, $cookie_path);
}
session_unset();
session_destroy();
@@ -383,8 +344,14 @@ class OC {
public static function init() {
// register autoloader
- spl_autoload_register(array('OC', 'autoload'));
- OC_Util::issetlocaleworking();
+ require_once __DIR__ . '/autoloader.php';
+ self::$loader=new \OC\Autoloader();
+ self::$loader->registerPrefix('Doctrine\\Common', 'doctrine/common/lib');
+ self::$loader->registerPrefix('Doctrine\\DBAL', 'doctrine/dbal/lib');
+ self::$loader->registerPrefix('Symfony\\Component\\Routing', 'symfony/routing');
+ self::$loader->registerPrefix('Sabre\\VObject', '3rdparty');
+ self::$loader->registerPrefix('Sabre_', '3rdparty');
+ spl_autoload_register(array(self::$loader, 'load'));
// set some stuff
//ob_start();
@@ -398,8 +365,8 @@ class OC {
ini_set('arg_separator.output', '&amp;');
// try to switch magic quotes off.
- if (get_magic_quotes_gpc()) {
- @set_magic_quotes_runtime(false);
+ if (get_magic_quotes_gpc()==1) {
+ ini_set('magic_quotes_runtime', 0);
}
//try to configure php to enable big file uploads.
@@ -441,6 +408,7 @@ class OC {
}
self::initPaths();
+ OC_Util::issetlocaleworking();
// set debug mode if an xdebug session is active
if (!defined('DEBUG') || !DEBUG) {
@@ -461,11 +429,13 @@ class OC {
stream_wrapper_register('close', 'OC\Files\Stream\Close');
stream_wrapper_register('oc', 'OC\Files\Stream\OC');
+ self::initTemplateEngine();
self::checkConfig();
self::checkInstalled();
self::checkSSL();
- self::initSession();
- self::initTemplateEngine();
+ if ( !self::$CLI ) {
+ self::initSession();
+ }
$errors = OC_Util::checkServer();
if (count($errors) > 0) {
@@ -572,10 +542,12 @@ class OC {
* register hooks for sharing
*/
public static function registerShareHooks() {
- OC_Hook::connect('OC_User', 'post_deleteUser', 'OCP\Share', 'post_deleteUser');
- OC_Hook::connect('OC_User', 'post_addToGroup', 'OCP\Share', 'post_addToGroup');
- OC_Hook::connect('OC_User', 'post_removeFromGroup', 'OCP\Share', 'post_removeFromGroup');
- OC_Hook::connect('OC_User', 'post_deleteGroup', 'OCP\Share', 'post_deleteGroup');
+ if(\OC_Config::getValue('installed')) {
+ OC_Hook::connect('OC_User', 'post_deleteUser', 'OCP\Share', 'post_deleteUser');
+ OC_Hook::connect('OC_User', 'post_addToGroup', 'OCP\Share', 'post_addToGroup');
+ OC_Hook::connect('OC_User', 'post_removeFromGroup', 'OCP\Share', 'post_removeFromGroup');
+ OC_Hook::connect('OC_User', 'post_deleteGroup', 'OCP\Share', 'post_deleteGroup');
+ }
}
/**
@@ -625,8 +597,13 @@ class OC {
// Handle redirect URL for logged in users
if (isset($_REQUEST['redirect_url']) && OC_User::isLoggedIn()) {
$location = OC_Helper::makeURLAbsolute(urldecode($_REQUEST['redirect_url']));
- header('Location: ' . $location);
- return;
+
+ // Deny the redirect if the URL contains a @
+ // This prevents unvalidated redirects like ?redirect_url=:user@domain.com
+ if (strpos($location, '@') === false) {
+ header('Location: ' . $location);
+ return;
+ }
}
// Handle WebDAV
if ($_SERVER['REQUEST_METHOD'] == 'PROPFIND') {
diff --git a/lib/config.php b/lib/config.php
index 0bd497b8e50..9b87d4ce4e5 100644
--- a/lib/config.php
+++ b/lib/config.php
@@ -130,14 +130,24 @@ class OC_Config{
return true;
}
- if( !file_exists( OC::$SERVERROOT."/config/config.php" )) {
- return false;
- }
+ // read all file in config dir ending by config.php
+ $config_files = glob( OC::$SERVERROOT."/config/*.config.php");
+
+ //Filter only regular files
+ $config_files = array_filter($config_files, 'is_file');
+
+ //Sort array naturally :
+ natsort($config_files);
- // Include the file, save the data from $CONFIG
- include OC::$SERVERROOT."/config/config.php";
- if( isset( $CONFIG ) && is_array( $CONFIG )) {
- self::$cache = $CONFIG;
+ // Add default config
+ array_unshift($config_files,OC::$SERVERROOT."/config/config.php");
+
+ //Include file and merge config
+ foreach($config_files as $file){
+ include $file;
+ if( isset( $CONFIG ) && is_array( $CONFIG )) {
+ self::$cache = array_merge(self::$cache, $CONFIG);
+ }
}
// We cached everything
@@ -155,7 +165,11 @@ class OC_Config{
*/
public static function writeData() {
// Create a php file ...
- $content = "<?php\n\$CONFIG = ";
+ $content = "<?php\n ";
+ if (defined('DEBUG') && DEBUG) {
+ $content .= "define('DEBUG',true);\n";
+ }
+ $content .= "\$CONFIG = ";
$content .= var_export(self::$cache, true);
$content .= ";\n";
diff --git a/lib/db.php b/lib/db.php
index 347deac8519..8f6f50bda6e 100644
--- a/lib/db.php
+++ b/lib/db.php
@@ -292,8 +292,10 @@ class OC_DB {
'username' => $user,
'password' => $pass,
'hostspec' => $host,
- 'database' => $name
- );
+ 'database' => $name,
+ 'charset' => 'UTF-8'
+ );
+ $options['portability'] = $options['portability'] - MDB2_PORTABILITY_EMPTY_TO_NULL;
break;
default:
return false;
@@ -365,7 +367,9 @@ class OC_DB {
// Optimize the query
$query = self::processQuery( $query );
-
+ if(OC_Config::getValue( "log_query", false)) {
+ OC_Log::write('core', 'DB prepare : '.$query, OC_Log::DEBUG);
+ }
self::connect();
// return the result
if(self::$backend==self::BACKEND_MDB2) {
@@ -631,18 +635,20 @@ class OC_DB {
$type = self::$type;
$query = '';
+ $inserts = array_values($input);
// differences in escaping of table names ('`' for mysql) and getting the current timestamp
if( $type == 'sqlite' || $type == 'sqlite3' ) {
// NOTE: For SQLite we have to use this clumsy approach
// otherwise all fieldnames used must have a unique key.
- $query = 'SELECT * FROM "' . $table . '" WHERE ';
+ $query = 'SELECT * FROM `' . $table . '` WHERE ';
foreach($input as $key => $value) {
- $query .= $key . " = '" . $value . '\' AND ';
+ $query .= '`' . $key . '` = ? AND ';
}
$query = substr($query, 0, strlen($query) - 5);
try {
$stmt = self::prepare($query);
- $result = $stmt->execute();
+ $result = $stmt->execute($inserts);
+
} catch(PDOException $e) {
$entry = 'DB Error: "'.$e->getMessage() . '"<br />';
$entry .= 'Offending command was: ' . $query . '<br />';
@@ -651,28 +657,27 @@ class OC_DB {
OC_Template::printErrorPage( $entry );
}
- if($result->numRows() == 0) {
- $query = 'INSERT INTO "' . $table . '" ("'
- . implode('","', array_keys($input)) . '") VALUES("'
- . implode('","', array_values($input)) . '")';
+ if((int)$result->numRows() === 0) {
+ $query = 'INSERT INTO `' . $table . '` (`'
+ . implode('`,`', array_keys($input)) . '`) VALUES('
+ . str_repeat('?,', count($input)-1).'? ' . ')';
} else {
return true;
}
} elseif( $type == 'pgsql' || $type == 'oci' || $type == 'mysql' || $type == 'mssql') {
- $query = 'INSERT INTO `' .$table . '` ('
- . implode(',', array_keys($input)) . ') SELECT \''
- . implode('\',\'', array_values($input)) . '\' FROM ' . $table . ' WHERE ';
+ $query = 'INSERT INTO `' .$table . '` (`'
+ . implode('`,`', array_keys($input)) . '`) SELECT '
+ . str_repeat('?,', count($input)-1).'? ' // Is there a prettier alternative?
+ . 'FROM `' . $table . '` WHERE ';
foreach($input as $key => $value) {
- $query .= $key . " = '" . $value . '\' AND ';
+ $query .= '`' . $key . '` = ? AND ';
}
$query = substr($query, 0, strlen($query) - 5);
$query .= ' HAVING COUNT(*) = 0';
+ $inserts = array_merge($inserts, $inserts);
}
- // TODO: oci should be use " (quote) instead of ` (backtick).
- //OC_Log::write('core', __METHOD__ . ', type: ' . $type . ', query: ' . $query, OC_Log::DEBUG);
-
try {
$result = self::prepare($query);
} catch(PDOException $e) {
@@ -683,7 +688,7 @@ class OC_DB {
OC_Template::printErrorPage( $entry );
}
- return $result->execute();
+ return $result->execute($inserts);
}
/**
@@ -949,6 +954,10 @@ class PDOStatementWrapper{
* make execute return the result instead of a bool
*/
public function execute($input=array()) {
+ if(OC_Config::getValue( "log_query", false)) {
+ $params_str = str_replace("\n"," ",var_export($input,true));
+ OC_Log::write('core', 'DB execute with arguments : '.$params_str, OC_Log::DEBUG);
+ }
$this->lastArguments = $input;
if (count($input) > 0) {
@@ -1068,7 +1077,7 @@ class PDOStatementWrapper{
public function numRows() {
$regex = '/^SELECT\s+(?:ALL\s+|DISTINCT\s+)?(?:.*?)\s+FROM\s+(.*)$/i';
if (preg_match($regex, $this->statement->queryString, $output) > 0) {
- $query = OC_DB::prepare("SELECT COUNT(*) FROM {$output[1]}", PDO::FETCH_NUM);
+ $query = OC_DB::prepare("SELECT COUNT(*) FROM {$output[1]}");
return $query->execute($this->lastArguments)->fetchColumn();
}else{
return $this->statement->rowCount();
diff --git a/lib/files.php b/lib/files.php
index 71bb21851b6..ab7fa1ed096 100644
--- a/lib/files.php
+++ b/lib/files.php
@@ -50,7 +50,7 @@ class OC_Files {
$xsendfile = true;
}
- if (count($files) == 1) {
+ if (is_array($files) && count($files) == 1) {
$files = $files[0];
}
@@ -59,11 +59,7 @@ class OC_Files {
$executionTime = intval(ini_get('max_execution_time'));
set_time_limit(0);
$zip = new ZipArchive();
- if ($xsendfile) {
- $filename = OC_Helper::tmpFileNoClean('.zip');
- }else{
- $filename = OC_Helper::tmpFile('.zip');
- }
+ $filename = OC_Helper::tmpFile('.zip');
if ($zip->open($filename, ZIPARCHIVE::CREATE | ZIPARCHIVE::OVERWRITE)!==true) {
exit("cannot open <$filename>\n");
}
@@ -78,6 +74,9 @@ class OC_Files {
}
}
$zip->close();
+ if ($xsendfile) {
+ $filename = OC_Helper::moveToNoClean($filename);
+ }
$basename = basename($dir);
if ($basename) {
$name = $basename . '.zip';
@@ -91,17 +90,16 @@ class OC_Files {
$executionTime = intval(ini_get('max_execution_time'));
set_time_limit(0);
$zip = new ZipArchive();
- if ($xsendfile) {
- $filename = OC_Helper::tmpFileNoClean('.zip');
- }else{
- $filename = OC_Helper::tmpFile('.zip');
- }
+ $filename = OC_Helper::tmpFile('.zip');
if ($zip->open($filename, ZIPARCHIVE::CREATE | ZIPARCHIVE::OVERWRITE)!==true) {
exit("cannot open <$filename>\n");
}
$file = $dir . '/' . $files;
self::zipAddDir($file, $zip);
$zip->close();
+ if ($xsendfile) {
+ $filename = OC_Helper::moveToNoClean($filename);
+ }
$name = $files . '.zip';
set_time_limit($executionTime);
} else {
@@ -128,7 +126,7 @@ class OC_Files {
header('Content-Type: '.\OC\Files\Filesystem::getMimeType($filename));
header("Content-Length: ".\OC\Files\Filesystem::filesize($filename));
list($storage) = \OC\Files\Filesystem::resolvePath($filename);
- if ($storage instanceof \OC\File\Storage\Local) {
+ if ($storage instanceof \OC\Files\Storage\Local) {
self::addSendfileHeader(\OC\Files\Filesystem::getLocalFile($filename));
}
}
diff --git a/lib/files/cache/backgroundwatcher.php b/lib/files/cache/backgroundwatcher.php
new file mode 100644
index 00000000000..8933101577d
--- /dev/null
+++ b/lib/files/cache/backgroundwatcher.php
@@ -0,0 +1,104 @@
+<?php
+/**
+ * Copyright (c) 2013 Robin Appelman <icewind@owncloud.com>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+namespace OC\Files\Cache;
+
+use \OC\Files\Mount;
+use \OC\Files\Filesystem;
+
+class BackgroundWatcher {
+ static $folderMimetype = null;
+
+ static private function getFolderMimetype() {
+ if (!is_null(self::$folderMimetype)) {
+ return self::$folderMimetype;
+ }
+ $query = \OC_DB::prepare('SELECT `id` FROM `*PREFIX*mimetypes` WHERE `mimetype` = ?');
+ $result = $query->execute(array('httpd/unix-directory'));
+ $row = $result->fetchRow();
+ return $row['id'];
+ }
+
+ static private function checkUpdate($id) {
+ $cacheItem = Cache::getById($id);
+ if (is_null($cacheItem)) {
+ return;
+ }
+ list($storageId, $internalPath) = $cacheItem;
+ $mounts = Filesystem::getMountByStorageId($storageId);
+
+ if (count($mounts) === 0) {
+ //if the storage we need isn't mounted on default, try to find a user that has access to the storage
+ $permissionsCache = new Permissions($storageId);
+ $users = $permissionsCache->getUsers($id);
+ if (count($users) === 0) {
+ return;
+ }
+ Filesystem::initMountPoints($users[0]);
+ $mounts = Filesystem::getMountByStorageId($storageId);
+ if (count($mounts) === 0) {
+ return;
+ }
+ }
+ $storage = $mounts[0]->getStorage();
+ $watcher = new Watcher($storage);
+ $watcher->checkUpdate($internalPath);
+ }
+
+ /**
+ * get the next fileid in the cache
+ *
+ * @param int $previous
+ * @param bool $folder
+ * @return int
+ */
+ static private function getNextFileId($previous, $folder) {
+ if ($folder) {
+ $query = \OC_DB::prepare('SELECT `fileid` FROM `*PREFIX*filecache` WHERE `fileid` > ? AND mimetype = ' . self::getFolderMimetype() . ' ORDER BY `fileid` ASC', 1);
+ } else {
+ $query = \OC_DB::prepare('SELECT `fileid` FROM `*PREFIX*filecache` WHERE `fileid` > ? AND mimetype != ' . self::getFolderMimetype() . ' ORDER BY `fileid` ASC', 1);
+ }
+ $result = $query->execute(array($previous));
+ if ($row = $result->fetchRow()) {
+ return $row['fileid'];
+ } else {
+ return 0;
+ }
+ }
+
+ static public function checkNext() {
+ // check both 1 file and 1 folder, this way new files are detected quicker because there are less folders than files usually
+ $previousFile = \OC_Appconfig::getValue('files', 'backgroundwatcher_previous_file', 0);
+ $previousFolder = \OC_Appconfig::getValue('files', 'backgroundwatcher_previous_folder', 0);
+ $nextFile = self::getNextFileId($previousFile, false);
+ $nextFolder = self::getNextFileId($previousFolder, true);
+ \OC_Appconfig::setValue('files', 'backgroundwatcher_previous_file', $nextFile);
+ \OC_Appconfig::setValue('files', 'backgroundwatcher_previous_folder', $nextFolder);
+ if ($nextFile > 0) {
+ self::checkUpdate($nextFile);
+ }
+ if ($nextFolder > 0) {
+ self::checkUpdate($nextFolder);
+ }
+ }
+
+ static public function checkAll() {
+ $previous = 0;
+ $next = 1;
+ while ($next != 0) {
+ $next = self::getNextFileId($previous, true);
+ self::checkUpdate($next);
+ }
+ $previous = 0;
+ $next = 1;
+ while ($next != 0) {
+ $next = self::getNextFileId($previous, false);
+ self::checkUpdate($next);
+ }
+ }
+}
diff --git a/lib/files/cache/cache.php b/lib/files/cache/cache.php
index 2413c05b8cd..0617471079b 100644
--- a/lib/files/cache/cache.php
+++ b/lib/files/cache/cache.php
@@ -30,11 +30,9 @@ class Cache {
private $storageId;
/**
- * numeric storage id
- *
- * @var int $numericId
+ * @var Storage $storageCache
*/
- private $numericId;
+ private $storageCache;
private $mimetypeIds = array();
private $mimetypes = array();
@@ -52,19 +50,11 @@ class Cache {
$this->storageId = md5($this->storageId);
}
- $query = \OC_DB::prepare('SELECT `numeric_id` FROM `*PREFIX*storages` WHERE `id` = ?');
- $result = $query->execute(array($this->storageId));
- if ($row = $result->fetchRow()) {
- $this->numericId = $row['numeric_id'];
- } else {
- $query = \OC_DB::prepare('INSERT INTO `*PREFIX*storages`(`id`) VALUES(?)');
- $query->execute(array($this->storageId));
- $this->numericId = \OC_DB::insertid('*PREFIX*storages');
- }
+ $this->storageCache = new Storage($storage);
}
public function getNumericStorageId() {
- return $this->numericId;
+ return $this->storageCache->getNumericId();
}
/**
@@ -111,7 +101,7 @@ class Cache {
public function get($file) {
if (is_string($file) or $file == '') {
$where = 'WHERE `storage` = ? AND `path_hash` = ?';
- $params = array($this->numericId, md5($file));
+ $params = array($this->getNumericStorageId(), md5($file));
} else { //file id
$where = 'WHERE `fileid` = ?';
$params = array($file);
@@ -204,12 +194,15 @@ class Cache {
list($queryParts, $params) = $this->buildParts($data);
$queryParts[] = '`storage`';
- $params[] = $this->numericId;
+ $params[] = $this->getNumericStorageId();
$valuesPlaceholder = array_fill(0, count($queryParts), '?');
$query = \OC_DB::prepare('INSERT INTO `*PREFIX*filecache`(' . implode(', ', $queryParts) . ')'
. ' VALUES(' . implode(', ', $valuesPlaceholder) . ')');
- $query->execute($params);
+ $result = $query->execute($params);
+ if (\OC_DB::isError($result)) {
+ \OCP\Util::writeLog('cache', 'Insert to cache failed: ' . $result, \OCP\Util::ERROR);
+ }
return (int)\OC_DB::insertid('*PREFIX*filecache');
}
@@ -272,7 +265,7 @@ class Cache {
$pathHash = md5($file);
$query = \OC_DB::prepare('SELECT `fileid` FROM `*PREFIX*filecache` WHERE `storage` = ? AND `path_hash` = ?');
- $result = $query->execute(array($this->numericId, $pathHash));
+ $result = $query->execute(array($this->getNumericStorageId(), $pathHash));
if ($row = $result->fetchRow()) {
return $row['fileid'];
@@ -336,24 +329,27 @@ class Cache {
* @param string $target
*/
public function move($source, $target) {
- $sourceId = $this->getId($source);
+ $sourceData = $this->get($source);
+ $sourceId = $sourceData['fileid'];
$newParentId = $this->getParentId($target);
- //find all child entries
- $query = \OC_DB::prepare('SELECT `path`, `fileid` FROM `*PREFIX*filecache` WHERE `path` LIKE ?');
- $result = $query->execute(array($source . '/%'));
- $childEntries = $result->fetchAll();
- $sourceLength = strlen($source);
- $query = \OC_DB::prepare('UPDATE `*PREFIX*filecache` SET `path` = ?, `path_hash` = ? WHERE `fileid` = ?');
-
- foreach ($childEntries as $child) {
- $targetPath = $target . substr($child['path'], $sourceLength);
- $query->execute(array($targetPath, md5($targetPath), $child['fileid']));
+ if ($sourceData['mimetype'] === 'httpd/unix-directory') {
+ //find all child entries
+ $query = \OC_DB::prepare('SELECT `path`, `fileid` FROM `*PREFIX*filecache` WHERE `path` LIKE ?');
+ $result = $query->execute(array($source . '/%'));
+ $childEntries = $result->fetchAll();
+ $sourceLength = strlen($source);
+ $query = \OC_DB::prepare('UPDATE `*PREFIX*filecache` SET `path` = ?, `path_hash` = ? WHERE `fileid` = ?');
+
+ foreach ($childEntries as $child) {
+ $targetPath = $target . substr($child['path'], $sourceLength);
+ $query->execute(array($targetPath, md5($targetPath), $child['fileid']));
+ }
}
- $query = \OC_DB::prepare('UPDATE `*PREFIX*filecache` SET `path` = ?, `path_hash` = ?, `parent` =?'
+ $query = \OC_DB::prepare('UPDATE `*PREFIX*filecache` SET `path` = ?, `path_hash` = ?, `name` = ?, `parent` =?'
. ' WHERE `fileid` = ?');
- $query->execute(array($target, md5($target), $newParentId, $sourceId));
+ $query->execute(array($target, md5($target), basename($target), $newParentId, $sourceId));
}
/**
@@ -361,7 +357,7 @@ class Cache {
*/
public function clear() {
$query = \OC_DB::prepare('DELETE FROM `*PREFIX*filecache` WHERE storage = ?');
- $query->execute(array($this->numericId));
+ $query->execute(array($this->getNumericStorageId()));
$query = \OC_DB::prepare('DELETE FROM `*PREFIX*storages` WHERE id = ?');
$query->execute(array($this->storageId));
@@ -375,7 +371,7 @@ class Cache {
public function getStatus($file) {
$pathHash = md5($file);
$query = \OC_DB::prepare('SELECT `size` FROM `*PREFIX*filecache` WHERE `storage` = ? AND `path_hash` = ?');
- $result = $query->execute(array($this->numericId, $pathHash));
+ $result = $query->execute(array($this->getNumericStorageId(), $pathHash));
if ($row = $result->fetchRow()) {
if ((int)$row['size'] === -1) {
return self::SHALLOW;
@@ -402,7 +398,7 @@ class Cache {
SELECT `fileid`, `storage`, `path`, `parent`, `name`, `mimetype`, `mimepart`, `size`, `mtime`, `encrypted`, `etag`
FROM `*PREFIX*filecache` WHERE `name` LIKE ? AND `storage` = ?'
);
- $result = $query->execute(array($pattern, $this->numericId));
+ $result = $query->execute(array($pattern, $this->getNumericStorageId()));
$files = array();
while ($row = $result->fetchRow()) {
$row['mimetype'] = $this->getMimetype($row['mimetype']);
@@ -429,7 +425,7 @@ class Cache {
FROM `*PREFIX*filecache` WHERE ' . $where . ' AND `storage` = ?'
);
$mimetype = $this->getMimetypeId($mimetype);
- $result = $query->execute(array($mimetype, $this->numericId));
+ $result = $query->execute(array($mimetype, $this->getNumericStorageId()));
$files = array();
while ($row = $result->fetchRow()) {
$row['mimetype'] = $this->getMimetype($row['mimetype']);
@@ -448,7 +444,7 @@ class Cache {
$this->calculateFolderSize($path);
if ($path !== '') {
$parent = dirname($path);
- if ($parent === '.') {
+ if ($parent === '.' or $parent === '/') {
$parent = '';
}
$this->correctFolderSize($parent);
@@ -467,7 +463,7 @@ class Cache {
return 0;
}
$query = \OC_DB::prepare('SELECT `size` FROM `*PREFIX*filecache` WHERE `parent` = ? AND `storage` = ?');
- $result = $query->execute(array($id, $this->numericId));
+ $result = $query->execute(array($id, $this->getNumericStorageId()));
$totalSize = 0;
$hasChilds = 0;
while ($row = $result->fetchRow()) {
@@ -494,7 +490,7 @@ class Cache {
*/
public function getAll() {
$query = \OC_DB::prepare('SELECT `fileid` FROM `*PREFIX*filecache` WHERE `storage` = ?');
- $result = $query->execute(array($this->numericId));
+ $result = $query->execute(array($this->getNumericStorageId()));
$ids = array();
while ($row = $result->fetchRow()) {
$ids[] = $row['fileid'];
@@ -514,7 +510,7 @@ class Cache {
public function getIncomplete() {
$query = \OC_DB::prepare('SELECT `path` FROM `*PREFIX*filecache`'
. ' WHERE `storage` = ? AND `size` = -1 ORDER BY `fileid` DESC LIMIT 1');
- $result = $query->execute(array($this->numericId));
+ $result = $query->execute(array($this->getNumericStorageId()));
if ($row = $result->fetchRow()) {
return $row['path'];
} else {
@@ -525,6 +521,7 @@ class Cache {
/**
* get the storage id of the storage for a file and the internal path of the file
*
+ * @param int $id
* @return array, first element holding the storage id, second the path
*/
static public function getById($id) {
@@ -537,10 +534,8 @@ class Cache {
return null;
}
- $query = \OC_DB::prepare('SELECT `id` FROM `*PREFIX*storages` WHERE `numeric_id` = ?');
- $result = $query->execute(array($numericId));
- if ($row = $result->fetchRow()) {
- return array($row['id'], $path);
+ if ($id = Storage::getStorageId($numericId)) {
+ return array($id, $path);
} else {
return null;
}
diff --git a/lib/files/cache/legacy.php b/lib/files/cache/legacy.php
index 2b8689fcbda..b8e2548639b 100644
--- a/lib/files/cache/legacy.php
+++ b/lib/files/cache/legacy.php
@@ -20,6 +20,11 @@ class Legacy {
$this->user = $user;
}
+ /**
+ * get the numbers of items in the legacy cache
+ *
+ * @return int
+ */
function getCount() {
$query = \OC_DB::prepare('SELECT COUNT(`id`) AS `count` FROM `*PREFIX*fscache` WHERE `user` = ?');
$result = $query->execute(array($this->user));
@@ -62,6 +67,8 @@ class Legacy {
}
/**
+ * get an item from the legacy cache
+ *
* @param string|int $path
* @return array
*/
@@ -72,16 +79,59 @@ class Legacy {
$query = \OC_DB::prepare('SELECT * FROM `*PREFIX*fscache` WHERE `path` = ?');
}
$result = $query->execute(array($path));
- return $result->fetchRow();
+ $data = $result->fetchRow();
+ $data['etag'] = $this->getEtag($data['path'], $data['user']);
+ return $data;
}
/**
+ * Get the ETag for the given path
+ *
+ * @param type $path
+ * @return string
+ */
+ function getEtag($path, $user = null) {
+ static $query = null;
+
+ $pathDetails = explode('/', $path, 4);
+ if((!$user) && !isset($pathDetails[1])) {
+ //no user!? Too odd, return empty string.
+ return '';
+ } else if(!$user) {
+ //guess user from path, if no user passed.
+ $user = $pathDetails[1];
+ }
+
+ if(!isset($pathDetails[3]) || is_null($pathDetails[3])) {
+ $relativePath = '';
+ } else {
+ $relativePath = $pathDetails[3];
+ }
+
+ if(is_null($query)){
+ $query = \OC_DB::prepare('SELECT `propertyvalue` FROM `*PREFIX*properties` WHERE `userid` = ? AND `propertypath` = ? AND `propertyname` = \'{DAV:}getetag\'');
+ }
+ $result = $query->execute(array($user, '/' . $relativePath));
+ if ($row = $result->fetchRow()) {
+ return trim($row['propertyvalue'], '"');
+ } else {
+ return '';
+ }
+ }
+
+ /**
+ * get all child items of an item from the legacy cache
+ *
* @param int $id
* @return array
*/
function getChildren($id) {
$query = \OC_DB::prepare('SELECT * FROM `*PREFIX*fscache` WHERE `parent` = ?');
$result = $query->execute(array($id));
- return $result->fetchAll();
+ $data = $result->fetchAll();
+ foreach ($data as $i => $item) {
+ $data[$i]['etag'] = $this->getEtag($item['path'], $item['user']);
+ }
+ return $data;
}
}
diff --git a/lib/files/cache/permissions.php b/lib/files/cache/permissions.php
index a5c9c144054..faa5ff5eacc 100644
--- a/lib/files/cache/permissions.php
+++ b/lib/files/cache/permissions.php
@@ -107,4 +107,19 @@ class Permissions {
$query->execute(array($fileId, $user));
}
}
+
+ /**
+ * get the list of users which have permissions stored for a file
+ *
+ * @param int $fileId
+ */
+ public function getUsers($fileId) {
+ $query = \OC_DB::prepare('SELECT `user` FROM `*PREFIX*permissions` WHERE `fileid` = ?');
+ $result = $query->execute(array($fileId));
+ $users = array();
+ while ($row = $result->fetchRow()) {
+ $users[] = $row['user'];
+ }
+ return $users;
+ }
}
diff --git a/lib/files/cache/scanner.php b/lib/files/cache/scanner.php
index 9c5ce9df7fc..a98953b42aa 100644
--- a/lib/files/cache/scanner.php
+++ b/lib/files/cache/scanner.php
@@ -63,36 +63,44 @@ class Scanner {
* @return array with metadata of the scanned file
*/
public function scanFile($file, $checkExisting = false) {
- \OC_Hook::emit('\OC\Files\Cache\Scanner', 'scan_file', array('path' => $file, 'storage' => $this->storageId));
- $data = $this->getData($file);
- if ($data) {
- if ($file) {
- $parent = dirname($file);
- if ($parent === '.') {
- $parent = '';
- }
- if (!$this->cache->inCache($parent)) {
- $this->scanFile($parent);
+ if ( ! self::isPartialFile($file)
+ and ! \OC\Files\Filesystem::isFileBlacklisted($file)
+ ) {
+ \OC_Hook::emit('\OC\Files\Cache\Scanner', 'scan_file', array('path' => $file, 'storage' => $this->storageId));
+ $data = $this->getData($file);
+ if ($data) {
+ if ($file) {
+ $parent = dirname($file);
+ if ($parent === '.' or $parent === '/') {
+ $parent = '';
+ }
+ if (!$this->cache->inCache($parent)) {
+ $this->scanFile($parent);
+ }
}
- }
- if ($checkExisting and $cacheData = $this->cache->get($file)) {
- if ($data['size'] === -1) {
- $data['size'] = $cacheData['size'];
+ if($cacheData = $this->cache->get($file)) {
+ if ($data['mtime'] === $cacheData['mtime'] &&
+ $data['size'] === $cacheData['size']) {
+ $data['etag'] = $cacheData['etag'];
+ }
}
- if ($data['mtime'] === $cacheData['mtime']) {
- $data['etag'] = $cacheData['etag'];
+ if ($checkExisting and $cacheData) {
+ if ($data['size'] === -1) {
+ $data['size'] = $cacheData['size'];
+ }
}
+ $this->cache->put($file, $data);
}
- $this->cache->put($file, $data);
+ return $data;
}
- return $data;
+ return null;
}
/**
* scan all the files in a folder and store them in the cache
*
* @param string $path
- * @param SCAN_RECURSIVE/SCAN_SHALLOW $recursive
+ * @param bool $recursive
* @param bool $onlyChilds
* @return int the size of the scanned folder or -1 if the size is unknown at this stage
*/
@@ -107,8 +115,8 @@ class Scanner {
if ($this->storage->is_dir($path) && ($dh = $this->storage->opendir($path))) {
\OC_DB::beginTransaction();
while ($file = readdir($dh)) {
- if (!$this->isIgnoredFile($file)) {
- $child = ($path) ? $path . '/' . $file : $file;
+ $child = ($path) ? $path . '/' . $file : $file;
+ if (!$this->isIgnoredDir($file)) {
$data = $this->scanFile($child, $recursive === self::SCAN_SHALLOW);
if ($data) {
if ($data['size'] === -1) {
@@ -143,16 +151,26 @@ class Scanner {
}
/**
+ * @brief check if the directory should be ignored when scanning
+ * NOTE: the special directories . and .. would cause never ending recursion
+ * @param String $dir
+ * @return boolean
+ */
+ private function isIgnoredDir($dir) {
+ if ($dir === '.' || $dir === '..') {
+ return true;
+ }
+ return false;
+ }
+ /**
* @brief check if the file should be ignored when scanning
* NOTE: files with a '.part' extension are ignored as well!
* prevents unfinished put requests to be scanned
* @param String $file
* @return boolean
*/
- private function isIgnoredFile($file) {
- if ($file === '.' || $file === '..'
- || pathinfo($file, PATHINFO_EXTENSION) === 'part'
- ) {
+ public static function isPartialFile($file) {
+ if (pathinfo($file, PATHINFO_EXTENSION) === 'part') {
return true;
}
return false;
@@ -162,9 +180,11 @@ class Scanner {
* walk over any folders that are not fully scanned yet and scan them
*/
public function backgroundScan() {
- while (($path = $this->cache->getIncomplete()) !== false) {
+ $lastPath = null;
+ while (($path = $this->cache->getIncomplete()) !== false && $path !== $lastPath) {
$this->scan($path);
$this->cache->correctFolderSize($path);
+ $lastPath = $path;
}
}
}
diff --git a/lib/files/cache/storage.php b/lib/files/cache/storage.php
new file mode 100644
index 00000000000..72de376798c
--- /dev/null
+++ b/lib/files/cache/storage.php
@@ -0,0 +1,59 @@
+<?php
+/**
+ * Copyright (c) 2013 Robin Appelman <icewind@owncloud.com>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+namespace OC\Files\Cache;
+
+/**
+ * Class Storage
+ *
+ * cache storage specific data
+ *
+ * @package OC\Files\Cache
+ */
+class Storage {
+ private $storageId;
+ private $numericId;
+
+ /**
+ * @param \OC\Files\Storage\Storage|string $storage
+ */
+ public function __construct($storage) {
+ if ($storage instanceof \OC\Files\Storage\Storage) {
+ $this->storageId = $storage->getId();
+ } else {
+ $this->storageId = $storage;
+ }
+ if (strlen($this->storageId) > 64) {
+ $this->storageId = md5($this->storageId);
+ }
+
+ $query = \OC_DB::prepare('SELECT `numeric_id` FROM `*PREFIX*storages` WHERE `id` = ?');
+ $result = $query->execute(array($this->storageId));
+ if ($row = $result->fetchRow()) {
+ $this->numericId = $row['numeric_id'];
+ } else {
+ $query = \OC_DB::prepare('INSERT INTO `*PREFIX*storages`(`id`) VALUES(?)');
+ $query->execute(array($this->storageId));
+ $this->numericId = \OC_DB::insertid('*PREFIX*storages');
+ }
+ }
+
+ public function getNumericId() {
+ return $this->numericId;
+ }
+
+ public static function getStorageId($numericId) {
+ $query = \OC_DB::prepare('SELECT `id` FROM `*PREFIX*storages` WHERE `numeric_id` = ?');
+ $result = $query->execute(array($numericId));
+ if ($row = $result->fetchRow()) {
+ return $row['id'];
+ } else {
+ return null;
+ }
+ }
+}
diff --git a/lib/files/cache/updater.php b/lib/files/cache/updater.php
index d04541c219f..417a47f3830 100644
--- a/lib/files/cache/updater.php
+++ b/lib/files/cache/updater.php
@@ -16,7 +16,7 @@ class Updater {
/**
* resolve a path to a storage and internal path
*
- * @param string $path
+ * @param string $path the relative path
* @return array consisting of the storage and the internal path
*/
static public function resolvePath($path) {
@@ -24,6 +24,11 @@ class Updater {
return $view->resolvePath($path);
}
+ /**
+ * preform a write update
+ *
+ * @param string $path the relative path of the file
+ */
static public function writeUpdate($path) {
/**
* @var \OC\Files\Storage\Storage $storage
@@ -39,6 +44,11 @@ class Updater {
}
}
+ /**
+ * preform a delete update
+ *
+ * @param string $path the relative path of the file
+ */
static public function deleteUpdate($path) {
/**
* @var \OC\Files\Storage\Storage $storage
@@ -54,11 +64,41 @@ class Updater {
}
/**
- * Update the mtime and ETag of all parent folders
- *
- * @param string $path
- * @param string $time
- */
+ * preform a rename update
+ *
+ * @param string $from the relative path of the source file
+ * @param string $to the relative path of the target file
+ */
+ static public function renameUpdate($from, $to) {
+ /**
+ * @var \OC\Files\Storage\Storage $storageFrom
+ * @var \OC\Files\Storage\Storage $storageTo
+ * @var string $internalFrom
+ * @var string $internalTo
+ */
+ list($storageFrom, $internalFrom) = self::resolvePath($from);
+ list($storageTo, $internalTo) = self::resolvePath($to);
+ if ($storageFrom && $storageTo) {
+ if ($storageFrom === $storageTo) {
+ $cache = $storageFrom->getCache($internalFrom);
+ $cache->move($internalFrom, $internalTo);
+ $cache->correctFolderSize($internalFrom);
+ $cache->correctFolderSize($internalTo);
+ self::correctFolder($from, time());
+ self::correctFolder($to, time());
+ } else {
+ self::deleteUpdate($from);
+ self::writeUpdate($to);
+ }
+ }
+ }
+
+ /**
+ * Update the mtime and ETag of all parent folders
+ *
+ * @param string $path
+ * @param string $time
+ */
static public function correctFolder($path, $time) {
if ($path !== '' && $path !== '/') {
$parent = dirname($path);
@@ -66,9 +106,9 @@ class Updater {
$parent = '';
}
/**
- * @var \OC\Files\Storage\Storage $storage
- * @var string $internalPath
- */
+ * @var \OC\Files\Storage\Storage $storage
+ * @var string $internalPath
+ */
list($storage, $internalPath) = self::resolvePath($parent);
if ($storage) {
$cache = $storage->getCache();
@@ -91,9 +131,22 @@ class Updater {
/**
* @param array $params
*/
+ static public function touchHook($params) {
+ $path = $params['path'];
+ list($storage, $internalPath) = self::resolvePath($path);
+ $cache = $storage->getCache();
+ $id = $cache->getId($internalPath);
+ if ($id !== -1) {
+ $cache->update($id, array('etag' => $storage->getETag($internalPath)));
+ }
+ self::writeUpdate($path);
+ }
+
+ /**
+ * @param array $params
+ */
static public function renameHook($params) {
- self::deleteUpdate($params['oldpath']);
- self::writeUpdate($params['newpath']);
+ self::renameUpdate($params['oldpath'], $params['newpath']);
}
/**
diff --git a/lib/files/cache/upgrade.php b/lib/files/cache/upgrade.php
index 811d82d7437..ca044ba81de 100644
--- a/lib/files/cache/upgrade.php
+++ b/lib/files/cache/upgrade.php
@@ -26,63 +26,77 @@ class Upgrade {
}
/**
- * Preform a shallow upgrade
+ * Preform a upgrade a path and it's childs
*
* @param string $path
- * @param int $mode
+ * @param bool $mode
*/
function upgradePath($path, $mode = Scanner::SCAN_RECURSIVE) {
if (!$this->legacy->hasItems()) {
return;
}
\OC_Hook::emit('\OC\Files\Cache\Upgrade', 'migrate_path', $path);
-
if ($row = $this->legacy->get($path)) {
$data = $this->getNewData($row);
- $this->insert($data);
-
- $this->upgradeChilds($data['id'], $mode);
+ if ($data) {
+ $this->insert($data);
+ $this->upgradeChilds($data['id'], $mode);
+ }
}
}
/**
+ * upgrade all child elements of an item
+ *
* @param int $id
+ * @param bool $mode
*/
function upgradeChilds($id, $mode = Scanner::SCAN_RECURSIVE) {
$children = $this->legacy->getChildren($id);
foreach ($children as $child) {
$childData = $this->getNewData($child);
\OC_Hook::emit('\OC\Files\Cache\Upgrade', 'migrate_path', $child['path']);
- $this->insert($childData);
- if ($mode == Scanner::SCAN_RECURSIVE) {
- $this->upgradeChilds($child['id']);
+ if ($childData) {
+ $this->insert($childData);
+ if ($mode == Scanner::SCAN_RECURSIVE) {
+ $this->upgradeChilds($child['id']);
+ }
}
}
}
/**
+ * insert data into the new cache
+ *
* @param array $data the data for the new cache
*/
function insert($data) {
- if (!$this->inCache($data['storage'], $data['path_hash'], $data['id'])) {
+ static $insertQuery = null;
+ if(is_null($insertQuery)) {
$insertQuery = \OC_DB::prepare('INSERT INTO `*PREFIX*filecache`
- ( `fileid`, `storage`, `path`, `path_hash`, `parent`, `name`, `mimetype`, `mimepart`, `size`, `mtime`, `encrypted` )
- VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)');
-
+ ( `fileid`, `storage`, `path`, `path_hash`, `parent`, `name`, `mimetype`, `mimepart`, `size`, `mtime`, `encrypted`, `etag` )
+ VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)');
+ }
+ if (!$this->inCache($data['storage'], $data['path_hash'], $data['id'])) {
$insertQuery->execute(array($data['id'], $data['storage'],
$data['path'], $data['path_hash'], $data['parent'], $data['name'],
- $data['mimetype'], $data['mimepart'], $data['size'], $data['mtime'], $data['encrypted']));
+ $data['mimetype'], $data['mimepart'], $data['size'], $data['mtime'], $data['encrypted'], $data['etag']));
}
}
/**
+ * check if an item is already in the new cache
+ *
* @param string $storage
* @param string $pathHash
* @param string $id
* @return bool
*/
function inCache($storage, $pathHash, $id) {
- $query = \OC_DB::prepare('SELECT `fileid` FROM `*PREFIX*filecache` WHERE (`storage` = ? AND `path_hash` = ?) OR `fileid` = ?');
+ static $query = null;
+ if(is_null($query)) {
+ $query = \OC_DB::prepare('SELECT `fileid` FROM `*PREFIX*filecache` WHERE (`storage` = ? AND `path_hash` = ?) OR `fileid` = ?');
+ }
$result = $query->execute(array($storage, $pathHash, $id));
return (bool)$result->fetchRow();
}
@@ -91,24 +105,53 @@ class Upgrade {
* get the new data array from the old one
*
* @param array $data the data from the old cache
+ * Example data array
+ * Array
+ * (
+ * [id] => 418
+ * [path] => /tina/files/picture.jpg //relative to datadir
+ * [path_hash] => 66d4547e372888deed80b24fec9b192b
+ * [parent] => 234
+ * [name] => picture.jpg
+ * [user] => tina
+ * [size] => 1265283
+ * [ctime] => 1363909709
+ * [mtime] => 1363909709
+ * [mimetype] => image/jpeg
+ * [mimepart] => image
+ * [encrypted] => 0
+ * [versioned] => 0
+ * [writable] => 1
+ * )
+ *
* @return array
*/
function getNewData($data) {
+ //Make sure there is a path, otherwise we can do nothing.
+ if(!isset($data['path'])) {
+ return false;
+ }
$newData = $data;
- list($storage, $internalPath) = \OC\Files\Filesystem::resolvePath($data['path']);
/**
* @var \OC\Files\Storage\Storage $storage
* @var string $internalPath;
*/
- $newData['path_hash'] = md5($internalPath);
- $newData['path'] = $internalPath;
- $newData['storage'] = $this->getNumericId($storage);
- $newData['parent'] = ($internalPath === '') ? -1 : $data['parent'];
- $newData['permissions'] = ($data['writable']) ? \OCP\PERMISSION_ALL : \OCP\PERMISSION_READ;
- $newData['storage_object'] = $storage;
- $newData['mimetype'] = $this->getMimetypeId($newData['mimetype'], $storage);
- $newData['mimepart'] = $this->getMimetypeId($newData['mimepart'], $storage);
- return $newData;
+ list($storage, $internalPath) = \OC\Files\Filesystem::resolvePath($data['path']);
+ if ($storage) {
+ $newData['etag'] = $data['etag'];
+ $newData['path_hash'] = md5($internalPath);
+ $newData['path'] = $internalPath;
+ $newData['storage'] = $this->getNumericId($storage);
+ $newData['parent'] = ($internalPath === '') ? -1 : $data['parent'];
+ $newData['permissions'] = ($data['writable']) ? \OCP\PERMISSION_ALL : \OCP\PERMISSION_READ;
+ $newData['storage_object'] = $storage;
+ $newData['mimetype'] = $this->getMimetypeId($newData['mimetype'], $storage);
+ $newData['mimepart'] = $this->getMimetypeId($newData['mimepart'], $storage);
+ return $newData;
+ } else {
+ \OC_Log::write('core', 'Unable to migrate data from old cache for '.$data['path'].' because the storage was not found', \OC_Log::ERROR);
+ return false;
+ }
}
/**
@@ -127,6 +170,8 @@ class Upgrade {
}
/**
+ * get the numeric id for a mimetype
+ *
* @param string $mimetype
* @param \OC\Files\Storage\Storage $storage
* @return int
@@ -158,4 +203,25 @@ class Upgrade {
static function upgradeDone($user) {
\OCP\Config::setUserValue($user, 'files', 'cache_version', 5);
}
+
+ /**
+ * Does a "silent" upgrade, i.e. without an Event-Source as triggered
+ * on User-Login via Ajax. This method is called within the regular
+ * ownCloud upgrade.
+ *
+ * @param string $user a User ID
+ */
+ public static function doSilentUpgrade($user) {
+ if(!self::needUpgrade($user)) {
+ return;
+ }
+ $legacy = new \OC\Files\Cache\Legacy($user);
+ if ($legacy->hasItems()) {
+ \OC_DB::beginTransaction();
+ $upgrade = new \OC\Files\Cache\Upgrade($legacy);
+ $upgrade->upgradePath('/' . $user . '/files');
+ \OC_DB::commit();
+ }
+ \OC\Files\Cache\Upgrade::upgradeDone($user);
+ }
}
diff --git a/lib/files/filesystem.php b/lib/files/filesystem.php
index 0bbd7550d74..d60d430d77c 100644
--- a/lib/files/filesystem.php
+++ b/lib/files/filesystem.php
@@ -23,6 +23,7 @@
* post_rename(oldpath,newpath)
* copy(oldpath,newpath, &run) (if the newpath doesn't exists yes, copy, create and write will be emitted in that order)
* post_rename(oldpath,newpath)
+ * post_initMountPoints(user, user_dir)
*
* the &run parameter can be set to false to prevent the operation from occurring
*/
@@ -30,8 +31,14 @@
namespace OC\Files;
const FREE_SPACE_UNKNOWN = -2;
+const FREE_SPACE_UNLIMITED = -3;
class Filesystem {
+ /**
+ * @var Mount\Manager $mounts
+ */
+ private static $mounts;
+
public static $loaded = false;
/**
* @var \OC\Files\View $defaultInstance
@@ -145,7 +152,7 @@ class Filesystem {
* @return string
*/
static public function getMountPoint($path) {
- $mount = Mount::find($path);
+ $mount = self::$mounts->find($path);
if ($mount) {
return $mount->getMountPoint();
} else {
@@ -161,7 +168,7 @@ class Filesystem {
*/
static public function getMountPoints($path) {
$result = array();
- $mounts = Mount::findIn($path);
+ $mounts = self::$mounts->findIn($path);
foreach ($mounts as $mount) {
$result[] = $mount->getMountPoint();
}
@@ -175,18 +182,34 @@ class Filesystem {
* @return \OC\Files\Storage\Storage
*/
public static function getStorage($mountPoint) {
- $mount = Mount::find($mountPoint);
+ $mount = self::$mounts->find($mountPoint);
return $mount->getStorage();
}
/**
+ * @param $id
+ * @return Mount\Mount[]
+ */
+ public static function getMountByStorageId($id) {
+ return self::$mounts->findByStorageId($id);
+ }
+
+ /**
+ * @param $id
+ * @return Mount\Mount[]
+ */
+ public static function getMountByNumericId($id) {
+ return self::$mounts->findByNumericId($id);
+ }
+
+ /**
* resolve a path to a storage and internal path
*
* @param string $path
* @return array consisting of the storage and the internal path
*/
static public function resolvePath($path) {
- $mount = Mount::find($path);
+ $mount = self::$mounts->find($path);
if ($mount) {
return array($mount->getStorage(), $mount->getInternalPath($path));
} else {
@@ -200,6 +223,10 @@ class Filesystem {
}
self::$defaultInstance = new View($root);
+ if(!self::$mounts) {
+ self::$mounts = new Mount\Manager();
+ }
+
//load custom mount config
self::initMountPoints($user);
@@ -208,6 +235,10 @@ class Filesystem {
return true;
}
+ static public function initMounts(){
+ self::$mounts = new Mount\Manager();
+ }
+
/**
* Initialize system and personal mount points for a user
*
@@ -221,11 +252,16 @@ class Filesystem {
$root = \OC_User::getHome($user);
self::mount('\OC\Files\Storage\Local', array('datadir' => $root), $user);
+ $datadir = \OC_Config::getValue("datadirectory", \OC::$SERVERROOT . "/data");
+ //move config file to it's new position
+ if (is_file(\OC::$SERVERROOT . '/config/mount.json')) {
+ rename(\OC::$SERVERROOT . '/config/mount.json', $datadir . '/mount.json');
+ }
// Load system mount points
- if (is_file(\OC::$SERVERROOT . '/config/mount.php') or is_file(\OC::$SERVERROOT . '/config/mount.json')) {
- if (is_file(\OC::$SERVERROOT . '/config/mount.json')) {
- $mountConfig = json_decode(file_get_contents(\OC::$SERVERROOT . '/config/mount.json'), true);
+ if (is_file(\OC::$SERVERROOT . '/config/mount.php') or is_file($datadir . '/mount.json')) {
+ if (is_file($datadir . '/mount.json')) {
+ $mountConfig = json_decode(file_get_contents($datadir . '/mount.json'), true);
} elseif (is_file(\OC::$SERVERROOT . '/config/mount.php')) {
$mountConfig = $parser->parsePHP(file_get_contents(\OC::$SERVERROOT . '/config/mount.php'));
}
@@ -249,7 +285,7 @@ class Filesystem {
}
if (isset($mountConfig['user'])) {
foreach ($mountConfig['user'] as $mountUser => $mounts) {
- if ($user === 'all' or strtolower($mountUser) === strtolower($user)) {
+ if ($mountUser === 'all' or strtolower($mountUser) === strtolower($user)) {
foreach ($mounts as $mountPoint => $options) {
$mountPoint = self::setUserVars($user, $mountPoint);
foreach ($options as &$option) {
@@ -274,12 +310,15 @@ class Filesystem {
}
}
}
+
+ // Chance to mount for other storages
+ \OC_Hook::emit('OC_Filesystem', 'post_initMountPoints', array('user' => $user, 'user_dir' => $root));
}
/**
- * fill in the correct values for $user, and $password placeholders
+ * fill in the correct values for $user
*
- * @param string $input
+ * @param string $user
* @param string $input
* @return string
*/
@@ -301,6 +340,7 @@ class Filesystem {
*/
static public function tearDown() {
self::clearMounts();
+ self::$defaultInstance = null;
}
/**
@@ -317,7 +357,7 @@ class Filesystem {
* clear all mounts and storage backends
*/
public static function clearMounts() {
- Mount::clear();
+ self::$mounts->clear();
}
/**
@@ -328,7 +368,8 @@ class Filesystem {
* @param string $mountpoint
*/
static public function mount($class, $arguments, $mountpoint) {
- new Mount($class, $mountpoint, $arguments);
+ $mount = new Mount\Mount($class, $mountpoint, $arguments);
+ self::$mounts->addMount($mount);
}
/**
@@ -615,10 +656,11 @@ class Filesystem {
* get the content of a directory
*
* @param string $directory path under datadirectory
+ * @param string $mimetype_filter limit returned content to this mimetype or mimepart
* @return array
*/
- public static function getDirectoryContent($directory) {
- return self::$defaultInstance->getDirectoryContent($directory);
+ public static function getDirectoryContent($directory, $mimetype_filter = '') {
+ return self::$defaultInstance->getDirectoryContent($directory, $mimetype_filter);
}
/**
@@ -654,8 +696,4 @@ class Filesystem {
}
}
-\OC_Hook::connect('OC_Filesystem', 'post_write', '\OC\Files\Cache\Updater', 'writeHook');
-\OC_Hook::connect('OC_Filesystem', 'post_delete', '\OC\Files\Cache\Updater', 'deleteHook');
-\OC_Hook::connect('OC_Filesystem', 'post_rename', '\OC\Files\Cache\Updater', 'renameHook');
-
\OC_Util::setupFS();
diff --git a/lib/files/mapper.php b/lib/files/mapper.php
index 520fadbd8c6..15f5f0628b5 100644
--- a/lib/files/mapper.php
+++ b/lib/files/mapper.php
@@ -77,7 +77,9 @@ class Mapper
$result = $query->execute(array($path1.'%'));
$updateQuery = \OC_DB::prepare('UPDATE `*PREFIX*file_map`'
.' SET `logic_path` = ?'
- .' AND `physic_path` = ?'
+ .' , `logic_path_hash` = ?'
+ .' , `physic_path` = ?'
+ .' , `physic_path_hash` = ?'
.' WHERE `logic_path` = ?');
while( $row = $result->fetchRow()) {
$currentLogic = $row['logic_path'];
@@ -86,7 +88,7 @@ class Mapper
$newPhysic = $physicPath2.$this->stripRootFolder($currentPhysic, $physicPath1);
if ($path1 !== $currentLogic) {
try {
- $updateQuery->execute(array($newLogic, $newPhysic, $currentLogic));
+ $updateQuery->execute(array($newLogic, md5($newLogic), $newPhysic, md5($newPhysic), $currentLogic));
} catch (\Exception $e) {
error_log('Mapper::Copy failed '.$currentLogic.' -> '.$newLogic.'\n'.$e);
throw $e;
@@ -149,7 +151,7 @@ class Mapper
// detect duplicates
while ($this->resolvePhysicalPath($physicalPath) !== null) {
- $physicalPath = $this->slugifyPath($physicalPath, $index++);
+ $physicalPath = $this->slugifyPath($logicPath, $index++);
}
// insert the new path mapping if requested
@@ -165,32 +167,41 @@ class Mapper
$query->execute(array($logicPath, $physicalPath, md5($logicPath), md5($physicalPath)));
}
- private function slugifyPath($path, $index=null) {
+ public function slugifyPath($path, $index=null) {
$path = $this->stripRootFolder($path, $this->unchangedPhysicalRoot);
$pathElements = explode('/', $path);
$sluggedElements = array();
+ // rip off the extension ext from last element
+ $last= end($pathElements);
+ $parts = pathinfo($last);
+ $filename = $parts['filename'];
+ array_pop($pathElements);
+ array_push($pathElements, $filename);
+
foreach ($pathElements as $pathElement) {
// remove empty elements
if (empty($pathElement)) {
continue;
}
- // TODO: remove file ext before slugify on last element
$sluggedElements[] = self::slugify($pathElement);
}
- //
- // TODO: add the index before the file extension
- //
+ // apply index to file name
if ($index !== null) {
- $last= end($sluggedElements);
- array_pop($sluggedElements);
+ $last= array_pop($sluggedElements);
array_push($sluggedElements, $last.'-'.$index);
}
- $sluggedPath = $this->unchangedPhysicalRoot.implode(DIRECTORY_SEPARATOR, $sluggedElements);
+ // add back the extension
+ if (isset($parts['extension'])) {
+ $last= array_pop($sluggedElements);
+ array_push($sluggedElements, $last.'.'.$parts['extension']);
+ }
+
+ $sluggedPath = $this->unchangedPhysicalRoot.implode('/', $sluggedElements);
return $this->stripLast($sluggedPath);
}
@@ -210,7 +221,7 @@ class Mapper
// transliterate
if (function_exists('iconv')) {
- $text = iconv('utf-8', 'us-ascii//TRANSLIT', $text);
+ $text = iconv('utf-8', 'us-ascii//TRANSLIT//IGNORE', $text);
}
// lowercase
@@ -219,10 +230,8 @@ class Mapper
// remove unwanted characters
$text = preg_replace('~[^-\w]+~', '', $text);
- if (empty($text))
- {
- // TODO: we better generate a guid in this case
- return 'n-a';
+ if (empty($text)) {
+ return uniqid();
}
return $text;
diff --git a/lib/files/mount/manager.php b/lib/files/mount/manager.php
new file mode 100644
index 00000000000..25a5fe241cc
--- /dev/null
+++ b/lib/files/mount/manager.php
@@ -0,0 +1,120 @@
+<?php
+/**
+ * Copyright (c) 2012 Robin Appelman <icewind@owncloud.com>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+namespace OC\Files\Mount;
+
+use \OC\Files\Filesystem;
+
+class Manager {
+ /**
+ * @var Mount[]
+ */
+ private $mounts = array();
+
+ /**
+ * @param Mount $mount
+ */
+ public function addMount($mount) {
+ $this->mounts[$mount->getMountPoint()] = $mount;
+ }
+
+ /**
+ * Find the mount for $path
+ *
+ * @param $path
+ * @return Mount
+ */
+ public function find($path) {
+ \OC_Util::setupFS();
+ $path = $this->formatPath($path);
+ if (isset($this->mounts[$path])) {
+ return $this->mounts[$path];
+ }
+
+ \OC_Hook::emit('OC_Filesystem', 'get_mountpoint', array('path' => $path));
+ $foundMountPoint = '';
+ $mountPoints = array_keys($this->mounts);
+ foreach ($mountPoints as $mountpoint) {
+ if (strpos($path, $mountpoint) === 0 and strlen($mountpoint) > strlen($foundMountPoint)) {
+ $foundMountPoint = $mountpoint;
+ }
+ }
+ if (isset($this->mounts[$foundMountPoint])) {
+ return $this->mounts[$foundMountPoint];
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * Find all mounts in $path
+ *
+ * @param $path
+ * @return Mount[]
+ */
+ public function findIn($path) {
+ \OC_Util::setupFS();
+ $path = $this->formatPath($path);
+ $result = array();
+ $pathLength = strlen($path);
+ $mountPoints = array_keys($this->mounts);
+ foreach ($mountPoints as $mountPoint) {
+ if (substr($mountPoint, 0, $pathLength) === $path and strlen($mountPoint) > $pathLength) {
+ $result[] = $this->mounts[$mountPoint];
+ }
+ }
+ return $result;
+ }
+
+ public function clear() {
+ $this->mounts = array();
+ }
+
+ /**
+ * Find mounts by storage id
+ *
+ * @param string $id
+ * @return Mount[]
+ */
+ public function findByStorageId($id) {
+ \OC_Util::setupFS();
+ if (strlen($id) > 64) {
+ $id = md5($id);
+ }
+ $result = array();
+ foreach ($this->mounts as $mount) {
+ if ($mount->getStorageId() === $id) {
+ $result[] = $mount;
+ }
+ }
+ return $result;
+ }
+
+ /**
+ * Find mounts by numeric storage id
+ *
+ * @param string $id
+ * @return Mount
+ */
+ public function findByNumericId($id) {
+ $storageId = \OC\Files\Cache\Storage::getStorageId($id);
+ return $this->findByStorageId($storageId);
+ }
+
+ /**
+ * @param string $path
+ * @return string
+ */
+ private function formatPath($path) {
+ $path = Filesystem::normalizePath($path);
+ if (strlen($path) > 1) {
+ $path .= '/';
+ }
+ return $path;
+ }
+}
diff --git a/lib/files/mount.php b/lib/files/mount/mount.php
index 1c9382d78e7..69b8285ab4c 100644
--- a/lib/files/mount.php
+++ b/lib/files/mount/mount.php
@@ -6,13 +6,12 @@
* See the COPYING-README file.
*/
-namespace OC\Files;
+namespace OC\Files\Mount;
+
+use \OC\Files\Filesystem;
class Mount {
- /**
- * @var Mount[]
- */
- static private $mounts = array();
+
/**
* @var \OC\Files\Storage\Storage $storage
@@ -33,7 +32,7 @@ class Mount {
$arguments = array();
}
- $mountpoint = self::formatPath($mountpoint);
+ $mountpoint = $this->formatPath($mountpoint);
if ($storage instanceof \OC\Files\Storage\Storage) {
$this->class = get_class($storage);
$this->storage = $storage;
@@ -46,8 +45,6 @@ class Mount {
$this->arguments = $arguments;
}
$this->mountPoint = $mountpoint;
-
- self::$mounts[$this->mountPoint] = $this;
}
/**
@@ -58,6 +55,8 @@ class Mount {
}
/**
+ * create the storage that is mounted
+ *
* @return \OC\Files\Storage\Storage
*/
private function createStorage() {
@@ -90,7 +89,11 @@ class Mount {
public function getStorageId() {
if (!$this->storageId) {
if (is_null($this->storage)) {
- $this->storage = $this->createStorage();
+ $storage = $this->createStorage(); //FIXME: start using exceptions
+ if (is_null($storage)) {
+ return null;
+ }
+ $this->storage = $storage;
}
$this->storageId = $this->storage->getId();
if (strlen($this->storageId) > 64) {
@@ -117,100 +120,11 @@ class Mount {
* @param string $path
* @return string
*/
- private static function formatPath($path) {
+ private function formatPath($path) {
$path = Filesystem::normalizePath($path);
if (strlen($path) > 1) {
$path .= '/';
}
return $path;
}
-
- /**
- * Find the mount for $path
- *
- * @param $path
- * @return Mount
- */
- public static function find($path) {
- $path = self::formatPath($path);
- if (isset(self::$mounts[$path])) {
- return self::$mounts[$path];
- }
-
- \OC_Hook::emit('OC_Filesystem', 'get_mountpoint', array('path' => $path));
- $foundMountPoint = '';
- $mountPoints = array_keys(self::$mounts);
- foreach ($mountPoints as $mountpoint) {
- if (strpos($path, $mountpoint) === 0 and strlen($mountpoint) > strlen($foundMountPoint)) {
- $foundMountPoint = $mountpoint;
- }
- }
- if (isset(self::$mounts[$foundMountPoint])) {
- return self::$mounts[$foundMountPoint];
- } else {
- return null;
- }
- }
-
- /**
- * Find all mounts in $path
- *
- * @param $path
- * @return Mount[]
- */
- public static function findIn($path) {
- $path = self::formatPath($path);
- $result = array();
- $pathLength = strlen($path);
- $mountPoints = array_keys(self::$mounts);
- foreach ($mountPoints as $mountPoint) {
- if (substr($mountPoint, 0, $pathLength) === $path and strlen($mountPoint) > $pathLength) {
- $result[] = self::$mounts[$mountPoint];
- }
- }
- return $result;
- }
-
- public static function clear() {
- self::$mounts = array();
- }
-
- /**
- * Find mounts by storage id
- *
- * @param string $id
- * @return Mount[]
- */
- public static function findByStorageId($id) {
- if (strlen($id) > 64) {
- $id = md5($id);
- }
- $result = array();
- foreach (self::$mounts as $mount) {
- if ($mount->getStorageId() === $id) {
- $result[] = $mount;
- }
- }
- return $result;
- }
-
- /**
- * Find mounts by numeric storage id
- *
- * @param string $id
- * @return Mount
- */
- public static function findByNumericId($id) {
- $query = \OC_DB::prepare('SELECT `id` FROM `*PREFIX*storages` WHERE `numeric_id` = ?');
- $result = $query->execute(array($id))->fetchOne();
- if ($result) {
- $id = $result;
- foreach (self::$mounts as $mount) {
- if ($mount->getStorageId() === $id) {
- return $mount;
- }
- }
- }
- return false;
- }
}
diff --git a/lib/files/storage/common.php b/lib/files/storage/common.php
index 8aa227ec0b7..e87fe3b5239 100644
--- a/lib/files/storage/common.php
+++ b/lib/files/storage/common.php
@@ -21,6 +21,11 @@ namespace OC\Files\Storage;
*/
abstract class Common implements \OC\Files\Storage\Storage {
+ private $cache;
+ private $scanner;
+ private $permissioncache;
+ private $watcher;
+ private $storageCache;
public function __construct($parameters) {
}
@@ -269,19 +274,38 @@ abstract class Common implements \OC\Files\Storage\Storage {
}
public function getCache($path = '') {
- return new \OC\Files\Cache\Cache($this);
+ if (!isset($this->cache)) {
+ $this->cache = new \OC\Files\Cache\Cache($this);
+ }
+ return $this->cache;
}
public function getScanner($path = '') {
- return new \OC\Files\Cache\Scanner($this);
+ if (!isset($this->scanner)) {
+ $this->scanner = new \OC\Files\Cache\Scanner($this);
+ }
+ return $this->scanner;
}
public function getPermissionsCache($path = '') {
- return new \OC\Files\Cache\Permissions($this);
+ if (!isset($this->permissioncache)) {
+ $this->permissioncache = new \OC\Files\Cache\Permissions($this);
+ }
+ return $this->permissioncache;
}
public function getWatcher($path = '') {
- return new \OC\Files\Cache\Watcher($this);
+ if (!isset($this->watcher)) {
+ $this->watcher = new \OC\Files\Cache\Watcher($this);
+ }
+ return $this->watcher;
+ }
+
+ public function getStorageCache(){
+ if (!isset($this->storageCache)) {
+ $this->storageCache = new \OC\Files\Cache\Storage($this);
+ }
+ return $this->storageCache;
}
/**
@@ -345,7 +369,7 @@ abstract class Common implements \OC\Files\Storage\Storage {
* get the free space in the storage
*
* @param $path
- * return int
+ * @return int
*/
public function free_space($path) {
return \OC\Files\FREE_SPACE_UNKNOWN;
diff --git a/lib/files/storage/local.php b/lib/files/storage/local.php
index da6597c8057..d684905bf9a 100644
--- a/lib/files/storage/local.php
+++ b/lib/files/storage/local.php
@@ -14,245 +14,277 @@ if (\OC_Util::runningOnWindows()) {
}
} else {
-/**
- * for local filestore, we only have to map the paths
- */
-class Local extends \OC\Files\Storage\Common{
- protected $datadir;
- public function __construct($arguments) {
- $this->datadir=$arguments['datadir'];
- if(substr($this->datadir, -1)!=='/') {
- $this->datadir.='/';
+ /**
+ * for local filestore, we only have to map the paths
+ */
+ class Local extends \OC\Files\Storage\Common {
+ protected $datadir;
+
+ public function __construct($arguments) {
+ $this->datadir = $arguments['datadir'];
+ if (substr($this->datadir, -1) !== '/') {
+ $this->datadir .= '/';
+ }
}
- }
- public function __destruct() {
- }
- public function getId(){
- return 'local::'.$this->datadir;
- }
- public function mkdir($path) {
- return @mkdir($this->datadir.$path);
- }
- public function rmdir($path) {
- return @rmdir($this->datadir.$path);
- }
- public function opendir($path) {
- return opendir($this->datadir.$path);
- }
- public function is_dir($path) {
- if(substr($path, -1)=='/') {
- $path=substr($path, 0, -1);
+
+ public function __destruct() {
}
- return is_dir($this->datadir.$path);
- }
- public function is_file($path) {
- return is_file($this->datadir.$path);
- }
- public function stat($path) {
- $fullPath = $this->datadir . $path;
- $statResult = stat($fullPath);
- if ($statResult['size'] < 0) {
- $size = self::getFileSizeFromOS($fullPath);
- $statResult['size'] = $size;
- $statResult[7] = $size;
+ public function getId() {
+ return 'local::' . $this->datadir;
}
- return $statResult;
- }
- public function filetype($path) {
- $filetype=filetype($this->datadir.$path);
- if($filetype=='link') {
- $filetype=filetype(realpath($this->datadir.$path));
+
+ public function mkdir($path) {
+ return @mkdir($this->datadir . $path);
}
- return $filetype;
- }
- public function filesize($path) {
- if($this->is_dir($path)) {
- return 0;
- }else{
+
+ public function rmdir($path) {
+ return @rmdir($this->datadir . $path);
+ }
+
+ public function opendir($path) {
+ return opendir($this->datadir . $path);
+ }
+
+ public function is_dir($path) {
+ if (substr($path, -1) == '/') {
+ $path = substr($path, 0, -1);
+ }
+ return is_dir($this->datadir . $path);
+ }
+
+ public function is_file($path) {
+ return is_file($this->datadir . $path);
+ }
+
+ public function stat($path) {
$fullPath = $this->datadir . $path;
- $fileSize = filesize($fullPath);
- if ($fileSize < 0) {
- return self::getFileSizeFromOS($fullPath);
+ $statResult = stat($fullPath);
+
+ if ($statResult['size'] < 0) {
+ $size = self::getFileSizeFromOS($fullPath);
+ $statResult['size'] = $size;
+ $statResult[7] = $size;
}
+ return $statResult;
+ }
- return $fileSize;
+ public function filetype($path) {
+ $filetype = filetype($this->datadir . $path);
+ if ($filetype == 'link') {
+ $filetype = filetype(realpath($this->datadir . $path));
+ }
+ return $filetype;
}
- }
- public function isReadable($path) {
- return is_readable($this->datadir.$path);
- }
- public function isUpdatable($path) {
- return is_writable($this->datadir.$path);
- }
- public function file_exists($path) {
- return file_exists($this->datadir.$path);
- }
- public function filemtime($path) {
- return filemtime($this->datadir.$path);
- }
- public function touch($path, $mtime=null) {
- // sets the modification time of the file to the given value.
- // If mtime is nil the current time is set.
- // note that the access time of the file always changes to the current time.
- if(!is_null($mtime)) {
- $result=touch( $this->datadir.$path, $mtime );
- }else{
- $result=touch( $this->datadir.$path);
+
+ public function filesize($path) {
+ if ($this->is_dir($path)) {
+ return 0;
+ } else {
+ $fullPath = $this->datadir . $path;
+ $fileSize = filesize($fullPath);
+ if ($fileSize < 0) {
+ return self::getFileSizeFromOS($fullPath);
+ }
+
+ return $fileSize;
+ }
}
- if( $result ) {
- clearstatcache( true, $this->datadir.$path );
+
+ public function isReadable($path) {
+ return is_readable($this->datadir . $path);
}
- return $result;
- }
- public function file_get_contents($path) {
- return file_get_contents($this->datadir.$path);
- }
- public function file_put_contents($path, $data) {//trigger_error("$path = ".var_export($path, 1));
- return file_put_contents($this->datadir.$path, $data);
- }
- public function unlink($path) {
- return $this->delTree($path);
- }
- public function rename($path1, $path2) {
- if (!$this->isUpdatable($path1)) {
- \OC_Log::write('core', 'unable to rename, file is not writable : '.$path1, \OC_Log::ERROR);
- return false;
+ public function isUpdatable($path) {
+ return is_writable($this->datadir . $path);
}
- if(! $this->file_exists($path1)) {
- \OC_Log::write('core', 'unable to rename, file does not exists : '.$path1, \OC_Log::ERROR);
- return false;
+
+ public function file_exists($path) {
+ return file_exists($this->datadir . $path);
}
- if($return=rename($this->datadir.$path1, $this->datadir.$path2)) {
+ public function filemtime($path) {
+ return filemtime($this->datadir . $path);
}
- return $return;
- }
- public function copy($path1, $path2) {
- if($this->is_dir($path2)) {
- if(!$this->file_exists($path2)) {
- $this->mkdir($path2);
+
+ public function touch($path, $mtime = null) {
+ // sets the modification time of the file to the given value.
+ // If mtime is nil the current time is set.
+ // note that the access time of the file always changes to the current time.
+ if ($this->file_exists($path) and !$this->isUpdatable($path)) {
+ return false;
+ }
+ if (!is_null($mtime)) {
+ $result = touch($this->datadir . $path, $mtime);
+ } else {
+ $result = touch($this->datadir . $path);
}
- $source=substr($path1, strrpos($path1, '/')+1);
- $path2.=$source;
+ if ($result) {
+ clearstatcache(true, $this->datadir . $path);
+ }
+
+ return $result;
}
- return copy($this->datadir.$path1, $this->datadir.$path2);
- }
- public function fopen($path, $mode) {
- if($return=fopen($this->datadir.$path, $mode)) {
- switch($mode) {
- case 'r':
- break;
- case 'r+':
- case 'w+':
- case 'x+':
- case 'a+':
- break;
- case 'w':
- case 'x':
- case 'a':
- break;
+
+ public function file_get_contents($path) {
+ return file_get_contents($this->datadir . $path);
+ }
+
+ public function file_put_contents($path, $data) { //trigger_error("$path = ".var_export($path, 1));
+ return file_put_contents($this->datadir . $path, $data);
+ }
+
+ public function unlink($path) {
+ return $this->delTree($path);
+ }
+
+ public function rename($path1, $path2) {
+ if (!$this->isUpdatable($path1)) {
+ \OC_Log::write('core', 'unable to rename, file is not writable : ' . $path1, \OC_Log::ERROR);
+ return false;
+ }
+ if (!$this->file_exists($path1)) {
+ \OC_Log::write('core', 'unable to rename, file does not exists : ' . $path1, \OC_Log::ERROR);
+ return false;
+ }
+
+ if ($return = rename($this->datadir . $path1, $this->datadir . $path2)) {
}
+ return $return;
}
- return $return;
- }
- public function getMimeType($path) {
- if($this->isReadable($path)) {
- return \OC_Helper::getMimeType($this->datadir . $path);
- }else{
- return false;
+ public function copy($path1, $path2) {
+ if ($this->is_dir($path2)) {
+ if (!$this->file_exists($path2)) {
+ $this->mkdir($path2);
+ }
+ $source = substr($path1, strrpos($path1, '/') + 1);
+ $path2 .= $source;
+ }
+ return copy($this->datadir . $path1, $this->datadir . $path2);
}
- }
- private function delTree($dir) {
- $dirRelative=$dir;
- $dir=$this->datadir.$dir;
- if (!file_exists($dir)) return true;
- if (!is_dir($dir) || is_link($dir)) return unlink($dir);
- foreach (scandir($dir) as $item) {
- if ($item == '.' || $item == '..') continue;
- if(is_file($dir.'/'.$item)) {
- if(unlink($dir.'/'.$item)) {
+ public function fopen($path, $mode) {
+ if ($return = fopen($this->datadir . $path, $mode)) {
+ switch ($mode) {
+ case 'r':
+ break;
+ case 'r+':
+ case 'w+':
+ case 'x+':
+ case 'a+':
+ break;
+ case 'w':
+ case 'x':
+ case 'a':
+ break;
}
- }elseif(is_dir($dir.'/'.$item)) {
- if (!$this->delTree($dirRelative. "/" . $item)) {
- return false;
- };
}
+ return $return;
}
- if($return=rmdir($dir)) {
+
+ public function getMimeType($path) {
+ if ($this->isReadable($path)) {
+ return \OC_Helper::getMimeType($this->datadir . $path);
+ } else {
+ return false;
+ }
}
- return $return;
- }
- private static function getFileSizeFromOS($fullPath) {
- $name = strtolower(php_uname('s'));
- // Windows OS: we use COM to access the filesystem
- if (strpos($name, 'win') !== false) {
- if (class_exists('COM')) {
- $fsobj = new \COM("Scripting.FileSystemObject");
- $f = $fsobj->GetFile($fullPath);
- return $f->Size;
+ private function delTree($dir) {
+ $dirRelative = $dir;
+ $dir = $this->datadir . $dir;
+ if (!file_exists($dir)) return true;
+ if (!is_dir($dir) || is_link($dir)) return unlink($dir);
+ foreach (scandir($dir) as $item) {
+ if ($item == '.' || $item == '..') continue;
+ if (is_file($dir . '/' . $item)) {
+ if (unlink($dir . '/' . $item)) {
+ }
+ } elseif (is_dir($dir . '/' . $item)) {
+ if (!$this->delTree($dirRelative . "/" . $item)) {
+ return false;
+ };
+ }
}
- } else if (strpos($name, 'bsd') !== false) {
- if (\OC_Helper::is_function_enabled('exec')) {
- return (float)exec('stat -f %z ' . escapeshellarg($fullPath));
+ if ($return = rmdir($dir)) {
}
- } else if (strpos($name, 'linux') !== false) {
- if (\OC_Helper::is_function_enabled('exec')) {
- return (float)exec('stat -c %s ' . escapeshellarg($fullPath));
+ return $return;
+ }
+
+ private static function getFileSizeFromOS($fullPath) {
+ $name = strtolower(php_uname('s'));
+ // Windows OS: we use COM to access the filesystem
+ if (strpos($name, 'win') !== false) {
+ if (class_exists('COM')) {
+ $fsobj = new \COM("Scripting.FileSystemObject");
+ $f = $fsobj->GetFile($fullPath);
+ return $f->Size;
+ }
+ } else if (strpos($name, 'bsd') !== false) {
+ if (\OC_Helper::is_function_enabled('exec')) {
+ return (float)exec('stat -f %z ' . escapeshellarg($fullPath));
+ }
+ } else if (strpos($name, 'linux') !== false) {
+ if (\OC_Helper::is_function_enabled('exec')) {
+ return (float)exec('stat -c %s ' . escapeshellarg($fullPath));
+ }
+ } else {
+ \OC_Log::write('core',
+ 'Unable to determine file size of "' . $fullPath . '". Unknown OS: ' . $name,
+ \OC_Log::ERROR);
}
- } else {
- \OC_Log::write('core',
- 'Unable to determine file size of "'.$fullPath.'". Unknown OS: '.$name,
- \OC_Log::ERROR);
+
+ return 0;
}
- return 0;
- }
+ public function hash($path, $type, $raw = false) {
+ return hash_file($type, $this->datadir . $path, $raw);
+ }
- public function hash($path, $type, $raw=false) {
- return hash_file($type, $this->datadir.$path, $raw);
- }
+ public function free_space($path) {
+ $space = @disk_free_space($this->datadir . $path);
+ if ($space === false) {
+ return \OC\Files\FREE_SPACE_UNKNOWN;
+ }
+ return $space;
+ }
- public function free_space($path) {
- return @disk_free_space($this->datadir.$path);
- }
+ public function search($query) {
+ return $this->searchInDir($query);
+ }
- public function search($query) {
- return $this->searchInDir($query);
- }
- public function getLocalFile($path) {
- return $this->datadir.$path;
- }
- public function getLocalFolder($path) {
- return $this->datadir.$path;
- }
+ public function getLocalFile($path) {
+ return $this->datadir . $path;
+ }
- protected function searchInDir($query, $dir='') {
- $files=array();
- foreach (scandir($this->datadir.$dir) as $item) {
- if ($item == '.' || $item == '..') continue;
- if(strstr(strtolower($item), strtolower($query))!==false) {
- $files[]=$dir.'/'.$item;
- }
- if(is_dir($this->datadir.$dir.'/'.$item)) {
- $files=array_merge($files, $this->searchInDir($query, $dir.'/'.$item));
+ public function getLocalFolder($path) {
+ return $this->datadir . $path;
+ }
+
+ protected function searchInDir($query, $dir = '') {
+ $files = array();
+ foreach (scandir($this->datadir . $dir) as $item) {
+ if ($item == '.' || $item == '..') continue;
+ if (strstr(strtolower($item), strtolower($query)) !== false) {
+ $files[] = $dir . '/' . $item;
+ }
+ if (is_dir($this->datadir . $dir . '/' . $item)) {
+ $files = array_merge($files, $this->searchInDir($query, $dir . '/' . $item));
+ }
}
+ return $files;
}
- return $files;
- }
- /**
- * check if a file or folder has been updated since $time
- * @param string $path
- * @param int $time
- * @return bool
- */
- public function hasUpdated($path, $time) {
- return $this->filemtime($path)>$time;
+ /**
+ * check if a file or folder has been updated since $time
+ *
+ * @param string $path
+ * @param int $time
+ * @return bool
+ */
+ public function hasUpdated($path, $time) {
+ return $this->filemtime($path) > $time;
+ }
}
}
-}
diff --git a/lib/files/storage/mappedlocal.php b/lib/files/storage/mappedlocal.php
index 434c10bcbf7..ba3fcdc5c9e 100644
--- a/lib/files/storage/mappedlocal.php
+++ b/lib/files/storage/mappedlocal.php
@@ -50,7 +50,7 @@ class MappedLocal extends \OC\Files\Storage\Common{
continue;
}
- $logicalFilePath = $this->mapper->physicalToLogic($physicalPath.DIRECTORY_SEPARATOR.$file);
+ $logicalFilePath = $this->mapper->physicalToLogic($physicalPath.'/'.$file);
$file= $this->mapper->stripRootFolder($logicalFilePath, $logicalPath);
$file = $this->stripLeading($file);
@@ -130,7 +130,7 @@ class MappedLocal extends \OC\Files\Storage\Common{
public function file_get_contents($path) {
return file_get_contents($this->buildPath($path));
}
- public function file_put_contents($path, $data) {//trigger_error("$path = ".var_export($path, 1));
+ public function file_put_contents($path, $data) {
return file_put_contents($this->buildPath($path), $data);
}
public function unlink($path) {
@@ -280,7 +280,7 @@ class MappedLocal extends \OC\Files\Storage\Common{
foreach (scandir($physicalDir) as $item) {
if ($item == '.' || $item == '..')
continue;
- $physicalItem = $this->mapper->physicalToLogic($physicalDir.DIRECTORY_SEPARATOR.$item);
+ $physicalItem = $this->mapper->physicalToLogic($physicalDir.'/'.$item);
$item = substr($physicalItem, strlen($physicalDir)+1);
if(strstr(strtolower($item), strtolower($query)) !== false) {
@@ -331,6 +331,9 @@ class MappedLocal extends \OC\Files\Storage\Common{
if(strpos($path, '/') === 0) {
$path = substr($path, 1);
}
+ if(strpos($path, '\\') === 0) {
+ $path = substr($path, 1);
+ }
if ($path === false) {
return '';
}
diff --git a/lib/files/storage/storage.php b/lib/files/storage/storage.php
index 2cc835236ba..c96caebf4af 100644
--- a/lib/files/storage/storage.php
+++ b/lib/files/storage/storage.php
@@ -10,73 +10,328 @@ namespace OC\Files\Storage;
/**
* Provide a common interface to all different storage options
+ *
+ * All paths passed to the storage are relative to the storage and should NOT have a leading slash.
*/
-interface Storage{
+interface Storage {
+ /**
+ * $parameters is a free form array with the configuration options needed to construct the storage
+ *
+ * @param array $parameters
+ */
public function __construct($parameters);
+
+ /**
+ * Get the identifier for the storage,
+ * the returned id should be the same for every storage object that is created with the same parameters
+ * and two storage objects with the same id should refer to two storages that display the same files.
+ *
+ * @return string
+ */
public function getId();
+
+ /**
+ * see http://php.net/manual/en/function.mkdir.php
+ *
+ * @param string $path
+ * @return bool
+ */
public function mkdir($path);
+
+ /**
+ * see http://php.net/manual/en/function.rmdir.php
+ *
+ * @param string $path
+ * @return bool
+ */
public function rmdir($path);
+
+ /**
+ * see http://php.net/manual/en/function.opendir.php
+ *
+ * @param string $path
+ * @return resource
+ */
public function opendir($path);
+
+ /**
+ * see http://php.net/manual/en/function.is_dir.php
+ *
+ * @param string $path
+ * @return bool
+ */
public function is_dir($path);
+
+ /**
+ * see http://php.net/manual/en/function.is_file.php
+ *
+ * @param string $path
+ * @return bool
+ */
public function is_file($path);
+
+ /**
+ * see http://php.net/manual/en/function.stat.php
+ * only the following keys are required in the result: size and mtime
+ *
+ * @param string $path
+ * @return array
+ */
public function stat($path);
+
+ /**
+ * see http://php.net/manual/en/function.filetype.php
+ *
+ * @param string $path
+ * @return bool
+ */
public function filetype($path);
+
+ /**
+ * see http://php.net/manual/en/function.filesize.php
+ * The result for filesize when called on a folder is required to be 0
+ *
+ * @param string $path
+ * @return int
+ */
public function filesize($path);
+
+ /**
+ * check if a file can be created in $path
+ *
+ * @param string $path
+ * @return bool
+ */
public function isCreatable($path);
+
+ /**
+ * check if a file can be read
+ *
+ * @param string $path
+ * @return bool
+ */
public function isReadable($path);
+
+ /**
+ * check if a file can be written to
+ *
+ * @param string $path
+ * @return bool
+ */
public function isUpdatable($path);
+
+ /**
+ * check if a file can be deleted
+ *
+ * @param string $path
+ * @return bool
+ */
public function isDeletable($path);
+
+ /**
+ * check if a file can be shared
+ *
+ * @param string $path
+ * @return bool
+ */
public function isSharable($path);
+
+ /**
+ * get the full permissions of a path.
+ * Should return a combination of the PERMISSION_ constants defined in lib/public/constants.php
+ *
+ * @param string $path
+ * @return int
+ */
public function getPermissions($path);
+
+ /**
+ * see http://php.net/manual/en/function.file_exists.php
+ *
+ * @param string $path
+ * @return bool
+ */
public function file_exists($path);
+
+ /**
+ * see http://php.net/manual/en/function.filemtime.php
+ *
+ * @param string $path
+ * @return int
+ */
public function filemtime($path);
+
+ /**
+ * see http://php.net/manual/en/function.file_get_contents.php
+ *
+ * @param string $path
+ * @return string
+ */
public function file_get_contents($path);
- public function file_put_contents($path,$data);
+
+ /**
+ * see http://php.net/manual/en/function.file_put_contents.php
+ *
+ * @param string $path
+ * @param string $data
+ * @return bool
+ */
+ public function file_put_contents($path, $data);
+
+ /**
+ * see http://php.net/manual/en/function.unlink.php
+ *
+ * @param string $path
+ * @return bool
+ */
public function unlink($path);
- public function rename($path1,$path2);
- public function copy($path1,$path2);
- public function fopen($path,$mode);
+
+ /**
+ * see http://php.net/manual/en/function.rename.php
+ *
+ * @param string $path1
+ * @param string $path2
+ * @return bool
+ */
+ public function rename($path1, $path2);
+
+ /**
+ * see http://php.net/manual/en/function.copy.php
+ *
+ * @param string $path1
+ * @param string $path2
+ * @return bool
+ */
+ public function copy($path1, $path2);
+
+ /**
+ * see http://php.net/manual/en/function.fopen.php
+ *
+ * @param string $path
+ * @param string $mode
+ * @return resource
+ */
+ public function fopen($path, $mode);
+
+ /**
+ * get the mimetype for a file or folder
+ * The mimetype for a folder is required to be "httpd/unix-directory"
+ *
+ * @param string $path
+ * @return string
+ */
public function getMimeType($path);
- public function hash($type,$path,$raw = false);
+
+ /**
+ * see http://php.net/manual/en/function.hash.php
+ *
+ * @param string $type
+ * @param string $path
+ * @param bool $raw
+ * @return string
+ */
+ public function hash($type, $path, $raw = false);
+
+ /**
+ * see http://php.net/manual/en/function.free_space.php
+ *
+ * @param string $path
+ * @return int
+ */
public function free_space($path);
+
+ /**
+ * search for occurrences of $query in file names
+ *
+ * @param string $query
+ * @return array
+ */
public function search($query);
- public function touch($path, $mtime=null);
- public function getLocalFile($path);// get a path to a local version of the file, whether the original file is local or remote
- public function getLocalFolder($path);// get a path to a local version of the folder, whether the original file is local or remote
+
+ /**
+ * see http://php.net/manual/en/function.touch.php
+ * If the backend does not support the operation, false should be returned
+ *
+ * @param string $path
+ * @param int $mtime
+ * @return bool
+ */
+ public function touch($path, $mtime = null);
+
+ /**
+ * get the path to a local version of the file.
+ * The local version of the file can be temporary and doesn't have to be persistent across requests
+ *
+ * @param string $path
+ * @return string
+ */
+ public function getLocalFile($path);
+
+ /**
+ * get the path to a local version of the folder.
+ * The local version of the folder can be temporary and doesn't have to be persistent across requests
+ *
+ * @param string $path
+ * @return string
+ */
+ public function getLocalFolder($path);
/**
* check if a file or folder has been updated since $time
+ *
+ * @param string $path
* @param int $time
* @return bool
*
* hasUpdated for folders should return at least true if a file inside the folder is add, removed or renamed.
* returning true for other changes in the folder is optional
*/
- public function hasUpdated($path,$time);
+ public function hasUpdated($path, $time);
/**
+ * get a cache instance for the storage
+ *
* @param string $path
* @return \OC\Files\Cache\Cache
*/
- public function getCache($path='');
+ public function getCache($path = '');
+
/**
+ * get a scanner instance for the storage
+ *
* @param string $path
* @return \OC\Files\Cache\Scanner
*/
- public function getScanner($path='');
+ public function getScanner($path = '');
+
+ /**
+ * get the user id of the owner of a file or folder
+ *
+ * @param string $path
+ * @return string
+ */
public function getOwner($path);
/**
+ * get a permissions cache instance for the cache
+ *
* @param string $path
* @return \OC\Files\Cache\Permissions
*/
- public function getPermissionsCache($path='');
+ public function getPermissionsCache($path = '');
/**
+ * get a watcher instance for the cache
+ *
* @param string $path
* @return \OC\Files\Cache\Watcher
*/
- public function getWatcher($path='');
+ public function getWatcher($path = '');
+
+ /**
+ * @return \OC\Files\Cache\Storage
+ */
+ public function getStorageCache();
/**
* get the ETag for a file or folder
diff --git a/lib/files/view.php b/lib/files/view.php
index 3cea8b082dc..bc6b80c505a 100644
--- a/lib/files/view.php
+++ b/lib/files/view.php
@@ -245,7 +245,9 @@ class View {
if (!is_null($mtime) and !is_numeric($mtime)) {
$mtime = strtotime($mtime);
}
+
$hooks = array('touch');
+
if (!$this->file_exists($path)) {
$hooks[] = 'write';
}
@@ -264,11 +266,13 @@ class View {
if (is_resource($data)) { //not having to deal with streams in file_put_contents makes life easier
$absolutePath = Filesystem::normalizePath($this->getAbsolutePath($path));
if (\OC_FileProxy::runPreProxies('file_put_contents', $absolutePath, $data)
- && Filesystem::isValidPath($path)) {
+ and Filesystem::isValidPath($path)
+ and ! Filesystem::isFileBlacklisted($path)
+ ) {
$path = $this->getRelativePath($absolutePath);
$exists = $this->file_exists($path);
$run = true;
- if ($this->fakeRoot == Filesystem::getRoot()) {
+ if ($this->fakeRoot == Filesystem::getRoot() && !Cache\Scanner::isPartialFile($path)) {
if (!$exists) {
\OC_Hook::emit(
Filesystem::CLASSNAME,
@@ -296,7 +300,7 @@ class View {
list ($count, $result) = \OC_Helper::streamCopy($data, $target);
fclose($target);
fclose($data);
- if ($this->fakeRoot == Filesystem::getRoot()) {
+ if ($this->fakeRoot == Filesystem::getRoot() && !Cache\Scanner::isPartialFile($path)) {
if (!$exists) {
\OC_Hook::emit(
Filesystem::CLASSNAME,
@@ -336,8 +340,12 @@ class View {
$postFix2 = (substr($path2, -1, 1) === '/') ? '/' : '';
$absolutePath1 = Filesystem::normalizePath($this->getAbsolutePath($path1));
$absolutePath2 = Filesystem::normalizePath($this->getAbsolutePath($path2));
- if (\OC_FileProxy::runPreProxies('rename', $absolutePath1, $absolutePath2)
- and Filesystem::isValidPath($path2)) {
+ if (
+ \OC_FileProxy::runPreProxies('rename', $absolutePath1, $absolutePath2)
+ and Filesystem::isValidPath($path2)
+ and Filesystem::isValidPath($path1)
+ and ! Filesystem::isFileBlacklisted($path2)
+ ) {
$path1 = $this->getRelativePath($absolutePath1);
$path2 = $this->getRelativePath($absolutePath2);
@@ -345,7 +353,7 @@ class View {
return false;
}
$run = true;
- if ($this->fakeRoot == Filesystem::getRoot()) {
+ if ($this->fakeRoot == Filesystem::getRoot() && !Cache\Scanner::isPartialFile($path1)) {
\OC_Hook::emit(
Filesystem::CLASSNAME, Filesystem::signal_rename,
array(
@@ -373,7 +381,7 @@ class View {
list($storage1, $internalPath1) = Filesystem::resolvePath($absolutePath1 . $postFix1);
$storage1->unlink($internalPath1);
}
- if ($this->fakeRoot == Filesystem::getRoot()) {
+ if ($this->fakeRoot == Filesystem::getRoot() && !Cache\Scanner::isPartialFile($path1)) {
\OC_Hook::emit(
Filesystem::CLASSNAME,
Filesystem::signal_post_rename,
@@ -397,7 +405,12 @@ class View {
$postFix2 = (substr($path2, -1, 1) === '/') ? '/' : '';
$absolutePath1 = Filesystem::normalizePath($this->getAbsolutePath($path1));
$absolutePath2 = Filesystem::normalizePath($this->getAbsolutePath($path2));
- if (\OC_FileProxy::runPreProxies('copy', $absolutePath1, $absolutePath2) and Filesystem::isValidPath($path2)) {
+ if (
+ \OC_FileProxy::runPreProxies('copy', $absolutePath1, $absolutePath2)
+ and Filesystem::isValidPath($path2)
+ and Filesystem::isValidPath($path1)
+ and ! Filesystem::isFileBlacklisted($path2)
+ ) {
$path1 = $this->getRelativePath($absolutePath1);
$path2 = $this->getRelativePath($absolutePath2);
@@ -599,7 +612,10 @@ class View {
private function basicOperation($operation, $path, $hooks = array(), $extraParam = null) {
$postFix = (substr($path, -1, 1) === '/') ? '/' : '';
$absolutePath = Filesystem::normalizePath($this->getAbsolutePath($path));
- if (\OC_FileProxy::runPreProxies($operation, $absolutePath, $extraParam) and Filesystem::isValidPath($path)) {
+ if (\OC_FileProxy::runPreProxies($operation, $absolutePath, $extraParam)
+ and Filesystem::isValidPath($path)
+ and ! Filesystem::isFileBlacklisted($path)
+ ) {
$path = $this->getRelativePath($absolutePath);
if ($path == null) {
return false;
@@ -732,6 +748,7 @@ class View {
* get the content of a directory
*
* @param string $directory path under datadirectory
+ * @param string $mimetype_filter limit returned content to this mimetype or mimepart
* @return array
*/
public function getDirectoryContent($directory, $mimetype_filter = '') {
@@ -969,7 +986,7 @@ class View {
*/
public function getPath($id) {
list($storage, $internalPath) = Cache\Cache::getById($id);
- $mounts = Mount::findByStorageId($storage);
+ $mounts = Filesystem::getMountByStorageId($storage);
foreach ($mounts as $mount) {
/**
* @var \OC\Files\Mount $mount
diff --git a/lib/helper.php b/lib/helper.php
index 41985ca57a7..c69445ed788 100644
--- a/lib/helper.php
+++ b/lib/helper.php
@@ -159,7 +159,7 @@ class OC_Helper {
*/
public static function imagePath( $app, $image ) {
// Read the selected theme from the config file
- $theme=OC_Config::getValue( "theme" );
+ $theme = OC_Util::getTheme();
// Check if the app is in the app folder
if( file_exists( OC::$SERVERROOT."/themes/$theme/apps/$app/img/$image" )) {
@@ -541,13 +541,15 @@ class OC_Helper {
}
/**
- * create a temporary file with an unique filename. It will not be deleted
- * automatically
- * @param string $postfix
- * @return string
+ * move a file to oc-noclean temp dir
+ * @param string $filename
+ * @return mixed
*
*/
- public static function tmpFileNoClean($postfix='') {
+ public static function moveToNoClean($filename='') {
+ if ($filename == '') {
+ return false;
+ }
$tmpDirNoClean=get_temp_dir().'/oc-noclean/';
if (!file_exists($tmpDirNoClean) || !is_dir($tmpDirNoClean)) {
if (file_exists($tmpDirNoClean)) {
@@ -555,10 +557,12 @@ class OC_Helper {
}
mkdir($tmpDirNoClean);
}
- $file=$tmpDirNoClean.md5(time().rand()).$postfix;
- $fh=fopen($file, 'w');
- fclose($fh);
- return $file;
+ $newname=$tmpDirNoClean.basename($filename);
+ if (rename($filename, $newname)) {
+ return $newname;
+ } else {
+ return false;
+ }
}
/**
@@ -597,7 +601,7 @@ class OC_Helper {
}
/**
- * remove all files created by self::tmpFileNoClean
+ * remove all files in PHP /oc-noclean temp dir
*/
public static function cleanTmpNoClean() {
$tmpDirNoCleanFile=get_temp_dir().'/oc-noclean/';
@@ -764,9 +768,15 @@ class OC_Helper {
public static function maxUploadFilesize($dir) {
$upload_max_filesize = OCP\Util::computerFileSize(ini_get('upload_max_filesize'));
$post_max_size = OCP\Util::computerFileSize(ini_get('post_max_size'));
- $maxUploadFilesize = min($upload_max_filesize, $post_max_size);
-
$freeSpace = \OC\Files\Filesystem::free_space($dir);
+ if ($upload_max_filesize == 0 and $post_max_size == 0) {
+ $maxUploadFilesize = \OC\Files\FREE_SPACE_UNLIMITED;
+ } elseif ($upload_max_filesize === 0 or $post_max_size === 0) {
+ $maxUploadFilesize = max($upload_max_filesize, $post_max_size); //only the non 0 value counts
+ } else {
+ $maxUploadFilesize = min($upload_max_filesize, $post_max_size);
+ }
+
if($freeSpace !== \OC\Files\FREE_SPACE_UNKNOWN){
$freeSpace = max($freeSpace, 0);
@@ -806,11 +816,19 @@ class OC_Helper {
$used = 0;
}
$free = \OC\Files\Filesystem::free_space();
- $total = $free + $used;
+ if ($free >= 0){
+ $total = $free + $used;
+ } else {
+ $total = $free; //either unknown or unlimited
+ }
if ($total == 0) {
$total = 1; // prevent division by zero
}
- $relative = round(($used / $total) * 10000) / 100;
+ if ($total >= 0){
+ $relative = round(($used / $total) * 10000) / 100;
+ } else {
+ $relative = 0;
+ }
return array('free' => $free, 'used' => $used, 'total' => $total, 'relative' => $relative);
}
diff --git a/lib/installer.php b/lib/installer.php
index 251d115b76c..49ba4492632 100644
--- a/lib/installer.php
+++ b/lib/installer.php
@@ -134,8 +134,10 @@ class OC_Installer{
}
// check if the app is compatible with this version of ownCloud
- $version=OC_Util::getVersion();
- if(!isset($info['require']) or ($version[0]>$info['require'])) {
+ if(
+ !isset($info['require'])
+ or !OC_App::isAppVersionCompatible(OC_Util::getVersion(), $info['require'])
+ ) {
OC_Log::write('core',
'App can\'t be installed because it is not compatible with this version of ownCloud',
OC_Log::ERROR);
diff --git a/lib/json.php b/lib/json.php
index f929e958957..6ba0b13806b 100644
--- a/lib/json.php
+++ b/lib/json.php
@@ -14,7 +14,7 @@ class OC_JSON{
public static function setContentTypeHeader($type='application/json') {
if (!self::$send_content_type_header) {
// We send json data
- header( 'Content-Type: '.$type );
+ header( 'Content-Type: '.$type . '; charset=utf-8');
self::$send_content_type_header = true;
}
}
diff --git a/lib/l10n.php b/lib/l10n.php
index 1e07a9b9557..d35ce5fed14 100644
--- a/lib/l10n.php
+++ b/lib/l10n.php
@@ -122,9 +122,21 @@ class OC_L10N{
)
&& file_exists($i18ndir.$lang.'.php')) {
// Include the file, save the data from $CONFIG
- include strip_tags($i18ndir).strip_tags($lang).'.php';
+ $transFile = strip_tags($i18ndir).strip_tags($lang).'.php';
+ include $transFile;
if(isset($TRANSLATIONS) && is_array($TRANSLATIONS)) {
$this->translations = $TRANSLATIONS;
+ //merge with translations from theme
+ $theme = OC_Config::getValue( "theme" );
+ if (!is_null($theme)) {
+ $transFile = OC::$SERVERROOT.'/themes/'.$theme.substr($transFile, strlen(OC::$SERVERROOT));
+ if (file_exists($transFile)) {
+ include $transFile;
+ if (isset($TRANSLATIONS) && is_array($TRANSLATIONS)) {
+ $this->translations = array_merge($this->translations, $TRANSLATIONS);
+ }
+ }
+ }
}
}
@@ -298,10 +310,16 @@ class OC_L10N{
$temp = explode(';', $i);
$temp[0] = str_replace('-', '_', $temp[0]);
if( ($key = array_search($temp[0], $available)) !== false) {
+ if (is_null($app)) {
+ self::$language = $available[$key];
+ }
return $available[$key];
}
foreach($available as $l) {
if ( $temp[0] == substr($l, 0, 2) ) {
+ if (is_null($app)) {
+ self::$language = $l;
+ }
return $l;
}
}
diff --git a/lib/l10n/ar.php b/lib/l10n/ar.php
index 77e02dd77b1..98b9608ce02 100644
--- a/lib/l10n/ar.php
+++ b/lib/l10n/ar.php
@@ -1,12 +1,52 @@
<?php $TRANSLATIONS = array(
"Help" => "المساعدة",
"Personal" => "شخصي",
-"Settings" => "تعديلات",
+"Settings" => "إعدادات",
"Users" => "المستخدمين",
+"Apps" => "التطبيقات",
+"Admin" => "المدير",
+"ZIP download is turned off." => "تحميل ملفات ZIP متوقف",
+"Files need to be downloaded one by one." => "الملفات بحاجة الى ان يتم تحميلها واحد تلو الاخر",
+"Back to Files" => "العودة الى الملفات",
+"Selected files too large to generate zip file." => "الملفات المحددة كبيرة جدا ليتم ضغطها في ملف zip",
+"couldn't be determined" => "تعذّر تحديده",
+"Application is not enabled" => "التطبيق غير مفعّل",
"Authentication error" => "لم يتم التأكد من الشخصية بنجاح",
+"Token expired. Please reload page." => "انتهت صلاحية الكلمة , يرجى اعادة تحميل الصفحة",
"Files" => "الملفات",
"Text" => "معلومات إضافية",
+"Images" => "صور",
+"Set an admin username." => "اعداد اسم مستخدم للمدير",
+"Set an admin password." => "اعداد كلمة مرور للمدير",
+"%s enter the database username." => "%s ادخل اسم المستخدم الخاص بقاعدة البيانات.",
+"%s enter the database name." => "%s ادخل اسم فاعدة البيانات",
+"%s you may not use dots in the database name" => "%s لا يسمح لك باستخدام نقطه (.) في اسم قاعدة البيانات",
+"%s set the database host." => "%s ادخل اسم خادم قاعدة البيانات",
+"PostgreSQL username and/or password not valid" => "اسم المستخدم / أو كلمة المرور الخاصة بـPostgreSQL غير صحيحة",
+"You need to enter either an existing account or the administrator." => "انت بحاجة لكتابة اسم مستخدم موجود أو حساب المدير.",
+"Oracle username and/or password not valid" => "اسم المستخدم و/أو كلمة المرور لنظام Oracle غير صحيح",
+"MySQL username and/or password not valid" => "اسم المستخدم و/أو كلمة المرور لنظام MySQL غير صحيح",
+"DB Error: \"%s\"" => "خطأ في قواعد البيانات : \"%s\"",
+"Offending command was: \"%s\"" => "الأمر المخالف كان : \"%s\"",
+"MySQL user '%s'@'localhost' exists already." => "أسم المستخدم '%s'@'localhost' الخاص بـ MySQL موجود مسبقا",
+"Drop this user from MySQL" => "احذف اسم المستخدم هذا من الـ MySQL",
+"MySQL user '%s'@'%%' already exists" => "أسم المستخدم '%s'@'%%' الخاص بـ MySQL موجود مسبقا",
+"Drop this user from MySQL." => "احذف اسم المستخدم هذا من الـ MySQL.",
+"Offending command was: \"%s\", name: %s, password: %s" => "الأمر المخالف كان : \"%s\", اسم المستخدم : %s, كلمة المرور: %s",
+"MS SQL username and/or password not valid: %s" => "اسم المستخدم و/أو كلمة المرور لنظام MS SQL غير صحيح : %s",
+"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "اعدادات خادمك غير صحيحة بشكل تسمح لك بمزامنة ملفاتك وذلك بسبب أن واجهة WebDAV تبدو معطلة",
+"Please double check the <a href='%s'>installation guides</a>." => "الرجاء التحقق من <a href='%s'>دليل التنصيب</a>.",
"seconds ago" => "منذ ثواني",
"1 minute ago" => "منذ دقيقة",
-"today" => "اليوم"
+"%d minutes ago" => "%d دقيقة مضت",
+"1 hour ago" => "قبل ساعة مضت",
+"%d hours ago" => "%d ساعة مضت",
+"today" => "اليوم",
+"yesterday" => "يوم أمس",
+"%d days ago" => "%d يوم مضى",
+"last month" => "الشهر الماضي",
+"%d months ago" => "%d شهر مضت",
+"last year" => "السنةالماضية",
+"years ago" => "سنة مضت",
+"Could not find category \"%s\"" => "تعذر العثور على المجلد \"%s\""
);
diff --git a/lib/l10n/bg_BG.php b/lib/l10n/bg_BG.php
index d32e2aadfc5..73a7fdce481 100644
--- a/lib/l10n/bg_BG.php
+++ b/lib/l10n/bg_BG.php
@@ -18,7 +18,6 @@
"Images" => "Снимки",
"Set an admin username." => "Въведете потребителско име за администратор.",
"Set an admin password." => "Въведете парола за администратор.",
-"Specify a data folder." => "Укажете папка за данни",
"%s enter the database username." => "%s въведете потребителско име за базата с данни.",
"%s enter the database name." => "%s въведете име на базата с данни.",
"%s you may not use dots in the database name" => "%s, не можете да ползвате точки в името на базата от данни",
@@ -45,8 +44,5 @@
"%d months ago" => "преди %d месеца",
"last year" => "последната година",
"years ago" => "последните години",
-"%s is available. Get <a href=\"%s\">more information</a>" => "%s е налична. Получете <a href=\"%s\">повече информация</a>",
-"up to date" => "е актуална",
-"updates check is disabled" => "проверката за обновления е изключена",
"Could not find category \"%s\"" => "Невъзможно откриване на категорията \"%s\""
);
diff --git a/lib/l10n/bn_BD.php b/lib/l10n/bn_BD.php
index cb6ff4455a9..f7c8f57466d 100644
--- a/lib/l10n/bn_BD.php
+++ b/lib/l10n/bn_BD.php
@@ -2,9 +2,9 @@
"Help" => "সহায়িকা",
"Personal" => "ব্যক্তিগত",
"Settings" => "নিয়ামকসমূহ",
-"Users" => "ব্যভহারকারী",
+"Users" => "ব্যবহারকারী",
"Apps" => "অ্যাপ",
-"Admin" => "প্রশাসক",
+"Admin" => "প্রশাসন",
"ZIP download is turned off." => "ZIP ডাউনলোড বন্ধ করা আছে।",
"Files need to be downloaded one by one." => "ফাইলগুলো একে একে ডাউনলোড করা আবশ্যক।",
"Back to Files" => "ফাইলে ফিরে চল",
@@ -13,6 +13,7 @@
"Authentication error" => "অনুমোদন ঘটিত সমস্যা",
"Token expired. Please reload page." => "টোকেন মেয়াদোত্তীর্ণ। দয়া করে পৃষ্ঠাটি পূনরায় লোড করুন।",
"Files" => "ফাইল",
+"Text" => "টেক্সট",
"seconds ago" => "সেকেন্ড পূর্বে",
"1 minute ago" => "১ মিনিট পূর্বে",
"%d minutes ago" => "%d মিনিট পূর্বে",
@@ -22,8 +23,5 @@
"%d days ago" => "%d দিন পূর্বে",
"last month" => "গত মাস",
"last year" => "গত বছর",
-"years ago" => "বছর পূর্বে",
-"%s is available. Get <a href=\"%s\">more information</a>" => "%s এখন সুলভ। <a href=\"%s\">আরও জানুন</a>",
-"up to date" => "সর্বশেষ",
-"updates check is disabled" => "পরিবর্ধন পরীক্ষণ করা বন্ধ রাখা হয়েছে"
+"years ago" => "বছর পূর্বে"
);
diff --git a/lib/l10n/ca.php b/lib/l10n/ca.php
index 108bb5c09be..028bf2343a7 100644
--- a/lib/l10n/ca.php
+++ b/lib/l10n/ca.php
@@ -18,7 +18,6 @@
"Images" => "Imatges",
"Set an admin username." => "Establiu un nom d'usuari per l'administrador.",
"Set an admin password." => "Establiu una contrasenya per l'administrador.",
-"Specify a data folder." => "Especifiqueu una carpeta de dades.",
"%s enter the database username." => "%s escriviu el nom d'usuari de la base de dades.",
"%s enter the database name." => "%s escriviu el nom de la base de dades.",
"%s you may not use dots in the database name" => "%s no podeu usar punts en el nom de la base de dades",
@@ -48,9 +47,6 @@
"last month" => "el mes passat",
"%d months ago" => "fa %d mesos",
"last year" => "l'any passat",
-"years ago" => "fa anys",
-"%s is available. Get <a href=\"%s\">more information</a>" => "%s està disponible. Obtén <a href=\"%s\">més informació</a>",
-"up to date" => "actualitzat",
-"updates check is disabled" => "la comprovació d'actualitzacions està desactivada",
+"years ago" => "anys enrere",
"Could not find category \"%s\"" => "No s'ha trobat la categoria \"%s\""
);
diff --git a/lib/l10n/cs_CZ.php b/lib/l10n/cs_CZ.php
index d9ec3d82cf7..e3007f687d9 100644
--- a/lib/l10n/cs_CZ.php
+++ b/lib/l10n/cs_CZ.php
@@ -18,7 +18,6 @@
"Images" => "Obrázky",
"Set an admin username." => "Zadejte uživatelské jméno správce.",
"Set an admin password." => "Zadejte heslo správce.",
-"Specify a data folder." => "Určete složku dat.",
"%s enter the database username." => "Zadejte uživatelské jméno %s databáze.",
"%s enter the database name." => "Zadejte název databáze pro %s databáze.",
"%s you may not use dots in the database name" => "V názvu databáze %s nesmíte používat tečky.",
@@ -37,8 +36,8 @@
"MS SQL username and/or password not valid: %s" => "Uživatelské jméno, či heslo MSSQL není platné: %s",
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Váš webový server není správně nastaven pro umožnění synchronizace, protože rozhraní WebDAV je rozbité.",
"Please double check the <a href='%s'>installation guides</a>." => "Zkonzultujte, prosím, <a href='%s'>průvodce instalací</a>.",
-"seconds ago" => "před vteřinami",
-"1 minute ago" => "před 1 minutou",
+"seconds ago" => "před pár vteřinami",
+"1 minute ago" => "před minutou",
"%d minutes ago" => "před %d minutami",
"1 hour ago" => "před hodinou",
"%d hours ago" => "před %d hodinami",
@@ -47,10 +46,7 @@
"%d days ago" => "před %d dny",
"last month" => "minulý měsíc",
"%d months ago" => "Před %d měsíci",
-"last year" => "loni",
+"last year" => "minulý rok",
"years ago" => "před lety",
-"%s is available. Get <a href=\"%s\">more information</a>" => "%s je dostupná. Získat <a href=\"%s\">více informací</a>",
-"up to date" => "aktuální",
-"updates check is disabled" => "kontrola aktualizací je vypnuta",
"Could not find category \"%s\"" => "Nelze nalézt kategorii \"%s\""
);
diff --git a/lib/l10n/cy_GB.php b/lib/l10n/cy_GB.php
new file mode 100644
index 00000000000..ab5623bbf44
--- /dev/null
+++ b/lib/l10n/cy_GB.php
@@ -0,0 +1,52 @@
+<?php $TRANSLATIONS = array(
+"Help" => "Cymorth",
+"Personal" => "Personol",
+"Settings" => "Gosodiadau",
+"Users" => "Defnyddwyr",
+"Apps" => "Pecynnau",
+"Admin" => "Gweinyddu",
+"ZIP download is turned off." => "Mae llwytho ZIP wedi ei ddiffodd.",
+"Files need to be downloaded one by one." => "Mae angen llwytho ffeiliau i lawr fesul un.",
+"Back to Files" => "Nôl i Ffeiliau",
+"Selected files too large to generate zip file." => "Mae'r ffeiliau ddewiswyd yn rhy fawr i gynhyrchu ffeil zip.",
+"couldn't be determined" => "methwyd pennu",
+"Application is not enabled" => "Nid yw'r pecyn wedi'i alluogi",
+"Authentication error" => "Gwall dilysu",
+"Token expired. Please reload page." => "Tocyn wedi dod i ben. Ail-lwythwch y dudalen.",
+"Files" => "Ffeiliau",
+"Text" => "Testun",
+"Images" => "Delweddau",
+"Set an admin username." => "Creu enw defnyddiwr i'r gweinyddwr.",
+"Set an admin password." => "Gosod cyfrinair y gweinyddwr.",
+"%s enter the database username." => "%s rhowch enw defnyddiwr y gronfa ddata.",
+"%s enter the database name." => "%s rhowch enw'r gronfa ddata.",
+"%s you may not use dots in the database name" => "%s does dim hawl defnyddio dot yn enw'r gronfa ddata",
+"%s set the database host." => "%s gosod gwesteiwr y gronfa ddata.",
+"PostgreSQL username and/or password not valid" => "Enw a/neu gyfrinair PostgreSQL annilys",
+"You need to enter either an existing account or the administrator." => "Rhaid i chi naill ai gyflwyno cyfrif presennol neu'r gweinyddwr.",
+"Oracle username and/or password not valid" => "Enw a/neu gyfrinair Oracle annilys",
+"MySQL username and/or password not valid" => "Enw a/neu gyfrinair MySQL annilys",
+"DB Error: \"%s\"" => "Gwall DB: \"%s\"",
+"Offending command was: \"%s\"" => "Y gorchymyn wnaeth beri tramgwydd oedd: \"%s\"",
+"MySQL user '%s'@'localhost' exists already." => "Defnyddiwr MySQL '%s'@'localhost' yn bodoli eisoes.",
+"Drop this user from MySQL" => "Gollwng y defnyddiwr hwn o MySQL",
+"MySQL user '%s'@'%%' already exists" => "Defnyddiwr MySQL '%s'@'%%' eisoes yn bodoli",
+"Drop this user from MySQL." => "Gollwng y defnyddiwr hwn o MySQL.",
+"Offending command was: \"%s\", name: %s, password: %s" => "Y gorchymyn wnaeth beri tramgwydd oedd: \"%s\", enw: %s, cyfrinair: %s",
+"MS SQL username and/or password not valid: %s" => "Enw a/neu gyfrinair MS SQL annilys: %s",
+"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Nid yw eich gweinydd wedi'i gyflunio eto i ganiatáu cydweddu ffeiliau oherwydd bod y rhyngwyneb WebDAV wedi torri.",
+"Please double check the <a href='%s'>installation guides</a>." => "Gwiriwch y <a href='%s'>canllawiau gosod</a> eto.",
+"seconds ago" => "eiliad yn ôl",
+"1 minute ago" => "1 munud yn ôl",
+"%d minutes ago" => "%d munud yn ôl",
+"1 hour ago" => "1 awr yn ôl",
+"%d hours ago" => "%d awr yn ôl",
+"today" => "heddiw",
+"yesterday" => "ddoe",
+"%d days ago" => "%d diwrnod yn ôl",
+"last month" => "mis diwethaf",
+"%d months ago" => "%d mis yn ôl",
+"last year" => "y llynedd",
+"years ago" => "blwyddyn yn ôl",
+"Could not find category \"%s\"" => "Methu canfod categori \"%s\""
+);
diff --git a/lib/l10n/da.php b/lib/l10n/da.php
index 38ccbbe8e21..dad64700e52 100644
--- a/lib/l10n/da.php
+++ b/lib/l10n/da.php
@@ -1,6 +1,6 @@
<?php $TRANSLATIONS = array(
"Help" => "Hjælp",
-"Personal" => "Personlig",
+"Personal" => "Personligt",
"Settings" => "Indstillinger",
"Users" => "Brugere",
"Apps" => "Apps",
@@ -18,7 +18,6 @@
"Images" => "Billeder",
"Set an admin username." => "Angiv et admin brugernavn.",
"Set an admin password." => "Angiv et admin kodeord.",
-"Specify a data folder." => "Specificer en data mappe.",
"%s enter the database username." => "%s indtast database brugernavnet.",
"%s enter the database name." => "%s indtast database navnet.",
"%s you may not use dots in the database name" => "%s du må ikke bruge punktummer i databasenavnet.",
@@ -42,15 +41,12 @@
"%d minutes ago" => "%d minutter siden",
"1 hour ago" => "1 time siden",
"%d hours ago" => "%d timer siden",
-"today" => "I dag",
-"yesterday" => "I går",
+"today" => "i dag",
+"yesterday" => "i går",
"%d days ago" => "%d dage siden",
-"last month" => "Sidste måned",
+"last month" => "sidste måned",
"%d months ago" => "%d måneder siden",
-"last year" => "Sidste år",
+"last year" => "sidste år",
"years ago" => "år siden",
-"%s is available. Get <a href=\"%s\">more information</a>" => "%s er tilgængelig. Få <a href=\"%s\">mere information</a>",
-"up to date" => "opdateret",
-"updates check is disabled" => "Check for opdateringer er deaktiveret",
"Could not find category \"%s\"" => "Kunne ikke finde kategorien \"%s\""
);
diff --git a/lib/l10n/de.php b/lib/l10n/de.php
index 3c2069d4637..13acc1c55b5 100644
--- a/lib/l10n/de.php
+++ b/lib/l10n/de.php
@@ -4,21 +4,20 @@
"Settings" => "Einstellungen",
"Users" => "Benutzer",
"Apps" => "Apps",
-"Admin" => "Administrator",
+"Admin" => "Administration",
"ZIP download is turned off." => "Der ZIP-Download ist deaktiviert.",
"Files need to be downloaded one by one." => "Die Dateien müssen einzeln heruntergeladen werden.",
"Back to Files" => "Zurück zu \"Dateien\"",
"Selected files too large to generate zip file." => "Die gewählten Dateien sind zu groß, um eine ZIP-Datei zu erstellen.",
"couldn't be determined" => "konnte nicht festgestellt werden",
"Application is not enabled" => "Die Anwendung ist nicht aktiviert",
-"Authentication error" => "Authentifizierungs-Fehler",
+"Authentication error" => "Fehler bei der Anmeldung",
"Token expired. Please reload page." => "Token abgelaufen. Bitte lade die Seite neu.",
"Files" => "Dateien",
"Text" => "Text",
"Images" => "Bilder",
"Set an admin username." => "Setze Administrator Benutzername.",
"Set an admin password." => "Setze Administrator Passwort",
-"Specify a data folder." => "Datei-Verzeichnis angeben.",
"%s enter the database username." => "%s gib den Datenbank-Benutzernamen an.",
"%s enter the database name." => "%s gib den Datenbank-Namen an.",
"%s you may not use dots in the database name" => "%s Der Datenbank-Name darf keine Punkte enthalten",
@@ -36,9 +35,9 @@
"Offending command was: \"%s\", name: %s, password: %s" => "Fehlerhafter Befehl war: \"%s\", Name: %s, Passwort: %s",
"MS SQL username and/or password not valid: %s" => "MS SQL Benutzername und/oder Password ungültig: %s",
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Dein Web-Server ist noch nicht für Datei-Synchronisation bereit, weil die WebDAV-Schnittstelle vermutlich defekt ist.",
-"Please double check the <a href='%s'>installation guides</a>." => "Bitte prüfe die <a href='%s'>Instalationsanleitungen</a>.",
+"Please double check the <a href='%s'>installation guides</a>." => "Bitte prüfe die <a href='%s'>Installationsanleitungen</a>.",
"seconds ago" => "Gerade eben",
-"1 minute ago" => "Vor einer Minute",
+"1 minute ago" => "vor einer Minute",
"%d minutes ago" => "Vor %d Minuten",
"1 hour ago" => "Vor einer Stunde",
"%d hours ago" => "Vor %d Stunden",
@@ -49,8 +48,5 @@
"%d months ago" => "Vor %d Monaten",
"last year" => "Letztes Jahr",
"years ago" => "Vor Jahren",
-"%s is available. Get <a href=\"%s\">more information</a>" => "%s ist verfügbar. <a href=\"%s\">Weitere Informationen</a>",
-"up to date" => "aktuell",
-"updates check is disabled" => "Die Update-Überprüfung ist ausgeschaltet",
"Could not find category \"%s\"" => "Die Kategorie \"%s\" konnte nicht gefunden werden."
);
diff --git a/lib/l10n/de_DE.php b/lib/l10n/de_DE.php
index 9978cdf8b31..566e98b85ce 100644
--- a/lib/l10n/de_DE.php
+++ b/lib/l10n/de_DE.php
@@ -18,7 +18,6 @@
"Images" => "Bilder",
"Set an admin username." => "Setze Administrator Benutzername.",
"Set an admin password." => "Setze Administrator Passwort",
-"Specify a data folder." => "Datei-Verzeichnis angeben",
"%s enter the database username." => "%s geben Sie den Datenbank-Benutzernamen an.",
"%s enter the database name." => "%s geben Sie den Datenbank-Namen an.",
"%s you may not use dots in the database name" => "%s Der Datenbank-Name darf keine Punkte enthalten",
@@ -35,10 +34,10 @@
"Drop this user from MySQL." => "Lösche diesen Benutzer aus MySQL.",
"Offending command was: \"%s\", name: %s, password: %s" => "Fehlerhafter Befehl war: \"%s\", Name: %s, Passwort: %s",
"MS SQL username and/or password not valid: %s" => "MS SQL Benutzername und/oder Passwort ungültig: %s",
-"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Ihr Web-Server ist noch nicht für Datei-Synchronisation bereit, weil die WebDAV-Schnittstelle vermutlich defekt ist.",
-"Please double check the <a href='%s'>installation guides</a>." => "Bitte prüfen Sie die <a href='%s'>Instalationsanleitungen</a>.",
+"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Ihr Web-Server ist noch nicht für eine Datei-Synchronisation konfiguriert, weil die WebDAV-Schnittstelle vermutlich defekt ist.",
+"Please double check the <a href='%s'>installation guides</a>." => "Bitte prüfen Sie die <a href='%s'>Installationsanleitungen</a>.",
"seconds ago" => "Gerade eben",
-"1 minute ago" => "Vor einer Minute",
+"1 minute ago" => "Vor 1 Minute",
"%d minutes ago" => "Vor %d Minuten",
"1 hour ago" => "Vor einer Stunde",
"%d hours ago" => "Vor %d Stunden",
@@ -49,8 +48,5 @@
"%d months ago" => "Vor %d Monaten",
"last year" => "Letztes Jahr",
"years ago" => "Vor Jahren",
-"%s is available. Get <a href=\"%s\">more information</a>" => "%s ist verfügbar. <a href=\"%s\">Weitere Informationen</a>",
-"up to date" => "aktuell",
-"updates check is disabled" => "Die Update-Überprüfung ist ausgeschaltet",
"Could not find category \"%s\"" => "Die Kategorie \"%s\" konnte nicht gefunden werden."
);
diff --git a/lib/l10n/el.php b/lib/l10n/el.php
index c17a33dfee1..14b63a8184c 100644
--- a/lib/l10n/el.php
+++ b/lib/l10n/el.php
@@ -18,19 +18,22 @@
"Images" => "Εικόνες",
"Set an admin username." => "Εισάγετε όνομα χρήστη διαχειριστή.",
"Set an admin password." => "Εισάγετε συνθηματικό διαχειριστή.",
-"Specify a data folder." => "Καθορίστε τον φάκελο δεδομένων.",
"%s enter the database username." => "%s εισάγετε το όνομα χρήστη της βάσης δεδομένων.",
"%s enter the database name." => "%s εισάγετε το όνομα της βάσης δεδομένων.",
"%s you may not use dots in the database name" => "%s μάλλον δεν χρησιμοποιείτε τελείες στο όνομα της βάσης δεδομένων",
+"%s set the database host." => "%s ρυθμίση του κεντρικόυ υπολογιστή βάσης δεδομένων. ",
"PostgreSQL username and/or password not valid" => "Μη έγκυρος χρήστης και/ή συνθηματικό της PostgreSQL",
"You need to enter either an existing account or the administrator." => "Χρειάζεται να εισάγετε είτε έναν υπάρχον λογαριασμό ή του διαχειριστή.",
"Oracle username and/or password not valid" => "Μη έγκυρος χρήστης και/ή συνθηματικό της Oracle",
"MySQL username and/or password not valid" => "Μη έγκυρος χρήστης και/ή συνθηματικό της MySQL",
"DB Error: \"%s\"" => "Σφάλμα Βάσης Δεδομένων: \"%s\"",
+"Offending command was: \"%s\"" => "Η εντολη παραβατικοτητας ηταν: \"%s\"",
"MySQL user '%s'@'localhost' exists already." => "Υπάρχει ήδη ο χρήστης '%s'@'localhost' της MySQL.",
"Drop this user from MySQL" => "Απόρριψη αυτού του χρήστη από την MySQL",
"MySQL user '%s'@'%%' already exists" => "Ο χρήστης '%s'@'%%' της MySQL υπάρχει ήδη",
"Drop this user from MySQL." => "Απόρριψη αυτού του χρήστη από την MySQL",
+"Offending command was: \"%s\", name: %s, password: %s" => "Η εντολη παραβατικοτητας ηταν: \"%s\", ονομα: %s, κωδικος: %s",
+"MS SQL username and/or password not valid: %s" => "Το όνομα χρήστη και/ή ο κωδικός της MS SQL δεν είναι έγκυρα: %s",
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Ο διακομιστής σας δεν έχει ρυθμιστεί κατάλληλα ώστε να επιτρέπει τον συγχρονισμό αρχείων γιατί η διεπαφή WebDAV πιθανόν να είναι κατεστραμμένη.",
"Please double check the <a href='%s'>installation guides</a>." => "Ελέγξτε ξανά τις <a href='%s'>οδηγίες εγκατάστασης</a>.",
"seconds ago" => "δευτερόλεπτα πριν",
@@ -39,14 +42,11 @@
"1 hour ago" => "1 ώρα πριν",
"%d hours ago" => "%d ώρες πριν",
"today" => "σήμερα",
-"yesterday" => "χθές",
+"yesterday" => "χτες",
"%d days ago" => "%d ημέρες πριν",
-"last month" => "τον προηγούμενο μήνα",
+"last month" => "τελευταίο μήνα",
"%d months ago" => "%d μήνες πριν",
-"last year" => "τον προηγούμενο χρόνο",
+"last year" => "τελευταίο χρόνο",
"years ago" => "χρόνια πριν",
-"%s is available. Get <a href=\"%s\">more information</a>" => "%s είναι διαθέσιμο. Δείτε <a href=\"%s\">περισσότερες πληροφορίες</a>",
-"up to date" => "ενημερωμένο",
-"updates check is disabled" => "ο έλεγχος ενημερώσεων είναι απενεργοποιημένος",
"Could not find category \"%s\"" => "Αδυναμία εύρεσης κατηγορίας \"%s\""
);
diff --git a/lib/l10n/eo.php b/lib/l10n/eo.php
index dac11ffe7e6..2782be65da9 100644
--- a/lib/l10n/eo.php
+++ b/lib/l10n/eo.php
@@ -15,7 +15,7 @@
"Files" => "Dosieroj",
"Text" => "Teksto",
"Images" => "Bildoj",
-"seconds ago" => "sekundojn antaŭe",
+"seconds ago" => "sekundoj antaŭe",
"1 minute ago" => "antaŭ 1 minuto",
"%d minutes ago" => "antaŭ %d minutoj",
"1 hour ago" => "antaŭ 1 horo",
@@ -23,12 +23,9 @@
"today" => "hodiaŭ",
"yesterday" => "hieraŭ",
"%d days ago" => "antaŭ %d tagoj",
-"last month" => "lasta monato",
+"last month" => "lastamonate",
"%d months ago" => "antaŭ %d monatoj",
-"last year" => "lasta jaro",
-"years ago" => "jarojn antaŭe",
-"%s is available. Get <a href=\"%s\">more information</a>" => "%s haveblas. Ekhavu <a href=\"%s\">pli da informo</a>",
-"up to date" => "ĝisdata",
-"updates check is disabled" => "ĝisdateckontrolo estas malkapabligita",
+"last year" => "lastajare",
+"years ago" => "jaroj antaŭe",
"Could not find category \"%s\"" => "Ne troviĝis kategorio “%s”"
);
diff --git a/lib/l10n/es.php b/lib/l10n/es.php
index 37b15a375c4..af96e693d1c 100644
--- a/lib/l10n/es.php
+++ b/lib/l10n/es.php
@@ -18,7 +18,6 @@
"Images" => "Imágenes",
"Set an admin username." => "Configurar un nombre de usuario del administrador",
"Set an admin password." => "Configurar la contraseña del administrador.",
-"Specify a data folder." => "Especificar la carpeta de datos.",
"%s enter the database username." => "%s ingresar el usuario de la base de datos.",
"%s enter the database name." => "%s ingresar el nombre de la base de datos",
"%s you may not use dots in the database name" => "%s no se puede utilizar puntos en el nombre de la base de datos",
@@ -45,12 +44,9 @@
"today" => "hoy",
"yesterday" => "ayer",
"%d days ago" => "hace %d días",
-"last month" => "este mes",
+"last month" => "mes pasado",
"%d months ago" => "Hace %d meses",
-"last year" => "este año",
+"last year" => "año pasado",
"years ago" => "hace años",
-"%s is available. Get <a href=\"%s\">more information</a>" => "%s está disponible. Obtén <a href=\"%s\">más información</a>",
-"up to date" => "actualizado",
-"updates check is disabled" => "comprobar actualizaciones está desactivado",
"Could not find category \"%s\"" => "No puede encontrar la categoria \"%s\""
);
diff --git a/lib/l10n/es_AR.php b/lib/l10n/es_AR.php
index ff3d47285fc..e9da37e0a3d 100644
--- a/lib/l10n/es_AR.php
+++ b/lib/l10n/es_AR.php
@@ -1,7 +1,7 @@
<?php $TRANSLATIONS = array(
"Help" => "Ayuda",
"Personal" => "Personal",
-"Settings" => "Ajustes",
+"Settings" => "Configuración",
"Users" => "Usuarios",
"Apps" => "Aplicaciones",
"Admin" => "Administración",
@@ -11,14 +11,13 @@
"Selected files too large to generate zip file." => "Los archivos seleccionados son demasiado grandes para generar el archivo zip.",
"couldn't be determined" => "no pudo ser determinado",
"Application is not enabled" => "La aplicación no está habilitada",
-"Authentication error" => "Error de autenticación",
+"Authentication error" => "Error al autenticar",
"Token expired. Please reload page." => "Token expirado. Por favor, recargá la página.",
"Files" => "Archivos",
"Text" => "Texto",
"Images" => "Imágenes",
"Set an admin username." => "Configurar un nombre de administrador",
"Set an admin password." => "Configurar una palabra clave de administrador",
-"Specify a data folder." => "Especificar un directorio de datos",
"%s enter the database username." => "%s Entre el Usuario de la Base de Datos",
"%s enter the database name." => "%s Entre el Nombre de la Base de Datos",
"%s you may not use dots in the database name" => "%s no puede usar puntos en el nombre de la Base de Datos",
@@ -37,7 +36,7 @@
"MS SQL username and/or password not valid: %s" => "Nombre de usuario y contraseña de MS SQL no son válidas: %s",
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Tu servidor web no está configurado todavía para permitir sincronización de archivos porque la interfaz WebDAV parece no funcionar.",
"Please double check the <a href='%s'>installation guides</a>." => "Por favor, comprobá nuevamente la <a href='%s'>guía de instalación</a>.",
-"seconds ago" => "hace unos segundos",
+"seconds ago" => "segundos atrás",
"1 minute ago" => "hace 1 minuto",
"%d minutes ago" => "hace %d minutos",
"1 hour ago" => "1 hora atrás",
@@ -45,12 +44,9 @@
"today" => "hoy",
"yesterday" => "ayer",
"%d days ago" => "hace %d días",
-"last month" => "este mes",
+"last month" => "el mes pasado",
"%d months ago" => "%d meses atrás",
-"last year" => "este año",
-"years ago" => "hace años",
-"%s is available. Get <a href=\"%s\">more information</a>" => "%s está disponible. Conseguí <a href=\"%s\">más información</a>",
-"up to date" => "actualizado",
-"updates check is disabled" => "comprobar actualizaciones está desactivado",
+"last year" => "el año pasado",
+"years ago" => "años atrás",
"Could not find category \"%s\"" => "No fue posible encontrar la categoría \"%s\""
);
diff --git a/lib/l10n/et_EE.php b/lib/l10n/et_EE.php
index cdcf762d9a6..a4423343ce0 100644
--- a/lib/l10n/et_EE.php
+++ b/lib/l10n/et_EE.php
@@ -9,6 +9,7 @@
"Files need to be downloaded one by one." => "Failid tuleb alla laadida ükshaaval.",
"Back to Files" => "Tagasi failide juurde",
"Selected files too large to generate zip file." => "Valitud failid on ZIP-faili loomiseks liiga suured.",
+"couldn't be determined" => "ei suudetud tuvastada",
"Application is not enabled" => "Rakendus pole sisse lülitatud",
"Authentication error" => "Autentimise viga",
"Token expired. Please reload page." => "Kontrollkood aegus. Paelun lae leht uuesti.",
@@ -17,10 +18,24 @@
"Images" => "Pildid",
"Set an admin username." => "Määra admin kasutajanimi.",
"Set an admin password." => "Määra admini parool.",
-"Specify a data folder." => "Määra andmete kaust.",
+"%s enter the database username." => "%s sisesta andmebaasi kasutajatunnus.",
+"%s enter the database name." => "%s sisesta andmebaasi nimi.",
+"%s you may not use dots in the database name" => "%s punktide kasutamine andmebaasi nimes pole lubatud",
+"%s set the database host." => "%s määra andmebaasi server.",
+"PostgreSQL username and/or password not valid" => "PostgreSQL kasutajatunnus ja/või parool pole õiged",
+"You need to enter either an existing account or the administrator." => "Sisesta kas juba olemasolev konto või administrator.",
+"Oracle username and/or password not valid" => "Oracle kasutajatunnus ja/või parool pole õiged",
+"MySQL username and/or password not valid" => "MySQL kasutajatunnus ja/või parool pole õiged",
"DB Error: \"%s\"" => "Andmebaasi viga: \"%s\"",
+"Offending command was: \"%s\"" => "Tõrkuv käsk oli: \"%s\"",
+"MySQL user '%s'@'localhost' exists already." => "MySQL kasutaja '%s'@'localhost' on juba olemas.",
"Drop this user from MySQL" => "Kustuta see kasutaja MySQL-ist",
+"MySQL user '%s'@'%%' already exists" => "MySQL kasutaja '%s'@'%%' on juba olemas",
"Drop this user from MySQL." => "Kustuta see kasutaja MySQL-ist.",
+"Offending command was: \"%s\", name: %s, password: %s" => "Tõrkuv käsk oli: \"%s\", nimi: %s, parool: %s",
+"MS SQL username and/or password not valid: %s" => "MS SQL kasutajatunnus ja/või parool pole õiged: %s",
+"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Veebiserveri ei ole veel korralikult seadistatud võimaldamaks failide sünkroniseerimist, kuna WebDAV liides näib olevat mittetoimiv.",
+"Please double check the <a href='%s'>installation guides</a>." => "Palun tutvu veelkord <a href='%s'>paigalduse juhenditega</a>.",
"seconds ago" => "sekundit tagasi",
"1 minute ago" => "1 minut tagasi",
"%d minutes ago" => "%d minutit tagasi",
@@ -29,11 +44,9 @@
"today" => "täna",
"yesterday" => "eile",
"%d days ago" => "%d päeva tagasi",
-"last month" => "eelmisel kuul",
+"last month" => "viimasel kuul",
"%d months ago" => "%d kuud tagasi",
-"last year" => "eelmisel aastal",
+"last year" => "viimasel aastal",
"years ago" => "aastat tagasi",
-"%s is available. Get <a href=\"%s\">more information</a>" => "%s on saadaval. Vaata <a href=\"%s\">lisainfot</a>",
-"up to date" => "ajakohane",
-"updates check is disabled" => "uuenduste kontrollimine on välja lülitatud"
+"Could not find category \"%s\"" => "Ei leia kategooriat \"%s\""
);
diff --git a/lib/l10n/eu.php b/lib/l10n/eu.php
index 36eb397e425..934a4d19ab5 100644
--- a/lib/l10n/eu.php
+++ b/lib/l10n/eu.php
@@ -11,14 +11,13 @@
"Selected files too large to generate zip file." => "Hautatuko fitxategiak oso handiak dira zip fitxategia sortzeko.",
"couldn't be determined" => "ezin izan da zehaztu",
"Application is not enabled" => "Aplikazioa ez dago gaituta",
-"Authentication error" => "Autentikazio errorea",
+"Authentication error" => "Autentifikazio errorea",
"Token expired. Please reload page." => "Tokena iraungitu da. Mesedez birkargatu orria.",
"Files" => "Fitxategiak",
"Text" => "Testua",
"Images" => "Irudiak",
"Set an admin username." => "Ezarri administraziorako erabiltzaile izena.",
"Set an admin password." => "Ezarri administraziorako pasahitza.",
-"Specify a data folder." => "Zehaztu data karpeta.",
"%s enter the database username." => "%s sartu datu basearen erabiltzaile izena.",
"%s enter the database name." => "%s sartu datu basearen izena.",
"%s you may not use dots in the database name" => "%s ezin duzu punturik erabili datu basearen izenean.",
@@ -37,7 +36,7 @@
"MS SQL username and/or password not valid: %s" => "MS SQL erabiltzaile izena edota pasahitza ez dira egokiak: %s",
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Zure web zerbitzaria ez dago oraindik ongi konfiguratuta fitxategien sinkronizazioa egiteko, WebDAV interfazea ongi ez dagoela dirudi.",
"Please double check the <a href='%s'>installation guides</a>." => "Mesedez begiratu <a href='%s'>instalazio gidak</a>.",
-"seconds ago" => "orain dela segundu batzuk",
+"seconds ago" => "segundu",
"1 minute ago" => "orain dela minutu 1",
"%d minutes ago" => "orain dela %d minutu",
"1 hour ago" => "orain dela ordu bat",
@@ -45,12 +44,9 @@
"today" => "gaur",
"yesterday" => "atzo",
"%d days ago" => "orain dela %d egun",
-"last month" => "joan den hilabetea",
+"last month" => "joan den hilabetean",
"%d months ago" => "orain dela %d hilabete",
-"last year" => "joan den urtea",
-"years ago" => "orain dela urte batzuk",
-"%s is available. Get <a href=\"%s\">more information</a>" => "%s eskuragarri dago. Lortu <a href=\"%s\">informazio gehiago</a>",
-"up to date" => "eguneratuta",
-"updates check is disabled" => "eguneraketen egiaztapena ez dago gaituta",
+"last year" => "joan den urtean",
+"years ago" => "urte",
"Could not find category \"%s\"" => "Ezin da \"%s\" kategoria aurkitu"
);
diff --git a/lib/l10n/fa.php b/lib/l10n/fa.php
index bbb04290a5c..b0d423421df 100644
--- a/lib/l10n/fa.php
+++ b/lib/l10n/fa.php
@@ -14,6 +14,8 @@
"Files" => "پرونده‌ها",
"Text" => "متن",
"Images" => "تصاویر",
+"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "احتمالاً وب سرور شما طوری تنظیم نشده است که اجازه ی همگام سازی فایلها را بدهد زیرا به نظر میرسد رابط WebDAV از کار افتاده است.",
+"Please double check the <a href='%s'>installation guides</a>." => "لطفاً دوباره <a href='%s'>راهنمای نصب</a>را بررسی کنید.",
"seconds ago" => "ثانیه‌ها پیش",
"1 minute ago" => "1 دقیقه پیش",
"%d minutes ago" => "%d دقیقه پیش",
diff --git a/lib/l10n/fi.php b/lib/l10n/fi.php
new file mode 100644
index 00000000000..daaddb25e48
--- /dev/null
+++ b/lib/l10n/fi.php
@@ -0,0 +1,3 @@
+<?php $TRANSLATIONS = array(
+"Settings" => "asetukset"
+);
diff --git a/lib/l10n/fi_FI.php b/lib/l10n/fi_FI.php
index 89a584d389d..c2e83f66166 100644
--- a/lib/l10n/fi_FI.php
+++ b/lib/l10n/fi_FI.php
@@ -11,14 +11,13 @@
"Selected files too large to generate zip file." => "Valitut tiedostot ovat liian suurikokoisia mahtuakseen zip-tiedostoon.",
"couldn't be determined" => "ei voitu määrittää",
"Application is not enabled" => "Sovellusta ei ole otettu käyttöön",
-"Authentication error" => "Todennusvirhe",
+"Authentication error" => "Tunnistautumisvirhe",
"Token expired. Please reload page." => "Valtuutus vanheni. Lataa sivu uudelleen.",
"Files" => "Tiedostot",
"Text" => "Teksti",
"Images" => "Kuvat",
"Set an admin username." => "Aseta ylläpitäjän käyttäjätunnus.",
"Set an admin password." => "Aseta ylläpitäjän salasana.",
-"Specify a data folder." => "Määritä datakansio.",
"%s enter the database username." => "%s anna tietokannan käyttäjätunnus.",
"%s enter the database name." => "%s anna tietokannan nimi.",
"%s you may not use dots in the database name" => "%s et voi käyttää pisteitä tietokannan nimessä",
@@ -27,7 +26,9 @@
"MySQL username and/or password not valid" => "MySQL:n käyttäjätunnus ja/tai salasana on väärin",
"DB Error: \"%s\"" => "Tietokantavirhe: \"%s\"",
"MySQL user '%s'@'localhost' exists already." => "MySQL-käyttäjä '%s'@'localhost' on jo olemassa.",
+"Drop this user from MySQL" => "Pudota tämä käyttäjä MySQL:stä",
"MySQL user '%s'@'%%' already exists" => "MySQL-käyttäjä '%s'@'%%' on jo olemassa",
+"Drop this user from MySQL." => "Pudota tämä käyttäjä MySQL:stä.",
"MS SQL username and/or password not valid: %s" => "MS SQL -käyttäjätunnus ja/tai -salasana on väärin: %s",
"Please double check the <a href='%s'>installation guides</a>." => "Lue tarkasti <a href='%s'>asennusohjeet</a>.",
"seconds ago" => "sekuntia sitten",
@@ -42,8 +43,5 @@
"%d months ago" => "%d kuukautta sitten",
"last year" => "viime vuonna",
"years ago" => "vuotta sitten",
-"%s is available. Get <a href=\"%s\">more information</a>" => "%s on saatavilla. Lue <a href=\"%s\">lisätietoja</a>",
-"up to date" => "ajan tasalla",
-"updates check is disabled" => "päivitysten tarkistus on pois käytöstä",
"Could not find category \"%s\"" => "Luokkaa \"%s\" ei löytynyt"
);
diff --git a/lib/l10n/fr.php b/lib/l10n/fr.php
index 9448502df6a..c0920179dbb 100644
--- a/lib/l10n/fr.php
+++ b/lib/l10n/fr.php
@@ -18,7 +18,6 @@
"Images" => "Images",
"Set an admin username." => "Spécifiez un nom d'utilisateur pour l'administrateur.",
"Set an admin password." => "Spécifiez un mot de passe administrateur.",
-"Specify a data folder." => "Spécifiez un répertoire pour les données.",
"%s enter the database username." => "%s entrez le nom d'utilisateur de la base de données.",
"%s enter the database name." => "%s entrez le nom de la base de données.",
"%s you may not use dots in the database name" => "%s vous nez pouvez pas utiliser de points dans le nom de la base de données",
@@ -37,8 +36,8 @@
"MS SQL username and/or password not valid: %s" => "Le nom d'utilisateur et/ou le mot de passe de la base MS SQL est invalide : %s",
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Votre serveur web, n'est pas correctement configuré pour permettre la synchronisation des fichiers, car l'interface WebDav ne fonctionne pas comme il faut.",
"Please double check the <a href='%s'>installation guides</a>." => "Veuillez vous référer au <a href='%s'>guide d'installation</a>.",
-"seconds ago" => "à l'instant",
-"1 minute ago" => "il y a 1 minute",
+"seconds ago" => "il y a quelques secondes",
+"1 minute ago" => "il y a une minute",
"%d minutes ago" => "il y a %d minutes",
"1 hour ago" => "Il y a une heure",
"%d hours ago" => "Il y a %d heures",
@@ -49,8 +48,5 @@
"%d months ago" => "Il y a %d mois",
"last year" => "l'année dernière",
"years ago" => "il y a plusieurs années",
-"%s is available. Get <a href=\"%s\">more information</a>" => "%s est disponible. Obtenez <a href=\"%s\">plus d'informations</a>",
-"up to date" => "À jour",
-"updates check is disabled" => "la vérification des mises à jour est désactivée",
"Could not find category \"%s\"" => "Impossible de trouver la catégorie \"%s\""
);
diff --git a/lib/l10n/gl.php b/lib/l10n/gl.php
index a11724fef43..783826508c9 100644
--- a/lib/l10n/gl.php
+++ b/lib/l10n/gl.php
@@ -1,7 +1,7 @@
<?php $TRANSLATIONS = array(
"Help" => "Axuda",
"Personal" => "Persoal",
-"Settings" => "Configuracións",
+"Settings" => "Axustes",
"Users" => "Usuarios",
"Apps" => "Aplicativos",
"Admin" => "Administración",
@@ -11,14 +11,13 @@
"Selected files too large to generate zip file." => "Os ficheiros seleccionados son demasiado grandes como para xerar un ficheiro zip.",
"couldn't be determined" => "non foi posíbel determinalo",
"Application is not enabled" => "O aplicativo non está activado",
-"Authentication error" => "Produciuse un erro na autenticación",
+"Authentication error" => "Produciuse un erro de autenticación",
"Token expired. Please reload page." => "Testemuña caducada. Recargue a páxina.",
"Files" => "Ficheiros",
"Text" => "Texto",
"Images" => "Imaxes",
"Set an admin username." => "Estabeleza un nome de usuario administrador",
"Set an admin password." => "Estabeleza un contrasinal de administrador",
-"Specify a data folder." => "Especifique un cartafol de datos.",
"%s enter the database username." => "%s introduza o nome de usuario da base de datos",
"%s enter the database name." => "%s introduza o nome da base de datos",
"%s you may not use dots in the database name" => "%s non se poden empregar puntos na base de datos",
@@ -49,8 +48,5 @@
"%d months ago" => "Vai %d meses",
"last year" => "último ano",
"years ago" => "anos atrás",
-"%s is available. Get <a href=\"%s\">more information</a>" => "%s está dispoñíbel. Obtéña <a href=\"%s\">máis información</a>",
-"up to date" => "actualizado",
-"updates check is disabled" => "a comprobación de actualizacións está desactivada",
"Could not find category \"%s\"" => "Non foi posíbel atopar a categoría «%s»"
);
diff --git a/lib/l10n/he.php b/lib/l10n/he.php
index 078a731afc0..dcd0545adba 100644
--- a/lib/l10n/he.php
+++ b/lib/l10n/he.php
@@ -27,8 +27,5 @@
"%d months ago" => "לפני %d חודשים",
"last year" => "שנה שעברה",
"years ago" => "שנים",
-"%s is available. Get <a href=\"%s\">more information</a>" => "%s זמין. קבלת <a href=\"%s\">מידע נוסף</a>",
-"up to date" => "עדכני",
-"updates check is disabled" => "בדיקת עדכונים מנוטרלת",
"Could not find category \"%s\"" => "לא ניתן למצוא את הקטגוריה „%s“"
);
diff --git a/lib/l10n/hr.php b/lib/l10n/hr.php
index 62305c15711..3ce75c99f0e 100644
--- a/lib/l10n/hr.php
+++ b/lib/l10n/hr.php
@@ -3,6 +3,8 @@
"Personal" => "Osobno",
"Settings" => "Postavke",
"Users" => "Korisnici",
+"Apps" => "Aplikacije",
+"Admin" => "Administrator",
"Authentication error" => "Greška kod autorizacije",
"Files" => "Datoteke",
"Text" => "Tekst",
diff --git a/lib/l10n/hu_HU.php b/lib/l10n/hu_HU.php
index 537066c6fea..841020183b0 100644
--- a/lib/l10n/hu_HU.php
+++ b/lib/l10n/hu_HU.php
@@ -11,14 +11,13 @@
"Selected files too large to generate zip file." => "A kiválasztott fájlok túl nagyok a zip tömörítéshez.",
"couldn't be determined" => "nem határozható meg",
"Application is not enabled" => "Az alkalmazás nincs engedélyezve",
-"Authentication error" => "Hitelesítési hiba",
+"Authentication error" => "Azonosítási hiba",
"Token expired. Please reload page." => "A token lejárt. Frissítse az oldalt.",
"Files" => "Fájlok",
"Text" => "Szöveg",
"Images" => "Képek",
"Set an admin username." => "Állítson be egy felhasználói nevet az adminisztrációhoz.",
"Set an admin password." => "Állítson be egy jelszót az adminisztrációhoz.",
-"Specify a data folder." => "Adja meg az adatokat tartalmazó könyvtár nevét.",
"%s enter the database username." => "%s adja meg az adatbázist elérő felhasználó login nevét.",
"%s enter the database name." => "%s adja meg az adatbázis nevét.",
"%s you may not use dots in the database name" => "%s az adatbázis neve nem tartalmazhat pontot",
@@ -37,7 +36,7 @@
"MS SQL username and/or password not valid: %s" => "Az MS SQL felhasználónév és/vagy jelszó érvénytelen: %s",
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Az Ön webkiszolgálója nincs megfelelően beállítva az állományok szinkronizálásához, mert a WebDAV-elérés úgy tűnik, nem működik.",
"Please double check the <a href='%s'>installation guides</a>." => "Kérjük tüzetesen tanulmányozza át a <a href='%s'>telepítési útmutatót</a>.",
-"seconds ago" => "másodperce",
+"seconds ago" => "pár másodperce",
"1 minute ago" => "1 perce",
"%d minutes ago" => "%d perce",
"1 hour ago" => "1 órája",
@@ -48,9 +47,6 @@
"last month" => "múlt hónapban",
"%d months ago" => "%d hónapja",
"last year" => "tavaly",
-"years ago" => "éve",
-"%s is available. Get <a href=\"%s\">more information</a>" => "%s elérhető. <a href=\"%s\">További információ</a>.",
-"up to date" => "a legfrissebb változat",
-"updates check is disabled" => "A frissitések ellenőrzése nincs engedélyezve.",
+"years ago" => "több éve",
"Could not find category \"%s\"" => "Ez a kategória nem található: \"%s\""
);
diff --git a/lib/l10n/ia.php b/lib/l10n/ia.php
index 05b2c88e1ed..573281553fc 100644
--- a/lib/l10n/ia.php
+++ b/lib/l10n/ia.php
@@ -3,6 +3,8 @@
"Personal" => "Personal",
"Settings" => "Configurationes",
"Users" => "Usatores",
+"Apps" => "Applicationes",
+"Admin" => "Administration",
"Files" => "Files",
"Text" => "Texto"
);
diff --git a/lib/l10n/id.php b/lib/l10n/id.php
index 8f0e38123b6..54b46cd8961 100644
--- a/lib/l10n/id.php
+++ b/lib/l10n/id.php
@@ -1,34 +1,52 @@
<?php $TRANSLATIONS = array(
-"Help" => "bantu",
-"Personal" => "perseorangan",
-"Settings" => "pengaturan",
-"Users" => "pengguna",
-"Apps" => "aplikasi",
-"Admin" => "admin",
-"ZIP download is turned off." => "download ZIP sedang dimatikan",
-"Files need to be downloaded one by one." => "file harus di unduh satu persatu",
-"Back to Files" => "kembali ke daftar file",
-"Selected files too large to generate zip file." => "file yang dipilih terlalu besar untuk membuat file zip",
-"Application is not enabled" => "aplikasi tidak diaktifkan",
-"Authentication error" => "autentikasi bermasalah",
-"Token expired. Please reload page." => "token kadaluarsa.mohon perbaharui laman.",
+"Help" => "Bantuan",
+"Personal" => "Pribadi",
+"Settings" => "Setelan",
+"Users" => "Pengguna",
+"Apps" => "Aplikasi",
+"Admin" => "Admin",
+"ZIP download is turned off." => "Pengunduhan ZIP dimatikan.",
+"Files need to be downloaded one by one." => "Berkas harus diunduh satu persatu.",
+"Back to Files" => "Kembali ke Daftar Berkas",
+"Selected files too large to generate zip file." => "Berkas yang dipilih terlalu besar untuk dibuat berkas zip-nya.",
+"couldn't be determined" => "tidak dapat ditentukan",
+"Application is not enabled" => "Aplikasi tidak diaktifkan",
+"Authentication error" => "Galat saat autentikasi",
+"Token expired. Please reload page." => "Token kedaluwarsa. Silakan muat ulang halaman.",
"Files" => "Berkas",
-"Text" => "teks",
+"Text" => "Teks",
"Images" => "Gambar",
+"Set an admin username." => "Setel nama pengguna admin.",
+"Set an admin password." => "Setel sandi admin.",
+"%s enter the database username." => "%s masukkan nama pengguna basis data.",
+"%s enter the database name." => "%s masukkan nama basis data.",
+"%s you may not use dots in the database name" => "%sAnda tidak boleh menggunakan karakter titik pada nama basis data",
+"%s set the database host." => "%s setel host basis data.",
+"PostgreSQL username and/or password not valid" => "Nama pengguna dan/atau sandi PostgreSQL tidak valid",
+"You need to enter either an existing account or the administrator." => "Anda harus memasukkan akun yang sudah ada atau administrator.",
+"Oracle username and/or password not valid" => "Nama pengguna dan/atau sandi Oracle tidak valid",
+"MySQL username and/or password not valid" => "Nama pengguna dan/atau sandi MySQL tidak valid",
+"DB Error: \"%s\"" => "Galat Basis Data: \"%s\"",
+"Offending command was: \"%s\"" => "Perintah yang bermasalah: \"%s\"",
+"MySQL user '%s'@'localhost' exists already." => "Pengguna MySQL '%s'@'localhost' sudah ada.",
+"Drop this user from MySQL" => "Hapus pengguna ini dari MySQL",
+"MySQL user '%s'@'%%' already exists" => "Pengguna MySQL '%s'@'%%' sudah ada.",
+"Drop this user from MySQL." => "Hapus pengguna ini dari MySQL.",
+"Offending command was: \"%s\", name: %s, password: %s" => "Perintah yang bermasalah: \"%s\", nama pengguna: %s, sandi: %s",
+"MS SQL username and/or password not valid: %s" => "Nama pengguna dan/atau sandi MySQL tidak valid: %s",
+"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Web server Anda belum dikonfigurasikan dengan baik untuk mengizinkan sinkronisasi berkas karena tampaknya antarmuka WebDAV rusak.",
+"Please double check the <a href='%s'>installation guides</a>." => "Silakan periksa ulang <a href='%s'>panduan instalasi</a>.",
"seconds ago" => "beberapa detik yang lalu",
-"1 minute ago" => "1 menit lalu",
-"%d minutes ago" => "%d menit lalu",
+"1 minute ago" => "1 menit yang lalu",
+"%d minutes ago" => "%d menit yang lalu",
"1 hour ago" => "1 jam yang lalu",
"%d hours ago" => "%d jam yang lalu",
"today" => "hari ini",
"yesterday" => "kemarin",
-"%d days ago" => "%d hari lalu",
+"%d days ago" => "%d hari yang lalu",
"last month" => "bulan kemarin",
"%d months ago" => "%d bulan yang lalu",
"last year" => "tahun kemarin",
"years ago" => "beberapa tahun lalu",
-"%s is available. Get <a href=\"%s\">more information</a>" => "%s tersedia. dapatkan <a href=\"%s\"> info lebih lanjut</a>",
-"up to date" => "terbaru",
-"updates check is disabled" => "pengecekan pembaharuan sedang non-aktifkan",
"Could not find category \"%s\"" => "Tidak dapat menemukan kategori \"%s\""
);
diff --git a/lib/l10n/is.php b/lib/l10n/is.php
index 8fdb45a05cd..05bb6883953 100644
--- a/lib/l10n/is.php
+++ b/lib/l10n/is.php
@@ -27,8 +27,5 @@
"%d months ago" => "fyrir %d mánuðum",
"last year" => "síðasta ári",
"years ago" => "einhverjum árum",
-"%s is available. Get <a href=\"%s\">more information</a>" => "%s er í boði. Sækja <a href=\"%s\">meiri upplýsingar</a>",
-"up to date" => "nýjasta útgáfa",
-"updates check is disabled" => "uppfærslupróf er ekki virkjað",
"Could not find category \"%s\"" => "Fann ekki flokkinn \"%s\""
);
diff --git a/lib/l10n/it.php b/lib/l10n/it.php
index 297f1efde05..1db48dbc80d 100644
--- a/lib/l10n/it.php
+++ b/lib/l10n/it.php
@@ -18,7 +18,6 @@
"Images" => "Immagini",
"Set an admin username." => "Imposta un nome utente di amministrazione.",
"Set an admin password." => "Imposta una password di amministrazione.",
-"Specify a data folder." => "Specifica una cartella dei dati.",
"%s enter the database username." => "%s digita il nome utente del database.",
"%s enter the database name." => "%s digita il nome del database.",
"%s you may not use dots in the database name" => "%s non dovresti utilizzare punti nel nome del database",
@@ -38,19 +37,16 @@
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Il tuo server web non è configurato correttamente per consentire la sincronizzazione dei file poiché l'interfaccia WebDAV sembra essere danneggiata.",
"Please double check the <a href='%s'>installation guides</a>." => "Leggi attentamente le <a href='%s'>guide d'installazione</a>.",
"seconds ago" => "secondi fa",
-"1 minute ago" => "1 minuto fa",
+"1 minute ago" => "Un minuto fa",
"%d minutes ago" => "%d minuti fa",
"1 hour ago" => "1 ora fa",
"%d hours ago" => "%d ore fa",
"today" => "oggi",
"yesterday" => "ieri",
"%d days ago" => "%d giorni fa",
-"last month" => "il mese scorso",
+"last month" => "mese scorso",
"%d months ago" => "%d mesi fa",
-"last year" => "l'anno scorso",
+"last year" => "anno scorso",
"years ago" => "anni fa",
-"%s is available. Get <a href=\"%s\">more information</a>" => "%s è disponibile. Ottieni <a href=\"%s\">ulteriori informazioni</a>",
-"up to date" => "aggiornato",
-"updates check is disabled" => "il controllo degli aggiornamenti è disabilitato",
"Could not find category \"%s\"" => "Impossibile trovare la categoria \"%s\""
);
diff --git a/lib/l10n/ja_JP.php b/lib/l10n/ja_JP.php
index 529eec3ac52..3b97ffc431f 100644
--- a/lib/l10n/ja_JP.php
+++ b/lib/l10n/ja_JP.php
@@ -1,10 +1,10 @@
<?php $TRANSLATIONS = array(
"Help" => "ヘルプ",
-"Personal" => "個人設定",
+"Personal" => "個人",
"Settings" => "設定",
"Users" => "ユーザ",
"Apps" => "アプリ",
-"Admin" => "管理者",
+"Admin" => "管理",
"ZIP download is turned off." => "ZIPダウンロードは無効です。",
"Files need to be downloaded one by one." => "ファイルは1つずつダウンロードする必要があります。",
"Back to Files" => "ファイルに戻る",
@@ -18,7 +18,6 @@
"Images" => "画像",
"Set an admin username." => "管理者のユーザ名を設定。",
"Set an admin password." => "管理者のパスワードを設定。",
-"Specify a data folder." => "データフォルダを指定。",
"%s enter the database username." => "%s のデータベースのユーザ名を入力してください。",
"%s enter the database name." => "%s のデータベース名を入力してください。",
"%s you may not use dots in the database name" => "%s ではデータベース名にドットを利用できないかもしれません。",
@@ -37,20 +36,17 @@
"MS SQL username and/or password not valid: %s" => "MS SQL サーバーのユーザー名/パスワードが正しくありません: %s",
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "WebDAVインタフェースが動作していないと考えられるため、あなたのWEBサーバはまだファイルの同期を許可するように適切な設定がされていません。",
"Please double check the <a href='%s'>installation guides</a>." => "<a href='%s'>インストールガイド</a>をよく確認してください。",
-"seconds ago" => "秒前",
-"1 minute ago" => "1分前",
+"seconds ago" => "数秒前",
+"1 minute ago" => "1 分前",
"%d minutes ago" => "%d 分前",
"1 hour ago" => "1 時間前",
"%d hours ago" => "%d 時間前",
"today" => "今日",
"yesterday" => "昨日",
"%d days ago" => "%d 日前",
-"last month" => "先月",
+"last month" => "一月前",
"%d months ago" => "%d 分前",
-"last year" => "昨年",
+"last year" => "一年前",
"years ago" => "年前",
-"%s is available. Get <a href=\"%s\">more information</a>" => "%s が利用可能です。<a href=\"%s\">詳細情報</a> を確認ください",
-"up to date" => "最新です",
-"updates check is disabled" => "更新チェックは無効です",
"Could not find category \"%s\"" => "カテゴリ \"%s\" が見つかりませんでした"
);
diff --git a/lib/l10n/ka_GE.php b/lib/l10n/ka_GE.php
index ff623827216..a55323832ec 100644
--- a/lib/l10n/ka_GE.php
+++ b/lib/l10n/ka_GE.php
@@ -5,16 +5,48 @@
"Users" => "მომხმარებელი",
"Apps" => "აპლიკაციები",
"Admin" => "ადმინისტრატორი",
+"ZIP download is turned off." => "ZIP download–ი გათიშულია",
+"Files need to be downloaded one by one." => "ფაილები უნდა გადმოიტვირთოს სათითაოდ.",
+"Back to Files" => "უკან ფაილებში",
+"Selected files too large to generate zip file." => "არჩეული ფაილები ძალიან დიდია zip ფაილის გენერაციისთვის.",
+"couldn't be determined" => "ვერ განისაზღვრა",
+"Application is not enabled" => "აპლიკაცია არ არის აქტიური",
"Authentication error" => "ავთენტიფიკაციის შეცდომა",
+"Token expired. Please reload page." => "Token–ს ვადა გაუვიდა. გთხოვთ განაახლოთ გვერდი.",
"Files" => "ფაილები",
"Text" => "ტექსტი",
+"Images" => "სურათები",
+"Set an admin username." => "დააყენეთ ადმინისტრატორის სახელი.",
+"Set an admin password." => "დააყენეთ ადმინისტრატორის პაროლი.",
+"%s enter the database username." => "%s შეიყვანეთ ბაზის იუზერნეიმი.",
+"%s enter the database name." => "%s შეიყვანეთ ბაზის სახელი.",
+"%s you may not use dots in the database name" => "%s არ მიუთითოთ წერტილი ბაზის სახელში",
+"%s set the database host." => "%s მიუთითეთ ბაზის ჰოსტი.",
+"PostgreSQL username and/or password not valid" => "PostgreSQL იუზერნეიმი და/ან პაროლი არ არის სწორი",
+"You need to enter either an existing account or the administrator." => "თქვენ უნდა შეიყვანოთ არსებული მომხმარებელის სახელი ან ადმინისტრატორი.",
+"Oracle username and/or password not valid" => "Oracle იუზერნეიმი და/ან პაროლი არ არის სწორი",
+"MySQL username and/or password not valid" => "MySQL იუზერნეიმი და/ან პაროლი არ არის სწორი",
+"DB Error: \"%s\"" => "DB შეცდომა: \"%s\"",
+"Offending command was: \"%s\"" => "Offending ბრძანება იყო: \"%s\"",
+"MySQL user '%s'@'localhost' exists already." => "MySQL მომხმარებელი '%s'@'localhost' უკვე არსებობს.",
+"Drop this user from MySQL" => "წაშალე ეს მომხამრებელი MySQL–იდან",
+"MySQL user '%s'@'%%' already exists" => "MySQL მომხმარებელი '%s'@'%%' უკვე არსებობს",
+"Drop this user from MySQL." => "წაშალე ეს მომხამრებელი MySQL–იდან",
+"Offending command was: \"%s\", name: %s, password: %s" => "Offending ბრძანება იყო: \"%s\", სახელი: %s, პაროლი: %s",
+"MS SQL username and/or password not valid: %s" => "MS SQL მომხმარებელი და/ან პაროლი არ არის მართებული: %s",
+"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "თქვენი web სერვერი არ არის კონფიგურირებული ფაილ სინქრონიზაციისთვის, რადგან WebDAV ინტერფეისი შეიძლება იყოს გატეხილი.",
+"Please double check the <a href='%s'>installation guides</a>." => "გთხოვთ გადაათვალიეროთ <a href='%s'>ინსტალაციის გზამკვლევი</a>.",
"seconds ago" => "წამის წინ",
"1 minute ago" => "1 წუთის წინ",
+"%d minutes ago" => "%d წუთის წინ",
+"1 hour ago" => "1 საათის წინ",
+"%d hours ago" => "%d საათის წინ",
"today" => "დღეს",
"yesterday" => "გუშინ",
+"%d days ago" => "%d დღის წინ",
"last month" => "გასულ თვეში",
+"%d months ago" => "%d თვის წინ",
"last year" => "ბოლო წელს",
"years ago" => "წლის წინ",
-"up to date" => "განახლებულია",
-"updates check is disabled" => "განახლების ძებნა გათიშულია"
+"Could not find category \"%s\"" => "\"%s\" კატეგორიის მოძებნა ვერ მოხერხდა"
);
diff --git a/lib/l10n/ko.php b/lib/l10n/ko.php
index 859657f46b4..bf2a68369f1 100644
--- a/lib/l10n/ko.php
+++ b/lib/l10n/ko.php
@@ -28,8 +28,5 @@
"%d months ago" => "%d개월 전",
"last year" => "작년",
"years ago" => "년 전",
-"%s is available. Get <a href=\"%s\">more information</a>" => "%s을(를) 사용할 수 있습니다. <a href=\"%s\">자세한 정보 보기</a>",
-"up to date" => "최신",
-"updates check is disabled" => "업데이트 확인이 비활성화됨",
"Could not find category \"%s\"" => "분류 \"%s\"을(를) 찾을 수 없습니다."
);
diff --git a/lib/l10n/ku_IQ.php b/lib/l10n/ku_IQ.php
index f89871f23c9..20d0249f569 100644
--- a/lib/l10n/ku_IQ.php
+++ b/lib/l10n/ku_IQ.php
@@ -1,5 +1,7 @@
<?php $TRANSLATIONS = array(
"Help" => "یارمەتی",
"Settings" => "ده‌ستكاری",
-"Users" => "به‌كارهێنه‌ر"
+"Users" => "به‌كارهێنه‌ر",
+"Apps" => "به‌رنامه‌كان",
+"Admin" => "به‌ڕێوه‌به‌ری سه‌ره‌كی"
);
diff --git a/lib/l10n/lb.php b/lib/l10n/lb.php
index 06e8b2ca094..889fc3a377d 100644
--- a/lib/l10n/lb.php
+++ b/lib/l10n/lb.php
@@ -2,6 +2,9 @@
"Help" => "Hëllef",
"Personal" => "Perséinlech",
"Settings" => "Astellungen",
+"Users" => "Benotzer",
+"Apps" => "Applicatiounen",
+"Admin" => "Admin",
"Authentication error" => "Authentifikatioun's Fehler",
"Files" => "Dateien",
"Text" => "SMS",
diff --git a/lib/l10n/lt_LT.php b/lib/l10n/lt_LT.php
index b84c155633b..cebaa6937d8 100644
--- a/lib/l10n/lt_LT.php
+++ b/lib/l10n/lt_LT.php
@@ -14,16 +14,13 @@
"Token expired. Please reload page." => "Sesija baigėsi. Prašome perkrauti puslapį.",
"Files" => "Failai",
"Text" => "Žinučių",
-"seconds ago" => "prieš kelias sekundes",
-"1 minute ago" => "prieš 1 minutę",
+"seconds ago" => "prieš sekundę",
+"1 minute ago" => "Prieš 1 minutę",
"%d minutes ago" => "prieš %d minučių",
"today" => "šiandien",
"yesterday" => "vakar",
"%d days ago" => "prieš %d dienų",
-"last month" => "praėjusį mėnesį",
-"last year" => "pereitais metais",
-"years ago" => "prieš metus",
-"%s is available. Get <a href=\"%s\">more information</a>" => "%s yra galimas. Platesnė <a href=\"%s\">informacija čia</a>",
-"up to date" => "pilnai atnaujinta",
-"updates check is disabled" => "atnaujinimų tikrinimas išjungtas"
+"last month" => "praeitą mėnesį",
+"last year" => "praeitais metais",
+"years ago" => "prieš metus"
);
diff --git a/lib/l10n/lv.php b/lib/l10n/lv.php
index c73d306ca0a..28b96c56e10 100644
--- a/lib/l10n/lv.php
+++ b/lib/l10n/lv.php
@@ -18,7 +18,6 @@
"Images" => "Attēli",
"Set an admin username." => "Iestatiet administratora lietotājvārdu.",
"Set an admin password." => "Iestatiet administratora paroli.",
-"Specify a data folder." => "Norādiet datu mapi.",
"%s enter the database username." => "%s ievadiet datubāzes lietotājvārdu.",
"%s enter the database name." => "%s ievadiet datubāzes nosaukumu.",
"%s you may not use dots in the database name" => "%s datubāžu nosaukumos nedrīkst izmantot punktus",
@@ -49,8 +48,5 @@
"%d months ago" => "pirms %d mēnešiem",
"last year" => "gājušajā gadā",
"years ago" => "gadus atpakaļ",
-"%s is available. Get <a href=\"%s\">more information</a>" => "%s ir pieejams. Iegūt <a href=\"%s\">vairāk informācijas</a>",
-"up to date" => "ir aktuāls",
-"updates check is disabled" => "atjauninājumu pārbaude ir deaktivēta",
"Could not find category \"%s\"" => "Nevarēja atrast kategoriju “%s”"
);
diff --git a/lib/l10n/mk.php b/lib/l10n/mk.php
index 5b3efffb22a..34790c93745 100644
--- a/lib/l10n/mk.php
+++ b/lib/l10n/mk.php
@@ -1,7 +1,7 @@
<?php $TRANSLATIONS = array(
"Help" => "Помош",
"Personal" => "Лично",
-"Settings" => "Параметри",
+"Settings" => "Подесувања",
"Users" => "Корисници",
"Apps" => "Аппликации",
"Admin" => "Админ",
@@ -27,8 +27,5 @@
"%d months ago" => "пред %d месеци",
"last year" => "минатата година",
"years ago" => "пред години",
-"%s is available. Get <a href=\"%s\">more information</a>" => "%s е достапно. Земи <a href=\"%s\">повеќе информации</a>",
-"up to date" => "ажурно",
-"updates check is disabled" => "проверката за ажурирања е оневозможена",
"Could not find category \"%s\"" => "Не можам да најдам категорија „%s“"
);
diff --git a/lib/l10n/ms_MY.php b/lib/l10n/ms_MY.php
index 5afee1cb5a8..6abbbe86e80 100644
--- a/lib/l10n/ms_MY.php
+++ b/lib/l10n/ms_MY.php
@@ -3,6 +3,8 @@
"Personal" => "Peribadi",
"Settings" => "Tetapan",
"Users" => "Pengguna",
+"Apps" => "Aplikasi",
+"Admin" => "Admin",
"Authentication error" => "Ralat pengesahan",
"Files" => "Fail-fail",
"Text" => "Teks"
diff --git a/lib/l10n/my_MM.php b/lib/l10n/my_MM.php
index d725a06a3a9..5d1812fd742 100644
--- a/lib/l10n/my_MM.php
+++ b/lib/l10n/my_MM.php
@@ -24,8 +24,5 @@
"%d months ago" => "%d လအရင်က",
"last year" => "မနှစ်က",
"years ago" => "နှစ် အရင်က",
-"%s is available. Get <a href=\"%s\">more information</a>" => "%s ကိုရရှိနိုင်ပါပြီ။ <a href=\"%s\">နောက်ထပ်အချက်အလက်များ</a>ရယူပါ။",
-"up to date" => "နောက်ဆုံးပေါ်",
-"updates check is disabled" => "နောက်ဆုံးပေါ်စစ်ဆေးခြင်းကိုပိတ်ထားသည်",
"Could not find category \"%s\"" => "\"%s\"ခေါင်းစဉ်ကို ရှာမတွေ့ပါ"
);
diff --git a/lib/l10n/nb_NO.php b/lib/l10n/nb_NO.php
index 01144672caa..23146154c77 100644
--- a/lib/l10n/nb_NO.php
+++ b/lib/l10n/nb_NO.php
@@ -10,11 +10,13 @@
"Back to Files" => "Tilbake til filer",
"Selected files too large to generate zip file." => "De valgte filene er for store til å kunne generere ZIP-fil",
"Application is not enabled" => "Applikasjon er ikke påslått",
-"Authentication error" => "Autentiseringsfeil",
+"Authentication error" => "Autentikasjonsfeil",
"Token expired. Please reload page." => "Symbol utløpt. Vennligst last inn siden på nytt.",
"Files" => "Filer",
"Text" => "Tekst",
"Images" => "Bilder",
+"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Din nettservev er ikke konfigurert korrekt for filsynkronisering. WebDAV ser ut til å ikke funkere.",
+"Please double check the <a href='%s'>installation guides</a>." => "Vennligst dobbelsjekk <a href='%s'>installasjonsguiden</a>.",
"seconds ago" => "sekunder siden",
"1 minute ago" => "1 minutt siden",
"%d minutes ago" => "%d minutter siden",
@@ -25,10 +27,7 @@
"%d days ago" => "%d dager siden",
"last month" => "forrige måned",
"%d months ago" => "%d måneder siden",
-"last year" => "i fjor",
+"last year" => "forrige år",
"years ago" => "år siden",
-"%s is available. Get <a href=\"%s\">more information</a>" => "%s er tilgjengelig. Få <a href=\"%s\">mer informasjon</a>",
-"up to date" => "oppdatert",
-"updates check is disabled" => "versjonssjekk er avslått",
"Could not find category \"%s\"" => "Kunne ikke finne kategori \"%s\""
);
diff --git a/lib/l10n/nl.php b/lib/l10n/nl.php
index e26a663e9cc..0c387142619 100644
--- a/lib/l10n/nl.php
+++ b/lib/l10n/nl.php
@@ -18,7 +18,6 @@
"Images" => "Afbeeldingen",
"Set an admin username." => "Stel de gebruikersnaam van de beheerder in.",
"Set an admin password." => "Stel een beheerderswachtwoord in.",
-"Specify a data folder." => "Geef een datamap op.",
"%s enter the database username." => "%s opgeven database gebruikersnaam.",
"%s enter the database name." => "%s opgeven databasenaam.",
"%s you may not use dots in the database name" => "%s er mogen geen puntjes in de databasenaam voorkomen",
@@ -36,7 +35,7 @@
"Offending command was: \"%s\", name: %s, password: %s" => "Onjuiste commando was: \"%s\", naam: %s, wachtwoord: %s",
"MS SQL username and/or password not valid: %s" => "MS SQL gebruikersnaam en/of wachtwoord niet geldig: %s",
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Uw webserver is nog niet goed ingesteld voor bestandssynchronisatie omdat de WebDAV interface verbroken lijkt.",
-"Please double check the <a href='%s'>installation guides</a>." => "Conntroleer de <a href='%s'>installatie handleiding</a> goed.",
+"Please double check the <a href='%s'>installation guides</a>." => "Controleer de <a href='%s'>installatiehandleiding</a> goed.",
"seconds ago" => "seconden geleden",
"1 minute ago" => "1 minuut geleden",
"%d minutes ago" => "%d minuten geleden",
@@ -49,8 +48,5 @@
"%d months ago" => "%d maanden geleden",
"last year" => "vorig jaar",
"years ago" => "jaar geleden",
-"%s is available. Get <a href=\"%s\">more information</a>" => "%s is beschikbaar. Verkrijg <a href=\"%s\">meer informatie</a>",
-"up to date" => "bijgewerkt",
-"updates check is disabled" => "Meest recente versie controle is uitgeschakeld",
"Could not find category \"%s\"" => "Kon categorie \"%s\" niet vinden"
);
diff --git a/lib/l10n/nn_NO.php b/lib/l10n/nn_NO.php
index faf7440320a..8241573f9ae 100644
--- a/lib/l10n/nn_NO.php
+++ b/lib/l10n/nn_NO.php
@@ -3,7 +3,19 @@
"Personal" => "Personleg",
"Settings" => "Innstillingar",
"Users" => "Brukarar",
+"Apps" => "Program",
+"Admin" => "Administrer",
"Authentication error" => "Feil i autentisering",
"Files" => "Filer",
-"Text" => "Tekst"
+"Text" => "Tekst",
+"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Tenaren din er ikkje enno rett innstilt til å tilby filsynkronisering sidan WebDAV-grensesnittet ser ut til å vera øydelagt.",
+"Please double check the <a href='%s'>installation guides</a>." => "Ver vennleg og dobbeltsjekk <a href='%s'>installasjonsrettleiinga</a>.",
+"seconds ago" => "sekund sidan",
+"1 minute ago" => "1 minutt sidan",
+"1 hour ago" => "1 time sidan",
+"today" => "i dag",
+"yesterday" => "i går",
+"last month" => "førre månad",
+"last year" => "i fjor",
+"years ago" => "år sidan"
);
diff --git a/lib/l10n/oc.php b/lib/l10n/oc.php
index 89161393380..85e2a27b431 100644
--- a/lib/l10n/oc.php
+++ b/lib/l10n/oc.php
@@ -18,7 +18,5 @@
"%d days ago" => "%d jorns a",
"last month" => "mes passat",
"last year" => "an passat",
-"years ago" => "ans a",
-"up to date" => "a jorn",
-"updates check is disabled" => "la verificacion de mesa a jorn es inactiva"
+"years ago" => "ans a"
);
diff --git a/lib/l10n/pl.php b/lib/l10n/pl.php
index 9a1a5e836c9..4ac1c14439f 100644
--- a/lib/l10n/pl.php
+++ b/lib/l10n/pl.php
@@ -18,7 +18,6 @@
"Images" => "Obrazy",
"Set an admin username." => "Ustaw nazwę administratora.",
"Set an admin password." => "Ustaw hasło administratora.",
-"Specify a data folder." => "Określ folder danych.",
"%s enter the database username." => "%s wpisz nazwę użytkownika do bazy",
"%s enter the database name." => "%s wpisz nazwę bazy.",
"%s you may not use dots in the database name" => "%s nie można używać kropki w nazwie bazy danych",
@@ -35,22 +34,19 @@
"Drop this user from MySQL." => "Usuń tego użytkownika z MySQL.",
"Offending command was: \"%s\", name: %s, password: %s" => "Niepoprawne polecania: \"%s\", nazwa: %s, hasło: %s",
"MS SQL username and/or password not valid: %s" => "Nazwa i/lub hasło serwera MS SQL jest niepoprawne: %s.",
-"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Serwer www nie jest jeszcze poprawnie ustawiony, aby umożliwić synchronizację plików, ponieważ interfejs WebDAV wydaje się być uszkodzony. Sprawdź ustawienia serwera.",
-"Please double check the <a href='%s'>installation guides</a>." => "Proszę sprawdź ponownie <a href='%s'>przewodnik instalacji</a>.",
+"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Serwer internetowy nie jest jeszcze poprawnie skonfigurowany, aby umożliwić synchronizację plików, ponieważ interfejs WebDAV wydaje się być uszkodzony.",
+"Please double check the <a href='%s'>installation guides</a>." => "Sprawdź ponownie <a href='%s'>przewodniki instalacji</a>.",
"seconds ago" => "sekund temu",
"1 minute ago" => "1 minutę temu",
"%d minutes ago" => "%d minut temu",
-"1 hour ago" => "1 godzine temu",
+"1 hour ago" => "1 godzinę temu",
"%d hours ago" => "%d godzin temu",
-"today" => "dzisiaj",
+"today" => "dziś",
"yesterday" => "wczoraj",
"%d days ago" => "%d dni temu",
-"last month" => "ostatni miesiąc",
+"last month" => "w zeszłym miesiącu",
"%d months ago" => "%d miesiecy temu",
-"last year" => "ostatni rok",
+"last year" => "w zeszłym roku",
"years ago" => "lat temu",
-"%s is available. Get <a href=\"%s\">more information</a>" => "%s jest dostępna. Uzyskaj <a href=\"%s\">więcej informacji</a>",
-"up to date" => "Aktualne",
-"updates check is disabled" => "wybór aktualizacji jest wyłączony",
"Could not find category \"%s\"" => "Nie można odnaleźć kategorii \"%s\""
);
diff --git a/lib/l10n/pt_BR.php b/lib/l10n/pt_BR.php
index d4f410d8885..4c50f8de9e6 100644
--- a/lib/l10n/pt_BR.php
+++ b/lib/l10n/pt_BR.php
@@ -18,7 +18,6 @@
"Images" => "Imagens",
"Set an admin username." => "Defina um nome de usuário de administrador.",
"Set an admin password." => "Defina uma senha de administrador.",
-"Specify a data folder." => "Especifique uma pasta de dados.",
"%s enter the database username." => "%s insira o nome de usuário do banco de dados.",
"%s enter the database name." => "%s insira o nome do banco de dados.",
"%s you may not use dots in the database name" => "%s você não pode usar pontos no nome do banco de dados",
@@ -49,8 +48,5 @@
"%d months ago" => "%d meses atrás",
"last year" => "último ano",
"years ago" => "anos atrás",
-"%s is available. Get <a href=\"%s\">more information</a>" => "%s está disponível. Obtenha <a href=\"%s\">mais informações</a>",
-"up to date" => "atualizado",
-"updates check is disabled" => "checagens de atualização estão desativadas",
"Could not find category \"%s\"" => "Impossível localizar categoria \"%s\""
);
diff --git a/lib/l10n/pt_PT.php b/lib/l10n/pt_PT.php
index 2c813f5b07c..b3befe96e03 100644
--- a/lib/l10n/pt_PT.php
+++ b/lib/l10n/pt_PT.php
@@ -18,7 +18,6 @@
"Images" => "Imagens",
"Set an admin username." => "Definir um nome de utilizador de administrador",
"Set an admin password." => "Definiar uma password de administrador",
-"Specify a data folder." => "Especificar a pasta para os dados.",
"%s enter the database username." => "%s introduza o nome de utilizador da base de dados",
"%s enter the database name." => "%s introduza o nome da base de dados",
"%s you may not use dots in the database name" => "%s não é permitido utilizar pontos (.) no nome da base de dados",
@@ -37,20 +36,17 @@
"MS SQL username and/or password not valid: %s" => "Nome de utilizador/password do MySQL é inválido: %s",
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "O seu servidor web não está configurado correctamente para autorizar sincronização de ficheiros, pois o interface WebDAV parece estar com problemas.",
"Please double check the <a href='%s'>installation guides</a>." => "Por favor verifique <a href='%s'>installation guides</a>.",
-"seconds ago" => "há alguns segundos",
-"1 minute ago" => "há 1 minuto",
+"seconds ago" => "Minutos atrás",
+"1 minute ago" => "Há 1 minuto",
"%d minutes ago" => "há %d minutos",
"1 hour ago" => "Há 1 horas",
"%d hours ago" => "Há %d horas",
"today" => "hoje",
"yesterday" => "ontem",
"%d days ago" => "há %d dias",
-"last month" => "mês passado",
+"last month" => "ultímo mês",
"%d months ago" => "Há %d meses atrás",
"last year" => "ano passado",
-"years ago" => "há anos",
-"%s is available. Get <a href=\"%s\">more information</a>" => "%s está disponível. Obtenha <a href=\"%s\">mais informação</a>",
-"up to date" => "actualizado",
-"updates check is disabled" => "a verificação de actualizações está desligada",
+"years ago" => "anos atrás",
"Could not find category \"%s\"" => "Não foi encontrado a categoria \"%s\""
);
diff --git a/lib/l10n/ro.php b/lib/l10n/ro.php
index 3f8e59cdac2..6661caf86e7 100644
--- a/lib/l10n/ro.php
+++ b/lib/l10n/ro.php
@@ -28,8 +28,5 @@
"%d months ago" => "%d luni in urma",
"last year" => "ultimul an",
"years ago" => "ani în urmă",
-"%s is available. Get <a href=\"%s\">more information</a>" => "%s este disponibil. Vezi <a href=\"%s\">mai multe informații</a>",
-"up to date" => "la zi",
-"updates check is disabled" => "verificarea după actualizări este dezactivată",
"Could not find category \"%s\"" => "Cloud nu a gasit categoria \"%s\""
);
diff --git a/lib/l10n/ru.php b/lib/l10n/ru.php
index 25a88d5efc2..e716f6d1c11 100644
--- a/lib/l10n/ru.php
+++ b/lib/l10n/ru.php
@@ -1,7 +1,7 @@
<?php $TRANSLATIONS = array(
"Help" => "Помощь",
"Personal" => "Личное",
-"Settings" => "Настройки",
+"Settings" => "Конфигурация",
"Users" => "Пользователи",
"Apps" => "Приложения",
"Admin" => "Admin",
@@ -18,7 +18,6 @@
"Images" => "Изображения",
"Set an admin username." => "Установить имя пользователя для admin.",
"Set an admin password." => "становит пароль для admin.",
-"Specify a data folder." => "Указать папку данных.",
"%s enter the database username." => "%s введите имя пользователя базы данных.",
"%s enter the database name." => "%s введите имя базы данных.",
"%s you may not use dots in the database name" => "%s Вы не можете использовать точки в имени базы данных",
@@ -37,7 +36,7 @@
"MS SQL username and/or password not valid: %s" => "Имя пользователя и/или пароль MS SQL не подходит: %s",
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Ваш веб сервер до сих пор не настроен правильно для возможности синхронизации файлов, похоже что проблема в неисправности интерфейса WebDAV.",
"Please double check the <a href='%s'>installation guides</a>." => "Пожалуйста, дважды просмотрите <a href='%s'>инструкции по установке</a>.",
-"seconds ago" => "менее минуты",
+"seconds ago" => "несколько секунд назад",
"1 minute ago" => "1 минуту назад",
"%d minutes ago" => "%d минут назад",
"1 hour ago" => "час назад",
@@ -48,9 +47,6 @@
"last month" => "в прошлом месяце",
"%d months ago" => "%d месяцев назад",
"last year" => "в прошлом году",
-"years ago" => "годы назад",
-"%s is available. Get <a href=\"%s\">more information</a>" => "Возможно обновление до %s. <a href=\"%s\">Подробнее</a>",
-"up to date" => "актуальная версия",
-"updates check is disabled" => "проверка обновлений отключена",
+"years ago" => "несколько лет назад",
"Could not find category \"%s\"" => "Категория \"%s\" не найдена"
);
diff --git a/lib/l10n/ru_RU.php b/lib/l10n/ru_RU.php
index de770563662..8fb568aee7e 100644
--- a/lib/l10n/ru_RU.php
+++ b/lib/l10n/ru_RU.php
@@ -1,37 +1,3 @@
<?php $TRANSLATIONS = array(
-"Help" => "Помощь",
-"Personal" => "Персональный",
-"Settings" => "Настройки",
-"Users" => "Пользователи",
-"Apps" => "Приложения",
-"Admin" => "Админ",
-"ZIP download is turned off." => "Загрузка ZIP выключена.",
-"Files need to be downloaded one by one." => "Файлы должны быть загружены один за другим.",
-"Back to Files" => "Обратно к файлам",
-"Selected files too large to generate zip file." => "Выбранные файлы слишком велики для генерации zip-архива.",
-"couldn't be determined" => "не может быть определено",
-"Application is not enabled" => "Приложение не запущено",
-"Authentication error" => "Ошибка аутентификации",
-"Token expired. Please reload page." => "Маркер истек. Пожалуйста, перезагрузите страницу.",
-"Files" => "Файлы",
-"Text" => "Текст",
-"Images" => "Изображения",
-"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Ваш веб сервер ещё не достаточно точно настроен для возможности синхронизации, т.к. похоже, что интерфейс WebDAV сломан.",
-"Please double check the <a href='%s'>installation guides</a>." => "Пожалуйста проверте дважды <a href='%s'>гиды по установке</a>.",
-"seconds ago" => "секунд назад",
-"1 minute ago" => "1 минуту назад",
-"%d minutes ago" => "%d минут назад",
-"1 hour ago" => "1 час назад",
-"%d hours ago" => "%d часов назад",
-"today" => "сегодня",
-"yesterday" => "вчера",
-"%d days ago" => "%d дней назад",
-"last month" => "в прошлом месяце",
-"%d months ago" => "%d месяцев назад",
-"last year" => "в прошлом году",
-"years ago" => "год назад",
-"%s is available. Get <a href=\"%s\">more information</a>" => "%s доступно. Получите <a href=\"%s\">more information</a>",
-"up to date" => "до настоящего времени",
-"updates check is disabled" => "Проверка обновлений отключена",
-"Could not find category \"%s\"" => "Не удалось найти категорию \"%s\""
+"Settings" => "Настройки"
);
diff --git a/lib/l10n/si_LK.php b/lib/l10n/si_LK.php
index 25624acf705..4846fdcc066 100644
--- a/lib/l10n/si_LK.php
+++ b/lib/l10n/si_LK.php
@@ -10,7 +10,7 @@
"Back to Files" => "ගොනු වෙතට නැවත යන්න",
"Selected files too large to generate zip file." => "තෝරාගත් ගොනු ZIP ගොනුවක් තැනීමට විශාල වැඩිය.",
"Application is not enabled" => "යෙදුම සක්‍රිය කර නොමැත",
-"Authentication error" => "සත්‍යාපනය කිරීමේ දෝශයක්",
+"Authentication error" => "සත්‍යාපන දෝෂයක්",
"Token expired. Please reload page." => "ටෝකනය කල් ඉකුත් වී ඇත. පිටුව නැවුම් කරන්න",
"Files" => "ගොනු",
"Text" => "පෙළ",
@@ -23,8 +23,5 @@
"%d days ago" => "%d දිනකට පෙර",
"last month" => "පෙර මාසයේ",
"last year" => "පෙර අවුරුද්දේ",
-"years ago" => "අවුරුදු කීපයකට පෙර",
-"%s is available. Get <a href=\"%s\">more information</a>" => "%s යොදාගත හැක. <a href=\"%s\">තව විස්තර</a> ලබාගන්න",
-"up to date" => "යාවත්කාලීනයි",
-"updates check is disabled" => "යාවත්කාලීන බව පරීක්ෂණය අක්‍රියයි"
+"years ago" => "අවුරුදු කීපයකට පෙර"
);
diff --git a/lib/l10n/sk_SK.php b/lib/l10n/sk_SK.php
index 8c9ce61622c..e074ed78c3c 100644
--- a/lib/l10n/sk_SK.php
+++ b/lib/l10n/sk_SK.php
@@ -18,7 +18,6 @@
"Images" => "Obrázky",
"Set an admin username." => "Zadajte používateľské meno administrátora.",
"Set an admin password." => "Zadajte heslo administrátora.",
-"Specify a data folder." => "Zadajte priečinok pre dáta.",
"%s enter the database username." => "Zadajte používateľské meno %s databázy..",
"%s enter the database name." => "Zadajte názov databázy pre %s databázy.",
"%s you may not use dots in the database name" => "V názve databázy %s nemôžete používať bodky",
@@ -38,7 +37,7 @@
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Váš webový server nie je správne nastavený na synchronizáciu, pretože rozhranie WebDAV je poškodené.",
"Please double check the <a href='%s'>installation guides</a>." => "Prosím skontrolujte <a href='%s'>inštalačnú príručku</a>.",
"seconds ago" => "pred sekundami",
-"1 minute ago" => "pred 1 minútou",
+"1 minute ago" => "pred minútou",
"%d minutes ago" => "pred %d minútami",
"1 hour ago" => "Pred 1 hodinou",
"%d hours ago" => "Pred %d hodinami.",
@@ -49,8 +48,5 @@
"%d months ago" => "Pred %d mesiacmi.",
"last year" => "minulý rok",
"years ago" => "pred rokmi",
-"%s is available. Get <a href=\"%s\">more information</a>" => "%s je dostupné. Získať <a href=\"%s\">pre viac informácií</a>",
-"up to date" => "aktuálny",
-"updates check is disabled" => "sledovanie aktualizácií je vypnuté",
"Could not find category \"%s\"" => "Nemožno nájsť danú kategóriu \"%s\""
);
diff --git a/lib/l10n/sl.php b/lib/l10n/sl.php
index 391d932c4ee..0c42f44d2aa 100644
--- a/lib/l10n/sl.php
+++ b/lib/l10n/sl.php
@@ -5,16 +5,37 @@
"Users" => "Uporabniki",
"Apps" => "Programi",
"Admin" => "Skrbništvo",
-"ZIP download is turned off." => "Prejem datotek ZIP je onemogočen.",
-"Files need to be downloaded one by one." => "Datoteke je mogoče prejeti le posamič.",
+"ZIP download is turned off." => "Prejemanje datotek v paketu ZIP je onemogočeno.",
+"Files need to be downloaded one by one." => "Datoteke je mogoče prejeti le posamično.",
"Back to Files" => "Nazaj na datoteke",
"Selected files too large to generate zip file." => "Izbrane datoteke so prevelike za ustvarjanje datoteke arhiva zip.",
+"couldn't be determined" => "ni mogoče določiti",
"Application is not enabled" => "Program ni omogočen",
-"Authentication error" => "Napaka overitve",
-"Token expired. Please reload page." => "Žeton je potekel. Spletišče je traba znova naložiti.",
+"Authentication error" => "Napaka pri overjanju",
+"Token expired. Please reload page." => "Žeton je potekel. Stran je treba ponovno naložiti.",
"Files" => "Datoteke",
"Text" => "Besedilo",
"Images" => "Slike",
+"Set an admin username." => "Nastavi uporabniško ime skrbnika.",
+"Set an admin password." => "Nastavi geslo skrbnika.",
+"%s enter the database username." => "%s - vnos uporabniškega imena podatkovne zbirke.",
+"%s enter the database name." => "%s - vnos imena podatkovne zbirke.",
+"%s you may not use dots in the database name" => "%s - v imenu podatkovne zbirke ni dovoljeno uporabljati pik.",
+"%s set the database host." => "%s - vnos gostitelja podatkovne zbirke.",
+"PostgreSQL username and/or password not valid" => "Uporabniško ime ali geslo PostgreSQL ni veljavno",
+"You need to enter either an existing account or the administrator." => "Prijaviti se je treba v obstoječi ali pa skrbniški račun.",
+"Oracle username and/or password not valid" => "Uporabniško ime ali geslo Oracle ni veljavno",
+"MySQL username and/or password not valid" => "Uporabniško ime ali geslo MySQL ni veljavno",
+"DB Error: \"%s\"" => "Napaka podatkovne zbirke: \"%s\"",
+"Offending command was: \"%s\"" => "Napačni ukaz je: \"%s\"",
+"MySQL user '%s'@'localhost' exists already." => "Uporabnik MySQL '%s'@'localhost' že obstaja.",
+"Drop this user from MySQL" => "Odstrani uporabnika s podatkovne zbirke MySQL",
+"MySQL user '%s'@'%%' already exists" => "Uporabnik MySQL '%s'@'%%' že obstaja.",
+"Drop this user from MySQL." => "Odstrani uporabnika s podatkovne zbirke MySQL",
+"Offending command was: \"%s\", name: %s, password: %s" => "Napačni ukaz je: \"%s\", ime: %s, geslo: %s",
+"MS SQL username and/or password not valid: %s" => "Uporabniško ime ali geslo MS SQL ni veljavno: %s",
+"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Spletni stražnik še ni ustrezno nastavljen in ne omogoča usklajevanja, saj je nastavitev WebDAV okvarjena.",
+"Please double check the <a href='%s'>installation guides</a>." => "Preverite <a href='%s'>navodila namestitve</a>.",
"seconds ago" => "pred nekaj sekundami",
"1 minute ago" => "pred minuto",
"%d minutes ago" => "pred %d minutami",
@@ -23,12 +44,9 @@
"today" => "danes",
"yesterday" => "včeraj",
"%d days ago" => "pred %d dnevi",
-"last month" => "prejšnji mesec",
+"last month" => "zadnji mesec",
"%d months ago" => "Pred %d meseci",
-"last year" => "lani",
-"years ago" => "pred nekaj leti",
-"%s is available. Get <a href=\"%s\">more information</a>" => "%s je na voljo. <a href=\"%s\">Več podrobnosti.</a>",
-"up to date" => "posodobljeno",
-"updates check is disabled" => "preverjanje za posodobitve je onemogočeno",
-"Could not find category \"%s\"" => "Kategorije \"%s\" ni bilo mogoče najti."
+"last year" => "lansko leto",
+"years ago" => "let nazaj",
+"Could not find category \"%s\"" => "Kategorije \"%s\" ni mogoče najti."
);
diff --git a/lib/l10n/sq.php b/lib/l10n/sq.php
new file mode 100644
index 00000000000..60d83ca48c3
--- /dev/null
+++ b/lib/l10n/sq.php
@@ -0,0 +1,52 @@
+<?php $TRANSLATIONS = array(
+"Help" => "Ndihmë",
+"Personal" => "Personale",
+"Settings" => "Parametra",
+"Users" => "Përdoruesit",
+"Apps" => "App",
+"Admin" => "Admin",
+"ZIP download is turned off." => "Shkarimi i skedarëve ZIP është i çaktivizuar.",
+"Files need to be downloaded one by one." => "Skedarët duhet të shkarkohen një nga një.",
+"Back to Files" => "Kthehu tek skedarët",
+"Selected files too large to generate zip file." => "Skedarët e selektuar janë shumë të mëdhenj për të krijuar një skedar ZIP.",
+"couldn't be determined" => "nuk u vendos dot",
+"Application is not enabled" => "Programi nuk është i aktivizuar.",
+"Authentication error" => "Veprim i gabuar gjatë vërtetimit të identitetit",
+"Token expired. Please reload page." => "Përmbajtja ka skaduar. Ju lutemi ringarkoni faqen.",
+"Files" => "Skedarët",
+"Text" => "Tekst",
+"Images" => "Foto",
+"Set an admin username." => "Cakto emrin e administratorit.",
+"Set an admin password." => "Cakto kodin e administratorit.",
+"%s enter the database username." => "% shkruani përdoruesin e database-it.",
+"%s enter the database name." => "%s shkruani emrin e database-it.",
+"%s you may not use dots in the database name" => "%s nuk mund të përdorni pikat tek emri i database-it",
+"%s set the database host." => "%s caktoni pozicionin (host) e database-it.",
+"PostgreSQL username and/or password not valid" => "Përdoruesi dhe/apo kodi i PostgreSQL i pavlefshëm",
+"You need to enter either an existing account or the administrator." => "Duhet të përdorni një llogari ekzistuese ose llogarinë e administratorit.",
+"Oracle username and/or password not valid" => "Përdoruesi dhe/apo kodi i Oracle-it i pavlefshëm",
+"MySQL username and/or password not valid" => "Përdoruesi dhe/apo kodi i MySQL-it i pavlefshëm.",
+"DB Error: \"%s\"" => "Veprim i gabuar i DB-it: \"%s\"",
+"Offending command was: \"%s\"" => "Komanda e gabuar ishte: \"%s\"",
+"MySQL user '%s'@'localhost' exists already." => "Përdoruesi MySQL '%s'@'localhost' ekziston.",
+"Drop this user from MySQL" => "Eliminoni këtë përdorues nga MySQL",
+"MySQL user '%s'@'%%' already exists" => "Përdoruesi MySQL '%s'@'%%' ekziston",
+"Drop this user from MySQL." => "Eliminoni këtë përdorues nga MySQL.",
+"Offending command was: \"%s\", name: %s, password: %s" => "Komanda e gabuar ishte: \"%s\", përdoruesi: %s, kodi: %s",
+"MS SQL username and/or password not valid: %s" => "Përdoruesi dhe/apo kodi i MS SQL i pavlefshëm: %s",
+"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Serveri web i juaji nuk është konfiguruar akoma për të lejuar sinkronizimin e skedarëve sepse ndërfaqja WebDAV mund të jetë e dëmtuar.",
+"Please double check the <a href='%s'>installation guides</a>." => "Ju lutemi kontrolloni mirë <a href='%s'>shoqëruesin e instalimit</a>.",
+"seconds ago" => "sekonda më parë",
+"1 minute ago" => "1 minutë më parë",
+"%d minutes ago" => "%d minuta më parë",
+"1 hour ago" => "1 orë më parë",
+"%d hours ago" => "%d orë më parë",
+"today" => "sot",
+"yesterday" => "dje",
+"%d days ago" => "%d ditë më parë",
+"last month" => "muajin e shkuar",
+"%d months ago" => "%d muaj më parë",
+"last year" => "vitin e shkuar",
+"years ago" => "vite më parë",
+"Could not find category \"%s\"" => "Kategoria \"%s\" nuk u gjet"
+);
diff --git a/lib/l10n/sr.php b/lib/l10n/sr.php
index 1161b0a44b7..45b8e06200c 100644
--- a/lib/l10n/sr.php
+++ b/lib/l10n/sr.php
@@ -16,10 +16,12 @@
"Files" => "Датотеке",
"Text" => "Текст",
"Images" => "Слике",
+"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Ваш веб сервер тренутно не подржава синхронизацију датотека јер се чини да је WebDAV сучеље неисправно.",
+"Please double check the <a href='%s'>installation guides</a>." => "Погледајте <a href='%s'>водиче за инсталацију</a>.",
"seconds ago" => "пре неколико секунди",
"1 minute ago" => "пре 1 минут",
"%d minutes ago" => "пре %d минута",
-"1 hour ago" => "пре 1 сат",
+"1 hour ago" => "Пре једног сата",
"%d hours ago" => "пре %d сата/и",
"today" => "данас",
"yesterday" => "јуче",
@@ -28,8 +30,5 @@
"%d months ago" => "пре %d месеца/и",
"last year" => "прошле године",
"years ago" => "година раније",
-"%s is available. Get <a href=\"%s\">more information</a>" => "%s је доступна. Погледајте <a href=\"%s\">више информација</a>.",
-"up to date" => "је ажурна",
-"updates check is disabled" => "провера ажурирања је онемогућена",
"Could not find category \"%s\"" => "Не могу да пронађем категорију „%s“."
);
diff --git a/lib/l10n/sr@latin.php b/lib/l10n/sr@latin.php
index 3fc1f61eafa..13cedc83279 100644
--- a/lib/l10n/sr@latin.php
+++ b/lib/l10n/sr@latin.php
@@ -3,6 +3,8 @@
"Personal" => "Lično",
"Settings" => "Podešavanja",
"Users" => "Korisnici",
+"Apps" => "Programi",
+"Admin" => "Adninistracija",
"Authentication error" => "Greška pri autentifikaciji",
"Files" => "Fajlovi",
"Text" => "Tekst"
diff --git a/lib/l10n/sv.php b/lib/l10n/sv.php
index 63ca60e89cd..3dcb26d5d8d 100644
--- a/lib/l10n/sv.php
+++ b/lib/l10n/sv.php
@@ -23,15 +23,12 @@
"%d minutes ago" => "%d minuter sedan",
"1 hour ago" => "1 timme sedan",
"%d hours ago" => "%d timmar sedan",
-"today" => "idag",
-"yesterday" => "igår",
+"today" => "i dag",
+"yesterday" => "i går",
"%d days ago" => "%d dagar sedan",
"last month" => "förra månaden",
"%d months ago" => "%d månader sedan",
"last year" => "förra året",
"years ago" => "år sedan",
-"%s is available. Get <a href=\"%s\">more information</a>" => "%s finns. Få <a href=\"%s\">mer information</a>",
-"up to date" => "uppdaterad",
-"updates check is disabled" => "uppdateringskontroll är inaktiverad",
"Could not find category \"%s\"" => "Kunde inte hitta kategorin \"%s\""
);
diff --git a/lib/l10n/ta_LK.php b/lib/l10n/ta_LK.php
index c76394bcb4f..c9bb578b40f 100644
--- a/lib/l10n/ta_LK.php
+++ b/lib/l10n/ta_LK.php
@@ -2,7 +2,7 @@
"Help" => "உதவி",
"Personal" => "தனிப்பட்ட",
"Settings" => "அமைப்புகள்",
-"Users" => "பயனாளர்கள்",
+"Users" => "பயனாளர்",
"Apps" => "செயலிகள்",
"Admin" => "நிர்வாகம்",
"ZIP download is turned off." => "வீசொலிப் பூட்டு பதிவிறக்கம் நிறுத்தப்பட்டுள்ளது.",
@@ -27,8 +27,5 @@
"%d months ago" => "%d மாதத்திற்கு முன்",
"last year" => "கடந்த வருடம்",
"years ago" => "வருடங்களுக்கு முன்",
-"%s is available. Get <a href=\"%s\">more information</a>" => "%s இன்னும் இருக்கின்றன. <a href=\"%s\">மேலதிக தகவல்களுக்கு</a> எடுக்க",
-"up to date" => "நவீன",
-"updates check is disabled" => "இற்றைப்படுத்தலை சரிபார்ப்பதை செயலற்றதாக்குக",
"Could not find category \"%s\"" => "பிரிவு \"%s\" ஐ கண்டுப்பிடிக்க முடியவில்லை"
);
diff --git a/lib/l10n/te.php b/lib/l10n/te.php
new file mode 100644
index 00000000000..87c73d790e2
--- /dev/null
+++ b/lib/l10n/te.php
@@ -0,0 +1,13 @@
+<?php $TRANSLATIONS = array(
+"Help" => "సహాయం",
+"Settings" => "అమరికలు",
+"Users" => "వాడుకరులు",
+"seconds ago" => "క్షణాల క్రితం",
+"1 minute ago" => "1 నిమిషం క్రితం",
+"1 hour ago" => "1 గంట క్రితం",
+"today" => "ఈరోజు",
+"yesterday" => "నిన్న",
+"last month" => "పోయిన నెల",
+"last year" => "పోయిన సంవత్సరం",
+"years ago" => "సంవత్సరాల క్రితం"
+);
diff --git a/lib/l10n/th_TH.php b/lib/l10n/th_TH.php
index 0da607a0589..7cda4ab6ae6 100644
--- a/lib/l10n/th_TH.php
+++ b/lib/l10n/th_TH.php
@@ -16,8 +16,8 @@
"Files" => "ไฟล์",
"Text" => "ข้อความ",
"Images" => "รูปภาพ",
-"seconds ago" => "วินาทีที่ผ่านมา",
-"1 minute ago" => "1 นาทีมาแล้ว",
+"seconds ago" => "วินาที ก่อนหน้านี้",
+"1 minute ago" => "1 นาทีก่อนหน้านี้",
"%d minutes ago" => "%d นาทีที่ผ่านมา",
"1 hour ago" => "1 ชั่วโมงก่อนหน้านี้",
"%d hours ago" => "%d ชั่วโมงก่อนหน้านี้",
@@ -27,9 +27,6 @@
"last month" => "เดือนที่แล้ว",
"%d months ago" => "%d เดือนมาแล้ว",
"last year" => "ปีที่แล้ว",
-"years ago" => "ปีที่ผ่านมา",
-"%s is available. Get <a href=\"%s\">more information</a>" => "%s พร้อมให้ใช้งานได้แล้ว. <a href=\"%s\">ดูรายละเอียดเพิ่มเติม</a>",
-"up to date" => "ทันสมัย",
-"updates check is disabled" => "การตรวจสอบชุดอัพเดทถูกปิดใช้งานไว้",
+"years ago" => "ปี ที่ผ่านมา",
"Could not find category \"%s\"" => "ไม่พบหมวดหมู่ \"%s\""
);
diff --git a/lib/l10n/tr.php b/lib/l10n/tr.php
index e55caa15972..641da2447ee 100644
--- a/lib/l10n/tr.php
+++ b/lib/l10n/tr.php
@@ -1,5 +1,5 @@
<?php $TRANSLATIONS = array(
-"Help" => "Yardı",
+"Help" => "Yardım",
"Personal" => "Kişisel",
"Settings" => "Ayarlar",
"Users" => "Kullanıcılar",
@@ -16,6 +16,26 @@
"Files" => "Dosyalar",
"Text" => "Metin",
"Images" => "Resimler",
+"Set an admin username." => "Bir adi kullanici vermek. ",
+"Set an admin password." => "Parola yonetici birlemek. ",
+"%s enter the database username." => "%s veritabanı kullanıcı adını gir.",
+"%s enter the database name." => "%s veritabanı adını gir.",
+"%s you may not use dots in the database name" => "%s veritabanı adında nokta kullanamayabilirsiniz",
+"%s set the database host." => "%s veritabanı sunucu adını tanımla",
+"PostgreSQL username and/or password not valid" => "PostgreSQL adi kullanici ve/veya parola yasal degildir. ",
+"You need to enter either an existing account or the administrator." => "Bir konto veya kullanici birlemek ihtiyacin. ",
+"Oracle username and/or password not valid" => "Adi klullanici ve/veya parola Oracle mantikli değildir. ",
+"MySQL username and/or password not valid" => "MySQL kullanıcı adı ve/veya parolası geçerli değil",
+"DB Error: \"%s\"" => "DB Hata: ''%s''",
+"Offending command was: \"%s\"" => "Komut rahasiz ''%s''. ",
+"MySQL user '%s'@'localhost' exists already." => "MySQL kullanici '%s @local host zatan var. ",
+"Drop this user from MySQL" => "Bu kullanici MySQLden list disari koymak. ",
+"MySQL user '%s'@'%%' already exists" => "MySQL kullanici '%s @ % % zaten var (zaten yazili)",
+"Drop this user from MySQL." => "Bu kulanıcıyı MySQL veritabanından kaldır",
+"Offending command was: \"%s\", name: %s, password: %s" => "Hatalı komut: \"%s\", ad: %s, parola: %s",
+"MS SQL username and/or password not valid: %s" => "MS SQL kullanıcı adı ve/veya parolası geçersiz: %s",
+"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Web sunucunuz dosya transferi için düzgün bir şekilde yapılandırılmamış. WevDAV arabirimini sorunlu gözüküyor.",
+"Please double check the <a href='%s'>installation guides</a>." => "Lütfen <a href='%s'>kurulum kılavuzlarını</a> iki kez kontrol edin.",
"seconds ago" => "saniye önce",
"1 minute ago" => "1 dakika önce",
"%d minutes ago" => "%d dakika önce",
@@ -28,8 +48,5 @@
"%d months ago" => "%d ay önce",
"last year" => "geçen yıl",
"years ago" => "yıl önce",
-"%s is available. Get <a href=\"%s\">more information</a>" => "%s kullanılabilir durumda. <a href=\"%s\">Daha fazla bilgi</a> alın",
-"up to date" => "güncel",
-"updates check is disabled" => "güncelleme kontrolü kapalı",
"Could not find category \"%s\"" => "\"%s\" kategorisi bulunamadı"
);
diff --git a/lib/l10n/ug.php b/lib/l10n/ug.php
new file mode 100644
index 00000000000..62d91616c1d
--- /dev/null
+++ b/lib/l10n/ug.php
@@ -0,0 +1,19 @@
+<?php $TRANSLATIONS = array(
+"Help" => "ياردەم",
+"Personal" => "شەخسىي",
+"Settings" => "تەڭشەكلەر",
+"Users" => "ئىشلەتكۈچىلەر",
+"Apps" => "ئەپلەر",
+"Authentication error" => "سالاھىيەت دەلىللەش خاتالىقى",
+"Files" => "ھۆججەتلەر",
+"Text" => "قىسقا ئۇچۇر",
+"Images" => "سۈرەتلەر",
+"1 minute ago" => "1 مىنۇت ئىلگىرى",
+"%d minutes ago" => "%d مىنۇت ئىلگىرى",
+"1 hour ago" => "1 سائەت ئىلگىرى",
+"%d hours ago" => "%d سائەت ئىلگىرى",
+"today" => "بۈگۈن",
+"yesterday" => "تۈنۈگۈن",
+"%d days ago" => "%d كۈن ئىلگىرى",
+"%d months ago" => "%d ئاي ئىلگىرى"
+);
diff --git a/lib/l10n/uk.php b/lib/l10n/uk.php
index 68f7151d15e..a5448901247 100644
--- a/lib/l10n/uk.php
+++ b/lib/l10n/uk.php
@@ -18,7 +18,6 @@
"Images" => "Зображення",
"Set an admin username." => "Встановіть ім'я адміністратора.",
"Set an admin password." => "Встановіть пароль адміністратора.",
-"Specify a data folder." => "Вкажіть теку для даних.",
"%s enter the database username." => "%s введіть ім'я користувача бази даних.",
"%s enter the database name." => "%s введіть назву бази даних.",
"%s you may not use dots in the database name" => "%s не можна використовувати крапки в назві бази даних",
@@ -49,8 +48,5 @@
"%d months ago" => "%d місяців тому",
"last year" => "минулого року",
"years ago" => "роки тому",
-"%s is available. Get <a href=\"%s\">more information</a>" => "%s доступно. Отримати <a href=\"%s\">детальну інформацію</a>",
-"up to date" => "оновлено",
-"updates check is disabled" => "перевірка оновлень відключена",
"Could not find category \"%s\"" => "Не вдалося знайти категорію \"%s\""
);
diff --git a/lib/l10n/vi.php b/lib/l10n/vi.php
index ea9660093ae..6a4b8ebac93 100644
--- a/lib/l10n/vi.php
+++ b/lib/l10n/vi.php
@@ -13,10 +13,10 @@
"Application is not enabled" => "Ứng dụng không được BẬT",
"Authentication error" => "Lỗi xác thực",
"Token expired. Please reload page." => "Mã Token đã hết hạn. Hãy tải lại trang.",
-"Files" => "Các tập tin",
+"Files" => "Tập tin",
"Text" => "Văn bản",
"Images" => "Hình ảnh",
-"seconds ago" => "1 giây trước",
+"seconds ago" => "vài giây trước",
"1 minute ago" => "1 phút trước",
"%d minutes ago" => "%d phút trước",
"1 hour ago" => "1 giờ trước",
@@ -28,8 +28,5 @@
"%d months ago" => "%d tháng trước",
"last year" => "năm trước",
"years ago" => "năm trước",
-"%s is available. Get <a href=\"%s\">more information</a>" => "%s có sẵn. <a href=\"%s\">xem thêm ở đây</a>",
-"up to date" => "đến ngày",
-"updates check is disabled" => "đã TĂT chức năng cập nhật ",
"Could not find category \"%s\"" => "không thể tìm thấy mục \"%s\""
);
diff --git a/lib/l10n/zh_CN.GB2312.php b/lib/l10n/zh_CN.GB2312.php
index 08975e44598..3ab35f2bafa 100644
--- a/lib/l10n/zh_CN.GB2312.php
+++ b/lib/l10n/zh_CN.GB2312.php
@@ -15,16 +15,16 @@
"Files" => "文件",
"Text" => "文本",
"Images" => "图片",
+"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "因WebDAV接口故障,您的网络服务器好像并未允许文件同步。",
+"Please double check the <a href='%s'>installation guides</a>." => "请双击<a href='%s'>安装向导</a>。",
"seconds ago" => "秒前",
"1 minute ago" => "1 分钟前",
"%d minutes ago" => "%d 分钟前",
+"1 hour ago" => "1小时前",
"today" => "今天",
"yesterday" => "昨天",
"%d days ago" => "%d 天前",
"last month" => "上个月",
"last year" => "去年",
-"years ago" => "年前",
-"%s is available. Get <a href=\"%s\">more information</a>" => "%s 不可用。获知 <a href=\"%s\">详情</a>",
-"up to date" => "最新",
-"updates check is disabled" => "更新检测已禁用"
+"years ago" => "年前"
);
diff --git a/lib/l10n/zh_CN.php b/lib/l10n/zh_CN.php
index c3af288b727..cab5142e5d5 100644
--- a/lib/l10n/zh_CN.php
+++ b/lib/l10n/zh_CN.php
@@ -9,14 +9,35 @@
"Files need to be downloaded one by one." => "需要逐一下载文件",
"Back to Files" => "回到文件",
"Selected files too large to generate zip file." => "选择的文件太大,无法生成 zip 文件。",
-"Application is not enabled" => "不需要程序",
-"Authentication error" => "认证错误",
+"couldn't be determined" => "无法确定",
+"Application is not enabled" => "应用程序未启用",
+"Authentication error" => "认证出错",
"Token expired. Please reload page." => "Token 过期,请刷新页面。",
"Files" => "文件",
"Text" => "文本",
-"Images" => "图像",
-"seconds ago" => "几秒前",
-"1 minute ago" => "1分钟前",
+"Images" => "图片",
+"Set an admin username." => "请设置一个管理员用户名。",
+"Set an admin password." => "请设置一个管理员密码。",
+"%s enter the database username." => "%s 输入数据库用户名。",
+"%s enter the database name." => "%s 输入数据库名称。",
+"%s you may not use dots in the database name" => "%s 您不能在数据库名称中使用英文句号。",
+"%s set the database host." => "%s 设置数据库所在主机。",
+"PostgreSQL username and/or password not valid" => "PostgreSQL 数据库用户名和/或密码无效",
+"You need to enter either an existing account or the administrator." => "你需要输入一个数据库中已有的账户或管理员账户。",
+"Oracle username and/or password not valid" => "Oracle 数据库用户名和/或密码无效",
+"MySQL username and/or password not valid" => "MySQL 数据库用户名和/或密码无效",
+"DB Error: \"%s\"" => "数据库错误:\"%s\"",
+"Offending command was: \"%s\"" => "冲突命令为:\"%s\"",
+"MySQL user '%s'@'localhost' exists already." => "MySQL 用户 '%s'@'localhost' 已存在。",
+"Drop this user from MySQL" => "建议从 MySQL 数据库中丢弃 Drop 此用户",
+"MySQL user '%s'@'%%' already exists" => "MySQL 用户 '%s'@'%%' 已存在",
+"Drop this user from MySQL." => "建议从 MySQL 数据库中丢弃 Drop 此用户。",
+"Offending command was: \"%s\", name: %s, password: %s" => "冲突命令为:\"%s\",名称:%s,密码:%s",
+"MS SQL username and/or password not valid: %s" => "MS SQL 用户名和/或密码无效:%s",
+"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "您的Web服务器尚未正确设置以允许文件同步, 因为WebDAV的接口似乎已损坏.",
+"Please double check the <a href='%s'>installation guides</a>." => "请认真检查<a href='%s'>安装指南</a>.",
+"seconds ago" => "秒前",
+"1 minute ago" => "一分钟前",
"%d minutes ago" => "%d 分钟前",
"1 hour ago" => "1小时前",
"%d hours ago" => "%d小时前",
@@ -25,10 +46,7 @@
"%d days ago" => "%d 天前",
"last month" => "上月",
"%d months ago" => "%d 月前",
-"last year" => "上年",
-"years ago" => "几年前",
-"%s is available. Get <a href=\"%s\">more information</a>" => "%s 已存在. 点此 <a href=\"%s\">获取更多信息</a>",
-"up to date" => "已更新。",
-"updates check is disabled" => "检查更新功能被关闭。",
+"last year" => "去年",
+"years ago" => "年前",
"Could not find category \"%s\"" => "无法找到分类 \"%s\""
);
diff --git a/lib/l10n/zh_HK.php b/lib/l10n/zh_HK.php
new file mode 100644
index 00000000000..cfa33ec36f5
--- /dev/null
+++ b/lib/l10n/zh_HK.php
@@ -0,0 +1,13 @@
+<?php $TRANSLATIONS = array(
+"Help" => "幫助",
+"Personal" => "個人",
+"Settings" => "設定",
+"Users" => "用戶",
+"Apps" => "軟件",
+"Admin" => "管理",
+"Files" => "文件",
+"Text" => "文字",
+"today" => "今日",
+"yesterday" => "昨日",
+"last month" => "前一月"
+);
diff --git a/lib/l10n/zh_TW.php b/lib/l10n/zh_TW.php
index 91b0329e246..5affb1ccf35 100644
--- a/lib/l10n/zh_TW.php
+++ b/lib/l10n/zh_TW.php
@@ -5,10 +5,10 @@
"Users" => "使用者",
"Apps" => "應用程式",
"Admin" => "管理",
-"ZIP download is turned off." => "ZIP 下載已關閉",
-"Files need to be downloaded one by one." => "檔案需要逐一下載",
+"ZIP download is turned off." => "ZIP 下載已關閉。",
+"Files need to be downloaded one by one." => "檔案需要逐一下載。",
"Back to Files" => "回到檔案列表",
-"Selected files too large to generate zip file." => "選擇的檔案太大以致於無法產生壓縮檔",
+"Selected files too large to generate zip file." => "選擇的檔案太大以致於無法產生壓縮檔。",
"couldn't be determined" => "無法判斷",
"Application is not enabled" => "應用程式未啟用",
"Authentication error" => "認證錯誤",
@@ -16,6 +16,24 @@
"Files" => "檔案",
"Text" => "文字",
"Images" => "圖片",
+"Set an admin username." => "設定管理員帳號。",
+"Set an admin password." => "設定管理員密碼。",
+"%s enter the database username." => "%s 輸入資料庫使用者名稱。",
+"%s enter the database name." => "%s 輸入資料庫名稱。",
+"%s you may not use dots in the database name" => "%s 資料庫名稱不能包含小數點",
+"%s set the database host." => "%s 設定資料庫主機。",
+"PostgreSQL username and/or password not valid" => "PostgreSQL 用戶名和/或密碼無效",
+"You need to enter either an existing account or the administrator." => "您必須輸入一個現有的帳號或管理員帳號。",
+"Oracle username and/or password not valid" => "Oracle 用戶名和/或密碼無效",
+"MySQL username and/or password not valid" => "MySQL 用戶名和/或密碼無效",
+"DB Error: \"%s\"" => "資料庫錯誤:\"%s\"",
+"Offending command was: \"%s\"" => "有問題的指令是:\"%s\"",
+"MySQL user '%s'@'localhost' exists already." => "MySQL 使用者 '%s'@'localhost' 已經存在。",
+"Drop this user from MySQL" => "在 MySQL 移除這個使用者",
+"MySQL user '%s'@'%%' already exists" => "MySQL 使用者 '%s'@'%%' 已經存在",
+"Drop this user from MySQL." => "在 MySQL 移除這個使用者。",
+"Offending command was: \"%s\", name: %s, password: %s" => "有問題的指令是:\"%s\" ,使用者:\"%s\",密碼:\"%s\"",
+"MS SQL username and/or password not valid: %s" => "MS SQL 使用者和/或密碼無效:%s",
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "您的網頁伺服器尚未被正確設定來進行檔案同步,因為您的 WebDAV 界面似乎無法使用。",
"Please double check the <a href='%s'>installation guides</a>." => "請參考<a href='%s'>安裝指南</a>。",
"seconds ago" => "幾秒前",
@@ -30,8 +48,5 @@
"%d months ago" => "%d 個月之前",
"last year" => "去年",
"years ago" => "幾年前",
-"%s is available. Get <a href=\"%s\">more information</a>" => "%s 已經可用。取得 <a href=\"%s\">更多資訊</a>",
-"up to date" => "最新的",
-"updates check is disabled" => "檢查更新已停用",
"Could not find category \"%s\"" => "找不到分類:\"%s\""
);
diff --git a/lib/filesystem.php b/lib/legacy/filesystem.php
index 34f92b357ca..34f92b357ca 100644
--- a/lib/filesystem.php
+++ b/lib/legacy/filesystem.php
diff --git a/lib/filesystemview.php b/lib/legacy/filesystemview.php
index d6bca62e06a..d6bca62e06a 100644
--- a/lib/filesystemview.php
+++ b/lib/legacy/filesystemview.php
diff --git a/lib/log/owncloud.php b/lib/log/owncloud.php
index 20df52c27bb..7a11a588330 100644
--- a/lib/log/owncloud.php
+++ b/lib/log/owncloud.php
@@ -49,7 +49,8 @@ class OC_Log_Owncloud {
public static function write($app, $message, $level) {
$minLevel=min(OC_Config::getValue( "loglevel", OC_Log::WARN ), OC_Log::ERROR);
if($level>=$minLevel) {
- $entry=array('app'=>$app, 'message'=>$message, 'level'=>$level, 'time'=>time());
+ $time = date("F d, Y H:i:s", time());
+ $entry=array('app'=>$app, 'message'=>$message, 'level'=>$level, 'time'=> $time);
$handle = @fopen(self::$logFile, 'a');
if ($handle) {
fwrite($handle, json_encode($entry)."\n");
diff --git a/lib/migrate.php b/lib/migrate.php
index a0a329705a3..0b319177400 100644
--- a/lib/migrate.php
+++ b/lib/migrate.php
@@ -246,11 +246,20 @@ class OC_Migrate{
OC_Log::write( 'migration', 'User doesn\'t exist', OC_Log::ERROR );
return json_encode( array( 'success' => false ) );
}
+
+ // Check if the username is valid
+ if( preg_match( '/[^a-zA-Z0-9 _\.@\-]/', $json->exporteduser )) {
+ OC_Log::write( 'migration', 'Username is not valid', OC_Log::ERROR );
+ return json_encode( array( 'success' => false ) );
+ }
+
// Copy data
$userfolder = $extractpath . $json->exporteduser;
$newuserfolder = $datadir . '/' . self::$uid;
foreach(scandir($userfolder) as $file){
if($file !== '.' && $file !== '..' && is_dir($file)) {
+ $file = str_replace(array('/', '\\'), '', $file);
+
// Then copy the folder over
OC_Helper::copyr($userfolder.'/'.$file, $newuserfolder.'/'.$file);
}
diff --git a/lib/mimetypes.list.php b/lib/mimetypes.list.php
index 86ce9c6c237..2aac3bbfd27 100644
--- a/lib/mimetypes.list.php
+++ b/lib/mimetypes.list.php
@@ -86,11 +86,11 @@ return array(
'vcf' => 'text/vcard',
'vcard' => 'text/vcard',
'doc'=>'application/msword',
- 'docx'=>'application/msword',
+ 'docx'=>'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'xls'=>'application/msexcel',
- 'xlsx'=>'application/msexcel',
+ 'xlsx'=>'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'ppt'=>'application/mspowerpoint',
- 'pptx'=>'application/mspowerpoint',
+ 'pptx'=>'application/vnd.openxmlformats-officedocument.presentationml.presentation',
'sgf' => 'application/sgf',
'cdr' => 'application/coreldraw',
'impress' => 'text/impress',
@@ -98,5 +98,9 @@ return array(
'epub' => 'application/epub+zip',
'mobi' => 'application/x-mobipocket-ebook',
'exe' => 'application',
- 'msi' => 'application'
+ 'msi' => 'application',
+ 'md' => 'text/markdown',
+ 'markdown' => 'text/markdown',
+ 'mdown' => 'text/markdown',
+ 'mdwn' => 'text/markdown'
);
diff --git a/lib/ocs/cloud.php b/lib/ocs/cloud.php
index 5553ae38215..132d923d960 100644
--- a/lib/ocs/cloud.php
+++ b/lib/ocs/cloud.php
@@ -24,49 +24,23 @@
class OC_OCS_Cloud {
- public static function getSystemWebApps() {
- OC_Util::checkLoggedIn();
- $apps = OC_App::getEnabledApps();
- $values = array();
- foreach($apps as $app) {
- $info = OC_App::getAppInfo($app);
- if(isset($info['standalone'])) {
- $newValue = array('name'=>$info['name'], 'url'=>OC_Helper::linkToAbsolute($app, ''), 'icon'=>'');
- $values[] = $newValue;
- }
- }
- return new OC_OCS_Result($values);
- }
-
- public static function getUserQuota($parameters) {
- $user = OC_User::getUser();
- if(OC_User::isAdminUser($user) or ($user==$parameters['user'])) {
-
- if(OC_User::userExists($parameters['user'])) {
- // calculate the disc space
- $userDir = '/'.$parameters['user'].'/files';
- \OC\Files\Filesystem::init($parameters['user'], $userDir);
- $rootInfo = \OC\Files\Filesystem::getFileInfo('');
- $sharedInfo = \OC\Files\Filesystem::getFileInfo('/Shared');
- $used = $rootInfo['size'] - $sharedInfo['size'];
- $free = \OC\Files\Filesystem::free_space();
- $total = $free + $used;
- if($total===0) $total = 1; // prevent division by zero
- $relative = round(($used/$total)*10000)/100;
-
- $xml = array();
- $xml['quota'] = $total;
- $xml['free'] = $free;
- $xml['used'] = $used;
- $xml['relative'] = $relative;
-
- return new OC_OCS_Result($xml);
- } else {
- return new OC_OCS_Result(null, 300);
- }
- } else {
- return new OC_OCS_Result(null, 300);
- }
+ public static function getCapabilities($parameters) {
+ $result = array();
+ list($major, $minor, $micro) = OC_Util::getVersion();
+ $result['version'] = array(
+ 'major' => $major,
+ 'minor' => $minor,
+ 'micro' => $micro,
+ 'string' => OC_Util::getVersionString(),
+ 'edition' => OC_Util::getEditionString(),
+ );
+
+ $result['capabilities'] = array(
+ 'core' => array(
+ 'pollinterval' => OC_Config::getValue('pollinterval', 60),
+ ),
+ );
+ return new OC_OCS_Result($result);
}
public static function getUserPublickey($parameters) {
diff --git a/lib/ocs/result.php b/lib/ocs/result.php
index 65b2067fc3f..729c39056d9 100644
--- a/lib/ocs/result.php
+++ b/lib/ocs/result.php
@@ -22,7 +22,7 @@
class OC_OCS_Result{
- private $data, $message, $statusCode, $items, $perPage;
+ protected $data, $message, $statusCode, $items, $perPage;
/**
* create the OCS_Result object
@@ -49,26 +49,48 @@ class OC_OCS_Result{
public function setItemsPerPage(int $items) {
$this->perPage = $items;
}
-
+
+ /**
+ * get the status code
+ * @return int
+ */
+ public function getStatusCode() {
+ return $this->statusCode;
+ }
+
/**
- * returns the data associated with the api result
+ * get the meta data for the result
* @return array
*/
- public function getResult() {
- $return = array();
- $return['meta'] = array();
- $return['meta']['status'] = ($this->statusCode === 100) ? 'ok' : 'failure';
- $return['meta']['statuscode'] = $this->statusCode;
- $return['meta']['message'] = $this->message;
+ public function getMeta() {
+ $meta = array();
+ $meta['status'] = ($this->statusCode === 100) ? 'ok' : 'failure';
+ $meta['statuscode'] = $this->statusCode;
+ $meta['message'] = $this->message;
if(isset($this->items)) {
- $return['meta']['totalitems'] = $this->items;
+ $meta['totalitems'] = $this->items;
}
if(isset($this->perPage)) {
- $return['meta']['itemsperpage'] = $this->perPage;
+ $meta['itemsperpage'] = $this->perPage;
}
- $return['data'] = $this->data;
- // Return the result data.
- return $return;
+ return $meta;
+
+ }
+
+ /**
+ * get the result data
+ * @return array|string|int
+ */
+ public function getData() {
+ return $this->data;
+ }
+
+ /**
+ * return bool if the method succedded
+ * @return bool
+ */
+ public function succeeded() {
+ return (substr($this->statusCode, 0, 1) === '1');
}
diff --git a/lib/public/files.php b/lib/public/files.php
index 700bf574537..4975bbb7dfa 100644
--- a/lib/public/files.php
+++ b/lib/public/files.php
@@ -56,6 +56,16 @@ class Files {
}
/**
+ * search for files by mimetype
+ *
+ * @param string $query
+ * @return array
+ */
+ public function searchByMime($mimetype) {
+ return(\OC\Files\Filesystem::searchByMime( $mimetype ));
+ }
+
+ /**
* copy the contents of one stream to another
* @param resource source
* @param resource target
diff --git a/lib/public/share.php b/lib/public/share.php
index 59f41a9bfd6..a561319e9bd 100644
--- a/lib/public/share.php
+++ b/lib/public/share.php
@@ -199,6 +199,29 @@ class Share {
}
/**
+ * Get all users an item is shared with
+ * @param string Item type
+ * @param string Item source
+ * @param string Owner
+ * @param bool Include collections
+ * @return Return array of users
+ */
+ public static function getUsersItemShared($itemType, $itemSource, $uidOwner, $includeCollections = false) {
+ $users = array();
+ $items = self::getItems($itemType, $itemSource, null, null, $uidOwner, self::FORMAT_NONE, null, -1, $includeCollections);
+ if ($items) {
+ foreach ($items as $item) {
+ if ((int)$item['share_type'] === self::SHARE_TYPE_USER) {
+ $users[] = $item['share_with'];
+ } else if ((int)$item['share_type'] === self::SHARE_TYPE_GROUP) {
+ $users = array_merge($users, \OC_Group::usersInGroup($item['share_with']));
+ }
+ }
+ }
+ return $users;
+ }
+
+ /**
* @brief Share an item with a user, group, or via private link
* @param string Item type
* @param string Item source
@@ -383,6 +406,7 @@ class Share {
\OC_Hook::emit('OCP\Share', 'pre_unshare', array(
'itemType' => $itemType,
'itemSource' => $itemSource,
+ 'fileSource' => $item['file_source'],
'shareType' => $shareType,
'shareWith' => $shareWith,
));
@@ -637,6 +661,7 @@ class Share {
}
}
$backend = self::getBackend($itemType);
+ $collectionTypes = false;
// Get filesystem root to add it to the file target and remove from the
// file source, match file_source with the file cache
if ($itemType == 'file' || $itemType == 'folder') {
@@ -759,7 +784,7 @@ class Share {
if ($format == self::FORMAT_STATUSES) {
if ($itemType == 'file' || $itemType == 'folder') {
$select = '`*PREFIX*share`.`id`, `item_type`, `*PREFIX*share`.`parent`,'
- .' `share_type`, `file_source`, `path`, `expiration`';
+ .' `share_type`, `file_source`, `path`, `expiration`, `storage`';
} else {
$select = '`id`, `item_type`, `item_source`, `parent`, `share_type`, `expiration`';
}
@@ -768,7 +793,7 @@ class Share {
if ($itemType == 'file' || $itemType == 'folder') {
$select = '`*PREFIX*share`.`id`, `item_type`, `*PREFIX*share`.`parent`,'
.' `share_type`, `share_with`, `file_source`, `path`, `permissions`, `stime`,'
- .' `expiration`, `token`';
+ .' `expiration`, `token`, `storage`';
} else {
$select = '`id`, `item_type`, `item_source`, `parent`, `share_type`, `share_with`, `permissions`,'
.' `stime`, `file_source`, `expiration`, `token`';
@@ -804,6 +829,7 @@ class Share {
$items = array();
$targets = array();
$switchedItems = array();
+ $mounts = array();
while ($row = $result->fetchRow()) {
// Filter out duplicate group shares for users with unique targets
if ($row['share_type'] == self::$shareTypeGroupUserUnique && isset($items[$row['parent']])) {
@@ -848,8 +874,16 @@ class Share {
if (isset($row['parent'])) {
$row['path'] = '/Shared/'.basename($row['path']);
} else {
- // Strip 'files' from path
- $row['path'] = substr($row['path'], 5);
+ if (!isset($mounts[$row['storage']])) {
+ $mountPoints = \OC\Files\Filesystem::getMountByNumericId($row['storage']);
+ if (is_array($mountPoints)) {
+ $mounts[$row['storage']] = $mountPoints[key($mountPoints)];
+ }
+ }
+ if ($mounts[$row['storage']]) {
+ $path = $mounts[$row['storage']]->getMountPoint().$row['path'];
+ $row['path'] = substr($path, $root);
+ }
}
}
if (isset($row['expiration'])) {
@@ -957,15 +991,14 @@ class Share {
return $items;
} else if ($format == self::FORMAT_STATUSES) {
$statuses = array();
- // Switch column to path for files and folders, used for determining statuses inside of folders
- if ($itemType == 'file' || $itemType == 'folder') {
- $column = 'path';
- }
foreach ($items as $item) {
if ($item['share_type'] == self::SHARE_TYPE_LINK) {
- $statuses[$item[$column]] = true;
+ $statuses[$item[$column]]['link'] = true;
} else if (!isset($statuses[$item[$column]])) {
- $statuses[$item[$column]] = false;
+ $statuses[$item[$column]]['link'] = false;
+ }
+ if ($itemType == 'file' || $itemType == 'folder') {
+ $statuses[$item[$column]]['path'] = $item['path'];
}
}
return $statuses;
@@ -1102,20 +1135,6 @@ class Share {
} else {
$fileTarget = null;
}
- \OC_Hook::emit('OCP\Share', 'post_shared', array(
- 'itemType' => $itemType,
- 'itemSource' => $itemSource,
- 'itemTarget' => $itemTarget,
- 'parent' => $parent,
- 'shareType' => self::$shareTypeGroupUserUnique,
- 'shareWith' => $uid,
- 'uidOwner' => $uidOwner,
- 'permissions' => $permissions,
- 'fileSource' => $fileSource,
- 'fileTarget' => $fileTarget,
- 'id' => $parent,
- 'token' => $token
- ));
// Insert an extra row for the group share if the item or file target is unique for this user
if ($itemTarget != $groupItemTarget || (isset($fileSource) && $fileTarget != $groupFileTarget)) {
$query->execute(array($itemType, $itemSource, $itemTarget, $parent,
@@ -1124,6 +1143,20 @@ class Share {
$id = \OC_DB::insertid('*PREFIX*share');
}
}
+ \OC_Hook::emit('OCP\Share', 'post_shared', array(
+ 'itemType' => $itemType,
+ 'itemSource' => $itemSource,
+ 'itemTarget' => $groupItemTarget,
+ 'parent' => $parent,
+ 'shareType' => $shareType,
+ 'shareWith' => $shareWith['group'],
+ 'uidOwner' => $uidOwner,
+ 'permissions' => $permissions,
+ 'fileSource' => $fileSource,
+ 'fileTarget' => $groupFileTarget,
+ 'id' => $parent,
+ 'token' => $token
+ ));
if ($parentFolder === true) {
// Return parent folders to preserve file target paths for potential children
return $parentFolders;
diff --git a/lib/public/util.php b/lib/public/util.php
index db07cbcfff3..6744c2d37bd 100644
--- a/lib/public/util.php
+++ b/lib/public/util.php
@@ -217,6 +217,7 @@ class Util {
*/
public static function getDefaultEmailAddress($user_part) {
$host_name = self::getServerHostName();
+ $host_name = \OC_Config::getValue('mail_domain', $host_name);
$defaultEmailAddress = $user_part.'@'.$host_name;
if (\OC_Mail::ValidateAddress($defaultEmailAddress)) {
diff --git a/lib/request.php b/lib/request.php
index 9f74cf9beb5..4d8380eb9ac 100755
--- a/lib/request.php
+++ b/lib/request.php
@@ -11,9 +11,10 @@ class OC_Request {
* @brief Check overwrite condition
* @returns true/false
*/
- private static function isOverwriteCondition() {
+ private static function isOverwriteCondition($type = '') {
$regex = '/' . OC_Config::getValue('overwritecondaddr', '') . '/';
- return $regex === '//' or preg_match($regex, $_SERVER['REMOTE_ADDR']) === 1;
+ return $regex === '//' or preg_match($regex, $_SERVER['REMOTE_ADDR']) === 1
+ or ($type !== 'protocol' and OC_Config::getValue('forcessl', false));
}
/**
@@ -27,7 +28,7 @@ class OC_Request {
if(OC::$CLI) {
return 'localhost';
}
- if(OC_Config::getValue('overwritehost', '')<>'' and self::isOverwriteCondition()) {
+ if(OC_Config::getValue('overwritehost', '') !== '' and self::isOverwriteCondition()) {
return OC_Config::getValue('overwritehost');
}
if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) {
@@ -52,7 +53,7 @@ class OC_Request {
* Returns the server protocol. It respects reverse proxy servers and load balancers
*/
public static function serverProtocol() {
- if(OC_Config::getValue('overwriteprotocol', '')<>'' and self::isOverwriteCondition()) {
+ if(OC_Config::getValue('overwriteprotocol', '') !== '' and self::isOverwriteCondition('protocol')) {
return OC_Config::getValue('overwriteprotocol');
}
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO'])) {
@@ -76,7 +77,7 @@ class OC_Request {
*/
public static function requestUri() {
$uri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';
- if (OC_Config::getValue('overwritewebroot', '') <> '' and self::isOverwriteCondition()) {
+ if (OC_Config::getValue('overwritewebroot', '') !== '' and self::isOverwriteCondition()) {
$uri = self::scriptName() . substr($uri, strlen($_SERVER['SCRIPT_NAME']));
}
return $uri;
@@ -91,7 +92,7 @@ class OC_Request {
*/
public static function scriptName() {
$name = $_SERVER['SCRIPT_NAME'];
- if (OC_Config::getValue('overwritewebroot', '') <> '' and self::isOverwriteCondition()) {
+ if (OC_Config::getValue('overwritewebroot', '') !== '' and self::isOverwriteCondition()) {
$serverroot = str_replace("\\", '/', substr(__DIR__, 0, -4));
$suburi = str_replace("\\", "/", substr(realpath($_SERVER["SCRIPT_FILENAME"]), strlen($serverroot)));
$name = OC_Config::getValue('overwritewebroot', '') . $suburi;
diff --git a/lib/setup.php b/lib/setup.php
index 8814447f52f..f1ac6b8b2b8 100644
--- a/lib/setup.php
+++ b/lib/setup.php
@@ -37,7 +37,7 @@ class OC_Setup {
$error[] = $l->t('Set an admin password.');
}
if(empty($options['directory'])) {
- $error[] = $l->t('Specify a data folder.');
+ $options['directory'] = OC::$SERVERROOT."/data";
}
if($dbtype == 'mysql' or $dbtype == 'pgsql' or $dbtype == 'oci' or $dbtype == 'mssql') { //mysql and postgresql needs more config options
@@ -70,6 +70,10 @@ class OC_Setup {
$password = htmlspecialchars_decode($options['adminpass']);
$datadir = htmlspecialchars_decode($options['directory']);
+ if (OC_Util::runningOnWindows()) {
+ $datadir = rtrim(realpath($datadir), '\\');
+ }
+
//use sqlite3 when available, otherise sqlite2 will be used.
if($dbtype=='sqlite' and class_exists('SQLite3')) {
$dbtype='sqlite3';
@@ -183,6 +187,7 @@ class OC_Setup {
unlink("$datadir/owncloud.db");
}
//in case of sqlite, we can always fill the database
+ error_log("creating sqlite db");
OC_DB::createDbFromStructure('db_structure.xml');
}
@@ -191,7 +196,7 @@ class OC_Setup {
OC_User::createUser($username, $password);
}
catch(Exception $exception) {
- $error[] = $exception->getMessage();
+ $error[] = 'Error while trying to create admin user: ' . $exception->getMessage();
}
if(count($error) == 0) {
@@ -239,7 +244,7 @@ class OC_Setup {
$dbusername=substr('oc_'.$username, 0, 16);
if($dbusername!=$oldUser) {
//hash the password so we don't need to store the admin config in the config file
- $dbpassword=md5(time().$dbpass);
+ $dbpassword=OC_Util::generate_random_bytes(30);
self::createDBUser($dbusername, $dbpassword, $connection);
@@ -329,7 +334,7 @@ class OC_Setup {
//add prefix to the postgresql user name to prevent collisions
$dbusername='oc_'.$username;
//create a new password so we don't need to store the admin config in the config file
- $dbpassword=md5(time());
+ $dbpassword=OC_Util::generate_random_bytes(30);
self::pg_createDBUser($dbusername, $dbpassword, $connection);
@@ -472,7 +477,7 @@ class OC_Setup {
//add prefix to the oracle user name to prevent collisions
$dbusername='oc_'.$username;
//create a new password so we don't need to store the admin config in the config file
- $dbpassword=md5(time().$dbpass);
+ $dbpassword=OC_Util::generate_random_bytes(30);
//oracle passwords are treated as identifiers:
// must start with aphanumeric char
@@ -806,6 +811,7 @@ class OC_Setup {
$content.= "php_value upload_max_filesize 512M\n";//upload limit
$content.= "php_value post_max_size 512M\n";
$content.= "php_value memory_limit 512M\n";
+ $content.= "php_value mbstring.func_overload 0\n";
$content.= "<IfModule env_module>\n";
$content.= " SetEnv htaccessWorking true\n";
$content.= "</IfModule>\n";
@@ -823,6 +829,10 @@ class OC_Setup {
$content.= "AddType image/svg+xml svg svgz\n";
$content.= "AddEncoding gzip svgz\n";
$content.= "</IfModule>\n";
+ $content.= "<IfModule dir_module>\n";
+ $content.= "DirectoryIndex index.php index.html\n";
+ $content.= "</IfModule>\n";
+ $content.= "AddDefaultCharset utf-8\n";
$content.= "Options -Indexes\n";
@file_put_contents(OC::$SERVERROOT.'/.htaccess', $content); //supress errors in case we don't have permissions for it
diff --git a/lib/template.php b/lib/template.php
index 434c1e9e990..2f535335648 100644
--- a/lib/template.php
+++ b/lib/template.php
@@ -186,10 +186,15 @@ class OC_Template{
$this->l10n = OC_L10N::get($parts[0]);
// Some headers to enhance security
- header('X-Frame-Options: Sameorigin'); // Disallow iFraming from other domains
header('X-XSS-Protection: 1; mode=block'); // Enforce browser based XSS filters
header('X-Content-Type-Options: nosniff'); // Disable sniffing the content type for IE
+ // iFrame Restriction Policy
+ $xFramePolicy = OC_Config::getValue('xframe_restriction', true);
+ if($xFramePolicy) {
+ header('X-Frame-Options: Sameorigin'); // Disallow iFraming from other domains
+ }
+
// Content Security Policy
// If you change the standard policy, please also change it in config.sample.php
$policy = OC_Config::getValue('custom_csp_policy',
@@ -198,7 +203,8 @@ class OC_Template{
.'style-src \'self\' \'unsafe-inline\'; '
.'frame-src *; '
.'img-src *; '
- .'font-src \'self\' data:');
+ .'font-src \'self\' data:; '
+ .'media-src *');
header('Content-Security-Policy:'.$policy); // Standard
$this->findTemplate($name);
@@ -272,7 +278,7 @@ class OC_Template{
protected function findTemplate($name)
{
// Read the selected theme from the config file
- $theme=OC_Config::getValue( "theme" );
+ $theme = OC_Util::getTheme();
// Read the detected formfactor and use the right file name.
$fext = self::getFormFactorExtension();
diff --git a/lib/templatelayout.php b/lib/templatelayout.php
index 29f120a6041..7115b8f0306 100644
--- a/lib/templatelayout.php
+++ b/lib/templatelayout.php
@@ -18,6 +18,20 @@ class OC_TemplateLayout extends OC_Template {
$this->assign('bodyid', 'body-user');
}
+ // Update notification
+ if(OC_Config::getValue('updatechecker', true) === true) {
+ $data=OC_Updater::check();
+ if(isset($data['version']) && $data['version'] != '' and $data['version'] !== Array() && OC_User::isAdminUser(OC_User::getUser())) {
+ $this->assign('updateAvailable', true);
+ $this->assign('updateVersion', $data['versionstring']);
+ $this->assign('updateLink', $data['web']);
+ } else {
+ $this->assign('updateAvailable', false); // No update available or not an admin user
+ }
+ } else {
+ $this->assign('updateAvailable', false); // Update check is disabled
+ }
+
// Add navigation entry
$this->assign( 'application', '', false );
$navigation = OC_App::getNavigation();
@@ -37,51 +51,35 @@ class OC_TemplateLayout extends OC_Template {
} else {
parent::__construct('core', 'layout.base');
}
+ $versionParameter = '?v=' . md5(implode(OC_Util::getVersion()));
// Add the js files
$jsfiles = self::findJavascriptFiles(OC_Util::$scripts);
$this->assign('jsfiles', array(), false);
if (OC_Config::getValue('installed', false) && $renderas!='error') {
- $this->append( 'jsfiles', OC_Helper::linkToRoute('js_config'));
+ $this->append( 'jsfiles', OC_Helper::linkToRoute('js_config') . $versionParameter);
}
if (!empty(OC_Util::$core_scripts)) {
- $this->append( 'jsfiles', OC_Helper::linkToRemoteBase('core.js', false));
+ $this->append( 'jsfiles', OC_Helper::linkToRemoteBase('core.js', false) . $versionParameter);
}
foreach($jsfiles as $info) {
$root = $info[0];
$web = $info[1];
$file = $info[2];
- $this->append( 'jsfiles', $web.'/'.$file);
+ $this->append( 'jsfiles', $web.'/'.$file . $versionParameter);
}
// Add the css files
$cssfiles = self::findStylesheetFiles(OC_Util::$styles);
$this->assign('cssfiles', array());
if (!empty(OC_Util::$core_styles)) {
- $this->append( 'cssfiles', OC_Helper::linkToRemoteBase('core.css', false));
+ $this->append( 'cssfiles', OC_Helper::linkToRemoteBase('core.css', false) . $versionParameter);
}
foreach($cssfiles as $info) {
$root = $info[0];
$web = $info[1];
$file = $info[2];
- $paths = explode('/', $file);
- $in_root = false;
- foreach(OC::$APPSROOTS as $app_root) {
- if($root == $app_root['path']) {
- $in_root = true;
- break;
- }
- }
-
- if($in_root ) {
- $app = $paths[0];
- unset($paths[0]);
- $path = implode('/', $paths);
- $this->append( 'cssfiles', OC_Helper::linkTo($app, $path));
- }
- else {
- $this->append( 'cssfiles', $web.'/'.$file);
- }
+ $this->append( 'cssfiles', $web.'/'.$file . $versionParameter);
}
}
@@ -102,7 +100,7 @@ class OC_TemplateLayout extends OC_Template {
static public function findStylesheetFiles($styles) {
// Read the selected theme from the config file
- $theme=OC_Config::getValue( 'theme' );
+ $theme = OC_Util::getTheme();
// Read the detected formfactor and use the right file name.
$fext = self::getFormFactorExtension();
@@ -110,7 +108,8 @@ class OC_TemplateLayout extends OC_Template {
$files = array();
foreach($styles as $style) {
// is it in 3rdparty?
- if(self::appendIfExist($files, OC::$THIRDPARTYROOT, OC::$THIRDPARTYWEBROOT, $style.'.css')) {
+ if(strpos($style, '3rdparty') === 0 &&
+ self::appendIfExist($files, OC::$THIRDPARTYROOT, OC::$THIRDPARTYWEBROOT, $style.'.css')) {
// or in the owncloud root?
}elseif(self::appendIfExist($files, OC::$SERVERROOT, OC::$WEBROOT, "$style$fext.css" )) {
@@ -121,20 +120,15 @@ class OC_TemplateLayout extends OC_Template {
}elseif(self::appendIfExist($files, OC::$SERVERROOT, OC::$WEBROOT, "core/$style.css" )) {
}else{
- $append = false;
- // or in apps?
- foreach( OC::$APPSROOTS as $apps_dir)
- {
- if(self::appendIfExist($files, $apps_dir['path'], $apps_dir['url'], "$style$fext.css")) {
- $append = true;
- break;
- }
- elseif(self::appendIfExist($files, $apps_dir['path'], $apps_dir['url'], "$style.css")) {
- $append = true;
- break;
- }
+ $app = substr($style, 0, strpos($style, '/'));
+ $style = substr($style, strpos($style, '/')+1);
+ $app_path = OC_App::getAppPath($app);
+ $app_url = OC::$WEBROOT . '/index.php/apps/' . $app;
+ if(self::appendIfExist($files, $app_path, $app_url, "$style$fext.css")) {
}
- if(! $append) {
+ elseif(self::appendIfExist($files, $app_path, $app_url, "$style.css")) {
+ }
+ else {
echo('css file not found: style:'.$style.' formfactor:'.$fext
.' webroot:'.OC::$WEBROOT.' serverroot:'.OC::$SERVERROOT);
die();
@@ -160,7 +154,7 @@ class OC_TemplateLayout extends OC_Template {
static public function findJavascriptFiles($scripts) {
// Read the selected theme from the config file
- $theme=OC_Config::getValue( 'theme' );
+ $theme = OC_Util::getTheme();
// Read the detected formfactor and use the right file name.
$fext = self::getFormFactorExtension();
@@ -168,7 +162,8 @@ class OC_TemplateLayout extends OC_Template {
$files = array();
foreach($scripts as $script) {
// Is it in 3rd party?
- if(self::appendIfExist($files, OC::$THIRDPARTYROOT, OC::$THIRDPARTYWEBROOT, $script.'.js')) {
+ if(strpos($script, '3rdparty') === 0 &&
+ self::appendIfExist($files, OC::$THIRDPARTYROOT, OC::$THIRDPARTYWEBROOT, $script.'.js')) {
// Is it in apps and overwritten by the theme?
}elseif(self::appendIfExist($files, OC::$SERVERROOT, OC::$WEBROOT, "themes/$theme/apps/$script$fext.js" )) {
@@ -192,18 +187,15 @@ class OC_TemplateLayout extends OC_Template {
}else{
// Is it part of an app?
- $append = false;
- foreach( OC::$APPSROOTS as $apps_dir) {
- if(self::appendIfExist($files, $apps_dir['path'], OC::$WEBROOT.$apps_dir['url'], "$script$fext.js")) {
- $append = true;
- break;
- }
- elseif(self::appendIfExist($files, $apps_dir['path'], OC::$WEBROOT.$apps_dir['url'], "$script.js")) {
- $append = true;
- break;
- }
+ $app = substr($script, 0, strpos($script, '/'));
+ $script = substr($script, strpos($script, '/')+1);
+ $app_path = OC_App::getAppPath($app);
+ $app_url = OC_App::getAppWebPath($app);
+ if(self::appendIfExist($files, $app_path, $app_url, "$script$fext.js")) {
+ }
+ elseif(self::appendIfExist($files, $app_path, $app_url, "$script.js")) {
}
- if(! $append) {
+ else {
echo('js file not found: script:'.$script.' formfactor:'.$fext
.' webroot:'.OC::$WEBROOT.' serverroot:'.OC::$SERVERROOT);
die();
diff --git a/lib/updater.php b/lib/updater.php
index e7d33ac2bb9..9081bfc4be8 100644
--- a/lib/updater.php
+++ b/lib/updater.php
@@ -29,7 +29,14 @@ class OC_Updater{
* Check if a new version is available
*/
public static function check() {
- OC_Appconfig::setValue('core', 'lastupdatedat', microtime(true));
+
+ // Look up the cache - it is invalidated all 30 minutes
+ if((OC_Appconfig::getValue('core', 'lastupdatedat') + 1800) > time()) {
+ return json_decode(OC_Appconfig::getValue('core', 'lastupdateResult'), true);
+ }
+
+ OC_Appconfig::setValue('core', 'lastupdatedat', time());
+
if(OC_Appconfig::getValue('core', 'installedat', '')=='') {
OC_Appconfig::setValue('core', 'installedat', microtime(true));
}
@@ -65,38 +72,9 @@ class OC_Updater{
$tmp['url'] = $data->url;
$tmp['web'] = $data->web;
- return $tmp;
- }
-
- public static function ShowUpdatingHint() {
- $l = OC_L10N::get('lib');
-
- if(OC_Config::getValue('updatechecker', true)==true) {
- $data=OC_Updater::check();
- if(isset($data['version']) and $data['version']<>'') {
- $txt='<span style="color:#AA0000; font-weight:bold;">'
- .$l->t('%s is available. Get <a href="%s">more information</a>',
- array($data['versionstring'], $data['web'])).'</span>';
- }else{
- $txt=$l->t('up to date');
- }
- }else{
- $txt=$l->t('updates check is disabled');
- }
- return($txt);
- }
-
-
- /**
- * do ownCloud update
- */
- public static function doUpdate() {
-
- //update ownCloud core
-
- //update all apps
-
- //update version in config
+ // Cache the result
+ OC_Appconfig::setValue('core', 'lastupdateResult', json_encode($data));
+ return $tmp;
}
-}
+} \ No newline at end of file
diff --git a/lib/user.php b/lib/user.php
index 6144f0f6bf9..b607874afaf 100644
--- a/lib/user.php
+++ b/lib/user.php
@@ -32,7 +32,7 @@
* post_deleteUser(uid)
* pre_setPassword(&run, uid, password)
* post_setPassword(uid, password)
- * pre_login(&run, uid)
+ * pre_login(&run, uid, password)
* post_login(uid)
* logout()
*/
@@ -244,7 +244,7 @@ class OC_User {
*/
public static function login( $uid, $password ) {
$run = true;
- OC_Hook::emit( "OC_User", "pre_login", array( "run" => &$run, "uid" => $uid ));
+ OC_Hook::emit( "OC_User", "pre_login", array( "run" => &$run, "uid" => $uid, "password" => $password));
if( $run ) {
$uid = self::checkPassword( $uid, $password );
@@ -386,7 +386,7 @@ class OC_User {
* generates a password
*/
public static function generatePassword() {
- return uniqId();
+ return OC_Util::generate_random_bytes(30);
}
/**
@@ -527,7 +527,7 @@ class OC_User {
foreach (self::$_usedBackends as $backend) {
$backendDisplayNames = $backend->getDisplayNames($search, $limit, $offset);
if (is_array($backendDisplayNames)) {
- $displayNames = array_merge($displayNames, $backendDisplayNames);
+ $displayNames = $displayNames + $backendDisplayNames;
}
}
asort($displayNames);
@@ -633,9 +633,9 @@ class OC_User {
public static function setMagicInCookie($username, $token) {
$secure_cookie = OC_Config::getValue("forcessl", false);
$expires = time() + OC_Config::getValue('remember_login_cookie_lifetime', 60*60*24*15);
- setcookie("oc_username", $username, $expires, '', '', $secure_cookie);
- setcookie("oc_token", $token, $expires, '', '', $secure_cookie, true);
- setcookie("oc_remember_login", true, $expires, '', '', $secure_cookie);
+ setcookie("oc_username", $username, $expires, OC::$WEBROOT, '', $secure_cookie);
+ setcookie("oc_token", $token, $expires, OC::$WEBROOT, '', $secure_cookie, true);
+ setcookie("oc_remember_login", true, $expires, OC::$WEBROOT, '', $secure_cookie);
}
/**
diff --git a/lib/user/database.php b/lib/user/database.php
index 210c7f3e1eb..63c64ed43d3 100644
--- a/lib/user/database.php
+++ b/lib/user/database.php
@@ -46,7 +46,7 @@ class OC_User_Database extends OC_User_Backend {
private function getHasher() {
if(!self::$hasher) {
- //we don't want to use DES based crypt(), since it doesn't return a has with a recognisable prefix
+ //we don't want to use DES based crypt(), since it doesn't return a hash with a recognisable prefix
$forcePortable=(CRYPT_BLOWFISH!=1);
self::$hasher=new PasswordHash(8, $forcePortable);
}
@@ -237,13 +237,13 @@ class OC_User_Database extends OC_User_Backend {
* @return boolean
*/
public function userExists($uid) {
- $query = OC_DB::prepare( 'SELECT * FROM `*PREFIX*users` WHERE LOWER(`uid`) = LOWER(?)' );
+ $query = OC_DB::prepare( 'SELECT COUNT(*) FROM `*PREFIX*users` WHERE LOWER(`uid`) = LOWER(?)' );
$result = $query->execute( array( $uid ));
if (OC_DB::isError($result)) {
OC_Log::write('core', OC_DB::getErrorMessage($result), OC_Log::ERROR);
return false;
}
- return $result->numRows() > 0;
+ return $result->fetchOne() > 0;
}
/**
diff --git a/lib/util.php b/lib/util.php
index 6ed3b8b942f..48c224a3034 100755
--- a/lib/util.php
+++ b/lib/util.php
@@ -38,6 +38,7 @@ class OC_Util {
$CONFIG_DATADIRECTORY = OC_Config::getValue( "datadirectory", OC::$SERVERROOT."/data" );
//first set up the local "root" storage
+ \OC\Files\Filesystem::initMounts();
if(!self::$rootMounted) {
\OC\Files\Filesystem::mount('\OC\Files\Storage\Local', array('datadir'=>$CONFIG_DATADIRECTORY), '/');
self::$rootMounted=true;
@@ -66,6 +67,7 @@ class OC_Util {
public static function tearDownFS() {
\OC\Files\Filesystem::tearDown();
self::$fsSetup=false;
+ self::$rootMounted=false;
}
/**
@@ -75,7 +77,7 @@ class OC_Util {
public static function getVersion() {
// hint: We only can count up. Reset minor/patchlevel when
// updating major/minor version number.
- return array(4, 97, 11);
+ return array(5, 80, 03);
}
/**
@@ -83,7 +85,7 @@ class OC_Util {
* @return string
*/
public static function getVersionString() {
- return '5.0 RC 3';
+ return '6.0 pre alpha';
}
/**
@@ -211,7 +213,7 @@ class OC_Util {
."'chown -R www-data:www-data /path/to/your/owncloud/install/data' ");
}
} else if(!is_writable($CONFIG_DATADIRECTORY) or !is_readable($CONFIG_DATADIRECTORY)) {
- $errors[]=array('error'=>'Data directory ('.$CONFIG_DATADIRECTORY.') not writable by ownCloud<br/>',
+ $errors[]=array('error'=>'Data directory ('.$CONFIG_DATADIRECTORY.') not writable by ownCloud',
'hint'=>$permissionsHint);
} else {
$errors = array_merge($errors, self::checkDataDirectoryPermissions($CONFIG_DATADIRECTORY));
@@ -220,68 +222,76 @@ class OC_Util {
if(!class_exists('ZipArchive')) {
$errors[]=array('error'=>'PHP module zip not installed.',
'hint'=>'Please ask your server administrator to install the module.');
- $web_server_restart= false;
+ $web_server_restart=true;
}
if(!class_exists('DOMDocument')) {
$errors[] = array('error' => 'PHP module dom not installed.',
'hint' => 'Please ask your server administrator to install the module.');
- $web_server_restart = false;
+ $web_server_restart =true;
}
if(!function_exists('xml_parser_create')) {
$errors[] = array('error' => 'PHP module libxml not installed.',
'hint' => 'Please ask your server administrator to install the module.');
- $web_server_restart = false;
+ $web_server_restart =true;
}
if(!function_exists('mb_detect_encoding')) {
$errors[]=array('error'=>'PHP module mb multibyte not installed.',
'hint'=>'Please ask your server administrator to install the module.');
- $web_server_restart= false;
+ $web_server_restart=true;
}
if(!function_exists('ctype_digit')) {
$errors[]=array('error'=>'PHP module ctype is not installed.',
'hint'=>'Please ask your server administrator to install the module.');
- $web_server_restart= false;
+ $web_server_restart=true;
}
if(!function_exists('json_encode')) {
$errors[]=array('error'=>'PHP module JSON is not installed.',
'hint'=>'Please ask your server administrator to install the module.');
- $web_server_restart= false;
+ $web_server_restart=true;
}
- if(!function_exists('imagepng')) {
+ if(!extension_loaded('gd') || !function_exists('gd_info')) {
$errors[]=array('error'=>'PHP module GD is not installed.',
'hint'=>'Please ask your server administrator to install the module.');
- $web_server_restart= false;
+ $web_server_restart=true;
}
if(!function_exists('gzencode')) {
$errors[]=array('error'=>'PHP module zlib is not installed.',
'hint'=>'Please ask your server administrator to install the module.');
- $web_server_restart= false;
+ $web_server_restart=true;
}
if(!function_exists('iconv')) {
$errors[]=array('error'=>'PHP module iconv is not installed.',
'hint'=>'Please ask your server administrator to install the module.');
- $web_server_restart= false;
+ $web_server_restart=true;
}
if(!function_exists('simplexml_load_string')) {
$errors[]=array('error'=>'PHP module SimpleXML is not installed.',
'hint'=>'Please ask your server administrator to install the module.');
- $web_server_restart= false;
+ $web_server_restart=true;
}
if(floatval(phpversion())<5.3) {
$errors[]=array('error'=>'PHP 5.3 is required.',
'hint'=>'Please ask your server administrator to update PHP to version 5.3 or higher.'
.' PHP 5.2 is no longer supported by ownCloud and the PHP community.');
- $web_server_restart= false;
+ $web_server_restart=true;
}
if(!defined('PDO::ATTR_DRIVER_NAME')) {
$errors[]=array('error'=>'PHP PDO module is not installed.',
'hint'=>'Please ask your server administrator to install the module.');
- $web_server_restart= false;
+ $web_server_restart=true;
}
- if(ini_get('safe_mode')) {
+ if (((strtolower(@ini_get('safe_mode')) == 'on')
+ || (strtolower(@ini_get('safe_mode')) == 'yes')
+ || (strtolower(@ini_get('safe_mode')) == 'true')
+ || (ini_get("safe_mode") == 1 ))) {
$errors[]=array('error'=>'PHP Safe Mode is enabled. ownCloud requires that it is disabled to work properly.',
'hint'=>'PHP Safe Mode is a deprecated and mostly useless setting that should be disabled. Please ask your server administrator to disable it in php.ini or in your webserver config.');
- $web_server_restart= false;
+ $web_server_restart=true;
+ }
+ if (get_magic_quotes_gpc() == 1 ) {
+ $errors[]=array('error'=>'Magic Quotes is enabled. ownCloud requires that it is disabled to work properly.',
+ 'hint'=>'Magic Quotes is a deprecated and mostly useless setting that should be disabled. Please ask your server administrator to disable it in php.ini or in your webserver config.');
+ $web_server_restart=true;
}
if($web_server_restart) {
@@ -309,7 +319,7 @@ class OC_Util {
clearstatcache();
$prems = substr(decoct(@fileperms($dataDirectory)), -3);
if (substr($prems, 2, 1) != '0') {
- $errors[] = array('error' => 'Data directory ('.$dataDirectory.') is readable for other users<br/>',
+ $errors[] = array('error' => 'Data directory ('.$dataDirectory.') is readable for other users',
'hint' => $permissionsModHint);
}
}
@@ -408,18 +418,19 @@ class OC_Util {
exit();
}
- /**
- * get an id unqiue for this instance
- * @return string
- */
- public static function getInstanceId() {
- $id=OC_Config::getValue('instanceid', null);
- if(is_null($id)) {
- $id=uniqid();
- OC_Config::setValue('instanceid', $id);
- }
- return $id;
- }
+ /**
+ * get an id unique for this instance
+ * @return string
+ */
+ public static function getInstanceId() {
+ $id = OC_Config::getValue('instanceid', null);
+ if(is_null($id)) {
+ // We need to guarantee at least one letter in instanceid so it can be used as the session_name
+ $id = 'oc' . OC_Util::generate_random_bytes(10);
+ OC_Config::setValue('instanceid', $id);
+ }
+ return $id;
+ }
/**
* @brief Static lifespan (in seconds) when a request token expires.
@@ -591,7 +602,7 @@ class OC_Util {
} catch(\Sabre_DAV_Exception_NotAuthenticated $e) {
$return = true;
} catch(\Exception $e) {
- OC_Log::write('core', 'isWebDAVWorking: NO - Reason: '.$e, OC_Log::WARN);
+ OC_Log::write('core', 'isWebDAVWorking: NO - Reason: '.$e->getMessage(). ' ('.get_class($e).')', OC_Log::WARN);
$return = false;
}
@@ -614,8 +625,8 @@ class OC_Util {
$result = setlocale(LC_ALL, 'en_US.UTF-8', 'en_US.UTF8');
if($result == false) {
return false;
- }
- return true;
+ }
+ return true;
}
/**
@@ -631,6 +642,11 @@ class OC_Util {
*/
public static function isinternetconnectionworking() {
+ // in case there is no internet connection on purpose there is no need to display a warning
+ if (!\OC_Config::getValue("has_internet_connection", true)) {
+ return true;
+ }
+
// try to connect to owncloud.org to see if http connections to the internet are possible.
$connected = @fsockopen("www.owncloud.org", 80);
if ($connected) {
@@ -786,4 +802,25 @@ class OC_Util {
return (substr(PHP_OS, 0, 3) === "WIN");
}
+
+ /**
+ * Handles the case that there may not be a theme, then check if a "default"
+ * theme exists and take that one
+ * @return string the theme
+ */
+ public static function getTheme() {
+ $theme = OC_Config::getValue("theme");
+
+ if(is_null($theme)) {
+
+ if(is_dir(OC::$SERVERROOT . '/themes/default')) {
+ $theme = 'default';
+ }
+
+ }
+
+ return $theme;
+ }
+
+
}
diff --git a/lib/vcategories.php b/lib/vcategories.php
index 2f990c5d2d2..91c72d5dfae 100644
--- a/lib/vcategories.php
+++ b/lib/vcategories.php
@@ -325,6 +325,37 @@ class OC_VCategories {
}
/**
+ * @brief Rename category.
+ * @param string $from The name of the existing category
+ * @param string $to The new name of the category.
+ * @returns bool
+ */
+ public function rename($from, $to) {
+ $id = $this->array_searchi($from, $this->categories);
+ if($id === false) {
+ OCP\Util::writeLog('core', __METHOD__.', category: ' . $from. ' does not exist', OCP\Util::DEBUG);
+ return false;
+ }
+
+ $sql = 'UPDATE `' . self::CATEGORY_TABLE . '` SET `category` = ? '
+ . 'WHERE `uid` = ? AND `type` = ? AND `id` = ?';
+ try {
+ $stmt = OCP\DB::prepare($sql);
+ $result = $stmt->execute(array($to, $this->user, $this->type, $id));
+ if (OC_DB::isError($result)) {
+ OC_Log::write('core', __METHOD__. 'DB error: ' . OC_DB::getErrorMessage($result), OC_Log::ERROR);
+ return false;
+ }
+ } catch(Exception $e) {
+ OCP\Util::writeLog('core', __METHOD__.', exception: '.$e->getMessage(),
+ OCP\Util::ERROR);
+ return false;
+ }
+ $this->categories[$id] = $to;
+ return true;
+ }
+
+ /**
* @brief Add a new category.
* @param $names A string with a name or an array of strings containing
* the name(s) of the categor(y|ies) to add.
@@ -536,23 +567,31 @@ class OC_VCategories {
/**
* @brief Delete category/object relations from the db
- * @param int $id The id of the object
+ * @param array $ids The ids of the objects
* @param string $type The type of object (event/contact/task/journal).
* Defaults to the type set in the instance
* @returns boolean Returns false on error.
*/
- public function purgeObject($id, $type = null) {
+ public function purgeObjects(array $ids, $type = null) {
$type = is_null($type) ? $this->type : $type;
+ if(count($ids) === 0) {
+ // job done ;)
+ return true;
+ }
+ $updates = $ids;
try {
- $stmt = OCP\DB::prepare('DELETE FROM `' . self::RELATION_TABLE . '` '
- . 'WHERE `objid` = ? AND `type`= ?');
- $result = $stmt->execute(array($id, $type));
+ $query = 'DELETE FROM `' . self::RELATION_TABLE . '` ';
+ $query .= 'WHERE `objid` IN (' . str_repeat('?,', count($ids)-1) . '?) ';
+ $query .= 'AND `type`= ?';
+ $updates[] = $type;
+ $stmt = OCP\DB::prepare($query);
+ $result = $stmt->execute($updates);
if (OC_DB::isError($result)) {
OC_Log::write('core', __METHOD__. 'DB error: ' . OC_DB::getErrorMessage($result), OC_Log::ERROR);
return false;
}
} catch(Exception $e) {
- OCP\Util::writeLog('core', __METHOD__.', exception: '.$e->getMessage(),
+ OCP\Util::writeLog('core', __METHOD__.', exception: ' . $e->getMessage(),
OCP\Util::ERROR);
return false;
}
diff --git a/lib/vobject/compoundproperty.php b/lib/vobject/compoundproperty.php
new file mode 100644
index 00000000000..d702ab802e0
--- /dev/null
+++ b/lib/vobject/compoundproperty.php
@@ -0,0 +1,70 @@
+<?php
+/**
+ * ownCloud - VObject Compound Property
+ *
+ * @author Thomas Tanghus
+ * @author Evert Pot (http://www.rooftopsolutions.nl/)
+ *
+ * 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 OC\VObject;
+
+/**
+ * This class overrides \Sabre\VObject\Property::serialize() to not
+ * double escape commas and semi-colons in compound properties.
+*/
+class CompoundProperty extends \Sabre\VObject\Property\Compound {
+
+ /**
+ * Turns the object back into a serialized blob.
+ *
+ * @return string
+ */
+ public function serialize() {
+
+ $str = $this->name;
+ if ($this->group) {
+ $str = $this->group . '.' . $this->name;
+ }
+
+ foreach($this->parameters as $param) {
+ $str.=';' . $param->serialize();
+ }
+ $src = array(
+ "\n",
+ );
+ $out = array(
+ '\n',
+ );
+ $str.=':' . str_replace($src, $out, $this->value);
+
+ $out = '';
+ while(strlen($str) > 0) {
+ if (strlen($str) > 75) {
+ $out .= mb_strcut($str, 0, 75, 'utf-8') . "\r\n";
+ $str = ' ' . mb_strcut($str, 75, strlen($str), 'utf-8');
+ } else {
+ $out .= $str . "\r\n";
+ $str = '';
+ break;
+ }
+ }
+
+ return $out;
+
+ }
+
+} \ No newline at end of file
diff --git a/lib/vobject/stringproperty.php b/lib/vobject/stringproperty.php
new file mode 100644
index 00000000000..b98a8f26c2b
--- /dev/null
+++ b/lib/vobject/stringproperty.php
@@ -0,0 +1,80 @@
+<?php
+/**
+ * ownCloud - VObject String Property
+ *
+ * This class adds escaping of simple string properties.
+ *
+ * @author Thomas Tanghus
+ * @author Evert Pot (http://www.rooftopsolutions.nl/)
+ *
+ * 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 OC\VObject;
+
+/**
+ * This class overrides \Sabre\VObject\Property::serialize() properly
+ * escape commas and semi-colons in string properties.
+*/
+class StringProperty extends \Sabre\VObject\Property {
+
+ /**
+ * Turns the object back into a serialized blob.
+ *
+ * @return string
+ */
+ public function serialize() {
+
+ $str = $this->name;
+ if ($this->group) {
+ $str = $this->group . '.' . $this->name;
+ }
+
+ foreach($this->parameters as $param) {
+ $str.=';' . $param->serialize();
+ }
+
+ $src = array(
+ '\\',
+ "\n",
+ ';',
+ ',',
+ );
+ $out = array(
+ '\\\\',
+ '\n',
+ '\;',
+ '\,',
+ );
+ $value = strtr($this->value, array('\,' => ',', '\;' => ';', '\\\\' => '\\'));
+ $str.=':' . str_replace($src, $out, $value);
+
+ $out = '';
+ while(strlen($str) > 0) {
+ if (strlen($str) > 75) {
+ $out .= mb_strcut($str, 0, 75, 'utf-8') . "\r\n";
+ $str = ' ' . mb_strcut($str, 75, strlen($str), 'utf-8');
+ } else {
+ $out .= $str . "\r\n";
+ $str = '';
+ break;
+ }
+ }
+
+ return $out;
+
+ }
+
+} \ No newline at end of file