aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore6
-rw-r--r--apps/files/ajax/upload.php14
-rw-r--r--apps/files/l10n/ca.js1
-rw-r--r--apps/files/l10n/ca.json1
-rw-r--r--apps/files_encryption/ajax/updatePrivateKeyPassword.php3
-rw-r--r--apps/files_encryption/l10n/sq.js3
-rw-r--r--apps/files_encryption/l10n/sq.json3
-rw-r--r--apps/files_encryption/lib/proxy.php1
-rw-r--r--apps/files_encryption/lib/session.php31
-rw-r--r--apps/files_encryption/tests/hooks.php2
-rwxr-xr-xapps/files_encryption/tests/share.php22
-rw-r--r--apps/files_external/l10n/fr.js2
-rw-r--r--apps/files_external/l10n/fr.json2
-rw-r--r--apps/files_external/lib/api.php4
-rw-r--r--apps/files_sharing/ajax/list.php4
-rw-r--r--apps/files_sharing/ajax/shareinfo.php2
-rw-r--r--apps/files_sharing/l10n/ru.js5
-rw-r--r--apps/files_sharing/l10n/ru.json5
-rw-r--r--apps/files_sharing/lib/controllers/sharecontroller.php11
-rw-r--r--apps/files_sharing/lib/readonlycache.php4
-rw-r--r--apps/files_sharing/lib/readonlywrapper.php2
-rw-r--r--apps/files_sharing/lib/share/folder.php5
-rw-r--r--apps/files_sharing/lib/sharedstorage.php14
-rw-r--r--apps/files_sharing/public.php2
-rw-r--r--apps/files_sharing/publicwebdav.php2
-rw-r--r--apps/files_sharing/tests/api.php6
-rw-r--r--apps/files_sharing/tests/cache.php4
-rw-r--r--apps/files_sharing/tests/controller/sharecontroller.php2
-rw-r--r--apps/files_sharing/tests/share.php28
-rw-r--r--apps/files_trashbin/lib/helper.php2
-rw-r--r--apps/files_versions/tests/versions.php4
-rw-r--r--apps/user_ldap/ajax/wizard.php2
-rw-r--r--apps/user_ldap/js/ldapFilter.js63
-rw-r--r--apps/user_ldap/js/settings.js117
-rw-r--r--apps/user_ldap/l10n/cs_CZ.js1
-rw-r--r--apps/user_ldap/l10n/cs_CZ.json1
-rw-r--r--apps/user_ldap/l10n/fr.js1
-rw-r--r--apps/user_ldap/l10n/fr.json1
-rw-r--r--apps/user_ldap/l10n/nl.js1
-rw-r--r--apps/user_ldap/l10n/nl.json1
-rw-r--r--apps/user_ldap/l10n/pt_BR.js1
-rw-r--r--apps/user_ldap/l10n/pt_BR.json1
-rw-r--r--apps/user_ldap/l10n/sq.js1
-rw-r--r--apps/user_ldap/l10n/sq.json1
-rw-r--r--apps/user_ldap/lib/access.php32
-rw-r--r--apps/user_ldap/lib/wizard.php57
-rw-r--r--apps/user_ldap/tests/user_ldap.php32
-rw-r--r--apps/user_ldap/user_ldap.php3
-rw-r--r--config/config.sample.php8
-rw-r--r--core/js/lostpassword.js6
-rw-r--r--core/js/oc-requesttoken.js3
-rw-r--r--core/l10n/fr.js2
-rw-r--r--core/l10n/fr.json2
-rw-r--r--core/l10n/ru.js2
-rw-r--r--core/l10n/ru.json2
-rw-r--r--core/l10n/sk_SK.js1
-rw-r--r--core/l10n/sk_SK.json1
-rw-r--r--core/l10n/sq.js104
-rw-r--r--core/l10n/sq.json104
-rw-r--r--lib/l10n/fr.js2
-rw-r--r--lib/l10n/fr.json2
-rw-r--r--lib/l10n/sk_SK.js2
-rw-r--r--lib/l10n/sk_SK.json2
-rw-r--r--lib/l10n/sl.js2
-rw-r--r--lib/l10n/sl.json2
-rw-r--r--lib/l10n/sq.js1
-rw-r--r--lib/l10n/sq.json1
-rw-r--r--lib/private/app.php59
-rw-r--r--lib/private/app/infoparser.php84
-rw-r--r--lib/private/appframework/core/api.php3
-rw-r--r--lib/private/appframework/routing/routeconfig.php8
-rw-r--r--lib/private/contacts/localaddressbook.php2
-rw-r--r--lib/private/contactsmanager.php4
-rw-r--r--lib/private/db/connectionfactory.php4
-rw-r--r--lib/private/db/sqlitesessioninit.php10
-rw-r--r--lib/private/files/fileinfo.php10
-rw-r--r--lib/private/files/node/file.php10
-rw-r--r--lib/private/files/node/folder.php8
-rw-r--r--lib/private/files/node/node.php10
-rw-r--r--lib/private/files/node/root.php2
-rw-r--r--lib/private/files/objectstore/objectstorestorage.php6
-rw-r--r--lib/private/files/storage/common.php10
-rw-r--r--lib/private/files/storage/dav.php24
-rw-r--r--lib/private/files/view.php10
-rw-r--r--lib/private/helper.php22
-rw-r--r--lib/private/l10n.php42
-rw-r--r--lib/private/migrate.php626
-rw-r--r--lib/private/migration/content.php246
-rw-r--r--lib/private/migration/provider.php52
-rw-r--r--lib/private/preview.php14
-rw-r--r--lib/private/preview/image.php2
-rw-r--r--lib/private/preview/movie.php (renamed from lib/private/preview/movies.php)22
-rw-r--r--lib/private/share/share.php27
-rw-r--r--lib/private/urlgenerator.php12
-rw-r--r--lib/private/util.php2
-rw-r--r--lib/public/appframework/iapi.php1
-rw-r--r--lib/public/constants.php28
-rw-r--r--lib/public/files/fileinfo.php12
-rw-r--r--lib/public/files/node.php10
-rw-r--r--lib/public/iavatar.php6
-rw-r--r--lib/public/iurlgenerator.php8
-rw-r--r--lib/public/share.php7
-rw-r--r--lib/public/template.php2
-rw-r--r--lib/public/user.php3
-rw-r--r--lib/public/util.php4
-rw-r--r--settings/admin.php18
-rw-r--r--settings/l10n/cs_CZ.js1
-rw-r--r--settings/l10n/cs_CZ.json1
-rw-r--r--settings/l10n/da.js1
-rw-r--r--settings/l10n/da.json1
-rw-r--r--settings/l10n/de.js1
-rw-r--r--settings/l10n/de.json1
-rw-r--r--settings/l10n/de_DE.js1
-rw-r--r--settings/l10n/de_DE.json1
-rw-r--r--settings/l10n/en_GB.js1
-rw-r--r--settings/l10n/en_GB.json1
-rw-r--r--settings/l10n/es.js1
-rw-r--r--settings/l10n/es.json1
-rw-r--r--settings/l10n/fi_FI.js1
-rw-r--r--settings/l10n/fi_FI.json1
-rw-r--r--settings/l10n/fr.js1
-rw-r--r--settings/l10n/fr.json1
-rw-r--r--settings/l10n/it.js1
-rw-r--r--settings/l10n/it.json1
-rw-r--r--settings/l10n/nl.js1
-rw-r--r--settings/l10n/nl.json1
-rw-r--r--settings/l10n/pt_BR.js1
-rw-r--r--settings/l10n/pt_BR.json1
-rw-r--r--settings/l10n/ru.js2
-rw-r--r--settings/l10n/ru.json2
-rw-r--r--settings/l10n/sl.js2
-rw-r--r--settings/l10n/sl.json2
-rw-r--r--settings/l10n/sq.js25
-rw-r--r--settings/l10n/sq.json25
-rw-r--r--settings/l10n/tr.js3
-rw-r--r--settings/l10n/tr.json3
-rw-r--r--tests/data/app/expected-info.json19
-rw-r--r--tests/data/app/invalid-info.xml22
-rw-r--r--tests/data/app/valid-info.xml22
-rw-r--r--tests/lib/app/infoparser.php53
-rw-r--r--tests/lib/appframework/routing/RoutingTest.php15
-rw-r--r--tests/lib/connector/sabre/file.php14
-rw-r--r--tests/lib/connector/sabre/node.php18
-rw-r--r--tests/lib/db/mdb2schemareader.php4
-rw-r--r--tests/lib/files/node/file.php28
-rw-r--r--tests/lib/files/node/folder.php14
-rw-r--r--tests/lib/files/node/node.php6
-rw-r--r--tests/lib/httphelper.php4
-rw-r--r--tests/lib/migrate.php98
-rw-r--r--tests/lib/share/share.php184
-rw-r--r--tests/lib/tags.php2
-rw-r--r--tests/lib/tempmanager.php4
-rw-r--r--tests/lib/testcase.php116
-rw-r--r--tests/lib/updater.php4
-rw-r--r--tests/phpunit-autotest.xml5
-rw-r--r--tests/preseed-config.php33
-rw-r--r--tests/testcleanuplistener.php176
157 files changed, 1350 insertions, 1769 deletions
diff --git a/.gitignore b/.gitignore
index c0d44301d57..93bacf9b07e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -92,6 +92,12 @@ nbproject
/build/jsdocs/
/npm-debug.log
+# puphpet
+puphpet
+
+# vagrant
+.vagrant
+Vagrantfile
# Tests - auto-generated files
/data-autotest
diff --git a/apps/files/ajax/upload.php b/apps/files/ajax/upload.php
index b960e02ced7..eb99d0644f7 100644
--- a/apps/files/ajax/upload.php
+++ b/apps/files/ajax/upload.php
@@ -1,5 +1,7 @@
<?php
+\OC::$server->getSession()->close();
+
// Firefox and Konqueror tries to download application/json for me. --Arthur
OCP\JSON::setContentTypeHeader('text/plain');
@@ -7,7 +9,7 @@ OCP\JSON::setContentTypeHeader('text/plain');
// If not, check the login.
// If no token is sent along, rely on login only
-$allowedPermissions = OCP\PERMISSION_ALL;
+$allowedPermissions = \OCP\Constants::PERMISSION_ALL;
$errorCode = null;
$l = \OC::$server->getL10N('files');
@@ -27,7 +29,7 @@ if (empty($_POST['dirToken'])) {
\OC_User::setIncognitoMode(true);
// return only read permissions for public upload
- $allowedPermissions = OCP\PERMISSION_READ;
+ $allowedPermissions = \OCP\Constants::PERMISSION_READ;
$publicDirectory = !empty($_POST['subdir']) ? $_POST['subdir'] : '/';
$linkItem = OCP\Share::getShareByToken($_POST['dirToken']);
@@ -36,7 +38,7 @@ if (empty($_POST['dirToken'])) {
die();
}
- if (!($linkItem['permissions'] & OCP\PERMISSION_CREATE)) {
+ if (!($linkItem['permissions'] & \OCP\Constants::PERMISSION_CREATE)) {
OCP\JSON::checkLoggedIn();
} else {
// resolve reshares
@@ -64,13 +66,7 @@ if (empty($_POST['dirToken'])) {
}
}
-
OCP\JSON::callCheck();
-if (!\OCP\App::isEnabled('files_encryption')) {
- // encryption app need to create keys later, so can't close too early
- \OC::$server->getSession()->close();
-}
-
// get array with current storage stats (e.g. max file size)
$storageStats = \OCA\Files\Helper::buildFileStorageStatistics($dir);
diff --git a/apps/files/l10n/ca.js b/apps/files/l10n/ca.js
index 8a4b5c42d24..0885794ea43 100644
--- a/apps/files/l10n/ca.js
+++ b/apps/files/l10n/ca.js
@@ -6,6 +6,7 @@ OC.L10N.register(
"Unknown error" : "Error desconegut",
"Could not move %s - File with this name already exists" : "No s'ha pogut moure %s - Ja hi ha un fitxer amb aquest nom",
"Could not move %s" : " No s'ha pogut moure %s",
+ "Permission denied" : "Permís denegat",
"File name cannot be empty." : "El nom del fitxer no pot ser buit.",
"\"%s\" is an invalid file name." : "\"%s\" no es un fitxer vàlid.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." : "El nóm no és vàlid, '\\', '/', '<', '>', ':', '\"', '|', '?' i '*' no estan permesos.",
diff --git a/apps/files/l10n/ca.json b/apps/files/l10n/ca.json
index 91e96f5742d..2b767a9aaed 100644
--- a/apps/files/l10n/ca.json
+++ b/apps/files/l10n/ca.json
@@ -4,6 +4,7 @@
"Unknown error" : "Error desconegut",
"Could not move %s - File with this name already exists" : "No s'ha pogut moure %s - Ja hi ha un fitxer amb aquest nom",
"Could not move %s" : " No s'ha pogut moure %s",
+ "Permission denied" : "Permís denegat",
"File name cannot be empty." : "El nom del fitxer no pot ser buit.",
"\"%s\" is an invalid file name." : "\"%s\" no es un fitxer vàlid.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." : "El nóm no és vàlid, '\\', '/', '<', '>', ':', '\"', '|', '?' i '*' no estan permesos.",
diff --git a/apps/files_encryption/ajax/updatePrivateKeyPassword.php b/apps/files_encryption/ajax/updatePrivateKeyPassword.php
index 0f182e93831..fa5e279b21b 100644
--- a/apps/files_encryption/ajax/updatePrivateKeyPassword.php
+++ b/apps/files_encryption/ajax/updatePrivateKeyPassword.php
@@ -26,9 +26,10 @@ $newPassword = $_POST['newPassword'];
$view = new \OC\Files\View('/');
$session = new \OCA\Encryption\Session($view);
$user = \OCP\User::getUser();
+$loginName = \OC::$server->getUserSession()->getLoginName();
// check new password
-$passwordCorrect = \OCP\User::checkPassword($user, $newPassword);
+$passwordCorrect = \OCP\User::checkPassword($loginName, $newPassword);
if ($passwordCorrect !== false) {
diff --git a/apps/files_encryption/l10n/sq.js b/apps/files_encryption/l10n/sq.js
index f3c5d10cf0a..ffab720cfda 100644
--- a/apps/files_encryption/l10n/sq.js
+++ b/apps/files_encryption/l10n/sq.js
@@ -2,6 +2,7 @@ OC.L10N.register(
"files_encryption",
{
"Unknown error" : "Gabim panjohur",
- "Encryption" : "Kodifikimi"
+ "Encryption" : "Kodifikimi",
+ "Enabled" : "Aktivizuar"
},
"nplurals=2; plural=(n != 1);");
diff --git a/apps/files_encryption/l10n/sq.json b/apps/files_encryption/l10n/sq.json
index b4fe571e7e0..dee4c42e547 100644
--- a/apps/files_encryption/l10n/sq.json
+++ b/apps/files_encryption/l10n/sq.json
@@ -1,5 +1,6 @@
{ "translations": {
"Unknown error" : "Gabim panjohur",
- "Encryption" : "Kodifikimi"
+ "Encryption" : "Kodifikimi",
+ "Enabled" : "Aktivizuar"
},"pluralForm" :"nplurals=2; plural=(n != 1);"
} \ No newline at end of file
diff --git a/apps/files_encryption/lib/proxy.php b/apps/files_encryption/lib/proxy.php
index 55f2df783c4..a358a46a6e7 100644
--- a/apps/files_encryption/lib/proxy.php
+++ b/apps/files_encryption/lib/proxy.php
@@ -91,7 +91,6 @@ class Proxy extends \OC_FileProxy {
private function shouldEncrypt($path, $mode = 'w') {
$userId = Helper::getUser($path);
- $session = new Session(new \OC\Files\View());
// don't call the crypt stream wrapper, if...
if (
diff --git a/apps/files_encryption/lib/session.php b/apps/files_encryption/lib/session.php
index 7bd4fd02421..132748b6ea5 100644
--- a/apps/files_encryption/lib/session.php
+++ b/apps/files_encryption/lib/session.php
@@ -29,6 +29,7 @@ namespace OCA\Encryption;
class Session {
private $view;
+ private static $publicShareKey = false;
const NOT_INITIALIZED = '0';
const INIT_EXECUTED = '1';
@@ -92,7 +93,7 @@ class Session {
}
- if (\OCA\Encryption\Helper::isPublicAccess()) {
+ if (\OCA\Encryption\Helper::isPublicAccess() && !self::getPublicSharePrivateKey()) {
// Disable encryption proxy to prevent recursive calls
$proxyStatus = \OC_FileProxy::$enabled;
\OC_FileProxy::$enabled = false;
@@ -100,9 +101,7 @@ class Session {
$encryptedKey = $this->view->file_get_contents(
'/owncloud_private_key/' . $publicShareKeyId . '.private.key');
$privateKey = Crypt::decryptPrivateKey($encryptedKey, '');
- $this->setPublicSharePrivateKey($privateKey);
-
- $this->setInitialized(\OCA\Encryption\Session::INIT_SUCCESSFUL);
+ self::setPublicSharePrivateKey($privateKey);
\OC_FileProxy::$enabled = $proxyStatus;
}
@@ -127,8 +126,8 @@ class Session {
* remove keys from session
*/
public function removeKeys() {
- \OC::$session->remove('publicSharePrivateKey');
- \OC::$session->remove('privateKey');
+ \OC::$server->getSession()->remove('publicSharePrivateKey');
+ \OC::$server->getSession()->remove('privateKey');
}
/**
@@ -164,6 +163,8 @@ class Session {
public function getInitialized() {
if (!is_null(\OC::$server->getSession()->get('encryptionInitialized'))) {
return \OC::$server->getSession()->get('encryptionInitialized');
+ } else if (\OCA\Encryption\Helper::isPublicAccess() && self::getPublicSharePrivateKey()) {
+ return self::INIT_SUCCESSFUL;
} else {
return self::NOT_INITIALIZED;
}
@@ -177,7 +178,7 @@ class Session {
public function getPrivateKey() {
// return the public share private key if this is a public access
if (\OCA\Encryption\Helper::isPublicAccess()) {
- return $this->getPublicSharePrivateKey();
+ return self::getPublicSharePrivateKey();
} else {
if (!is_null(\OC::$server->getSession()->get('privateKey'))) {
return \OC::$server->getSession()->get('privateKey');
@@ -192,12 +193,9 @@ class Session {
* @param string $privateKey
* @return bool
*/
- public function setPublicSharePrivateKey($privateKey) {
-
- \OC::$server->getSession()->set('publicSharePrivateKey', $privateKey);
-
+ private static function setPublicSharePrivateKey($privateKey) {
+ self::$publicShareKey = $privateKey;
return true;
-
}
/**
@@ -205,13 +203,8 @@ class Session {
* @return string $privateKey
*
*/
- public function getPublicSharePrivateKey() {
-
- if (!is_null(\OC::$server->getSession()->get('publicSharePrivateKey'))) {
- return \OC::$server->getSession()->get('publicSharePrivateKey');
- } else {
- return false;
- }
+ private static function getPublicSharePrivateKey() {
+ return self::$publicShareKey;
}
}
diff --git a/apps/files_encryption/tests/hooks.php b/apps/files_encryption/tests/hooks.php
index 9ea84cc94c2..4b8be0c7c1c 100644
--- a/apps/files_encryption/tests/hooks.php
+++ b/apps/files_encryption/tests/hooks.php
@@ -256,7 +256,7 @@ class Test_Encryption_Hooks extends \OCA\Files_Encryption\Tests\TestCase {
$this->assertTrue($fileInfo instanceof \OC\Files\FileInfo);
// share the file with user2
- \OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, self::TEST_ENCRYPTION_HOOKS_USER2, OCP\PERMISSION_ALL);
+ \OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, self::TEST_ENCRYPTION_HOOKS_USER2, \OCP\Constants::PERMISSION_ALL);
// check if new share key exists
$this->assertTrue($this->rootView->file_exists(
diff --git a/apps/files_encryption/tests/share.php b/apps/files_encryption/tests/share.php
index 20ee2cc7064..24b828433d0 100755
--- a/apps/files_encryption/tests/share.php
+++ b/apps/files_encryption/tests/share.php
@@ -171,7 +171,7 @@ class Test_Encryption_Share extends \OCA\Files_Encryption\Tests\TestCase {
\OC_FileProxy::$enabled = $proxyStatus;
// share the file
- \OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2, OCP\PERMISSION_ALL);
+ \OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2, \OCP\Constants::PERMISSION_ALL);
// login as admin
self::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1);
@@ -232,7 +232,7 @@ class Test_Encryption_Share extends \OCA\Files_Encryption\Tests\TestCase {
'/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2 . '/files/' . $this->filename);
// share the file with user3
- \OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER3, OCP\PERMISSION_ALL);
+ \OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER3, \OCP\Constants::PERMISSION_ALL);
// login as admin
self::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1);
@@ -328,7 +328,7 @@ class Test_Encryption_Share extends \OCA\Files_Encryption\Tests\TestCase {
\OC_FileProxy::$enabled = $proxyStatus;
// share the folder with user1
- \OCP\Share::shareItem('folder', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2, OCP\PERMISSION_ALL);
+ \OCP\Share::shareItem('folder', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2, \OCP\Constants::PERMISSION_ALL);
// login as admin
self::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1);
@@ -406,7 +406,7 @@ class Test_Encryption_Share extends \OCA\Files_Encryption\Tests\TestCase {
\OC_FileProxy::$enabled = $proxyStatus;
// share the file with user3
- \OCP\Share::shareItem('folder', $fileInfoSubFolder['fileid'], \OCP\Share::SHARE_TYPE_USER, \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER3, OCP\PERMISSION_ALL);
+ \OCP\Share::shareItem('folder', $fileInfoSubFolder['fileid'], \OCP\Share::SHARE_TYPE_USER, \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER3, \OCP\Constants::PERMISSION_ALL);
// login as admin
self::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1);
@@ -437,7 +437,7 @@ class Test_Encryption_Share extends \OCA\Files_Encryption\Tests\TestCase {
$this->assertTrue($fileInfo instanceof \OC\Files\FileInfo);
// share the file with user3
- \OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER4, OCP\PERMISSION_ALL);
+ \OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER4, \OCP\Constants::PERMISSION_ALL);
// login as admin
self::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1);
@@ -539,7 +539,7 @@ class Test_Encryption_Share extends \OCA\Files_Encryption\Tests\TestCase {
\OC_FileProxy::$enabled = $proxyStatus;
// share the file
- \OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_LINK, false, OCP\PERMISSION_ALL);
+ \OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_LINK, false, \OCP\Constants::PERMISSION_ALL);
// login as admin
self::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1);
@@ -617,7 +617,7 @@ class Test_Encryption_Share extends \OCA\Files_Encryption\Tests\TestCase {
\OC_FileProxy::$enabled = $proxyStatus;
// share the file
- \OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_GROUP, \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_GROUP1, OCP\PERMISSION_ALL);
+ \OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_GROUP, \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_GROUP1, \OCP\Constants::PERMISSION_ALL);
// login as admin
self::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1);
@@ -923,7 +923,7 @@ class Test_Encryption_Share extends \OCA\Files_Encryption\Tests\TestCase {
// share the file
try {
- \OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_GROUP, \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_GROUP1, OCP\PERMISSION_ALL);
+ \OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_GROUP, \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_GROUP1, \OCP\Constants::PERMISSION_ALL);
} catch (Exception $e) {
$this->assertEquals(0, strpos($e->getMessage(), "Following users are not set up for encryption"));
}
@@ -991,7 +991,7 @@ class Test_Encryption_Share extends \OCA\Files_Encryption\Tests\TestCase {
$this->assertTrue($fileInfo instanceof \OC\Files\FileInfo);
// share the file
- \OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2, OCP\PERMISSION_ALL);
+ \OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2, \OCP\Constants::PERMISSION_ALL);
// check if share key for user2 exists
$this->assertTrue($this->view->file_exists(
@@ -1059,7 +1059,7 @@ class Test_Encryption_Share extends \OCA\Files_Encryption\Tests\TestCase {
$this->assertTrue($fileInfo instanceof \OC\Files\FileInfo);
// share the folder
- \OCP\Share::shareItem('folder', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2, OCP\PERMISSION_ALL);
+ \OCP\Share::shareItem('folder', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2, \OCP\Constants::PERMISSION_ALL);
\OC\Files\Filesystem::rename($folder, $newFolder);
@@ -1117,7 +1117,7 @@ class Test_Encryption_Share extends \OCA\Files_Encryption\Tests\TestCase {
$this->assertTrue($fileInfo instanceof \OC\Files\FileInfo);
// share the folder
- \OCP\Share::shareItem('folder', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2, OCP\PERMISSION_ALL);
+ \OCP\Share::shareItem('folder', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2, \OCP\Constants::PERMISSION_ALL);
// check that the share keys exist
$this->assertTrue($view->file_exists('files_encryption/share-keys' . $folder . '/' . $filename . '.' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '.shareKey'));
diff --git a/apps/files_external/l10n/fr.js b/apps/files_external/l10n/fr.js
index 7f827ec6fd4..5885af24199 100644
--- a/apps/files_external/l10n/fr.js
+++ b/apps/files_external/l10n/fr.js
@@ -50,7 +50,7 @@ OC.L10N.register(
"Error configuring Google Drive storage" : "Erreur lors de la configuration du support de stockage Google Drive",
"Personal" : "Personnel",
"System" : "Système",
- "All users. Type to select user or group." : "Tous les utilisateurs. Commencez à saisir pour sélectionner un utilisateur ou un groupe.",
+ "All users. Type to select user or group." : "Tous les utilisateurs. Cliquez ici pour restreindre.",
"(group)" : "(groupe)",
"Saved" : "Sauvegarder",
"<b>Note:</b> " : "<b>Attention :</b>",
diff --git a/apps/files_external/l10n/fr.json b/apps/files_external/l10n/fr.json
index e8a9e299c24..e1e2b2eccc4 100644
--- a/apps/files_external/l10n/fr.json
+++ b/apps/files_external/l10n/fr.json
@@ -48,7 +48,7 @@
"Error configuring Google Drive storage" : "Erreur lors de la configuration du support de stockage Google Drive",
"Personal" : "Personnel",
"System" : "Système",
- "All users. Type to select user or group." : "Tous les utilisateurs. Commencez à saisir pour sélectionner un utilisateur ou un groupe.",
+ "All users. Type to select user or group." : "Tous les utilisateurs. Cliquez ici pour restreindre.",
"(group)" : "(groupe)",
"Saved" : "Sauvegarder",
"<b>Note:</b> " : "<b>Attention :</b>",
diff --git a/apps/files_external/lib/api.php b/apps/files_external/lib/api.php
index 81ebd4e886a..3b5e0e1759a 100644
--- a/apps/files_external/lib/api.php
+++ b/apps/files_external/lib/api.php
@@ -45,10 +45,10 @@ class Api {
$isSystemMount = !$mountConfig['personal'];
- $permissions = \OCP\PERMISSION_READ;
+ $permissions = \OCP\Constants::PERMISSION_READ;
// personal mounts can be deleted
if (!$isSystemMount) {
- $permissions |= \OCP\PERMISSION_DELETE;
+ $permissions |= \OCP\Constants::PERMISSION_DELETE;
}
$entry = array(
diff --git a/apps/files_sharing/ajax/list.php b/apps/files_sharing/ajax/list.php
index 7e2e54a1bd9..073c86365be 100644
--- a/apps/files_sharing/ajax/list.php
+++ b/apps/files_sharing/ajax/list.php
@@ -65,7 +65,7 @@ $formattedFiles = array();
foreach ($files as $file) {
$entry = \OCA\Files\Helper::formatFileInfo($file);
unset($entry['directory']); // for now
- $entry['permissions'] = \OCP\PERMISSION_READ;
+ $entry['permissions'] = \OCP\Constants::PERMISSION_READ;
$formattedFiles[] = $entry;
}
@@ -78,7 +78,7 @@ $permissions = $linkItem['permissions'];
// if globally disabled
if (\OC::$server->getAppConfig()->getValue('core', 'shareapi_allow_public_upload', 'yes') === 'no') {
// only allow reading
- $permissions = \OCP\PERMISSION_READ;
+ $permissions = \OCP\Constants::PERMISSION_READ;
}
$data['permissions'] = $permissions;
diff --git a/apps/files_sharing/ajax/shareinfo.php b/apps/files_sharing/ajax/shareinfo.php
index e87b0779e8d..f196a67a9dd 100644
--- a/apps/files_sharing/ajax/shareinfo.php
+++ b/apps/files_sharing/ajax/shareinfo.php
@@ -31,7 +31,7 @@ $linkItem = $data['linkItem'];
// Load the files
$path = $data['realPath'];
-$isWritable = $linkItem['permissions'] & (\OCP\PERMISSION_UPDATE | \OCP\PERMISSION_CREATE);
+$isWritable = $linkItem['permissions'] & (\OCP\Constants::PERMISSION_UPDATE | \OCP\Constants::PERMISSION_CREATE);
if (!$isWritable) {
\OC\Files\Filesystem::addStorageWrapper('readonly', function ($mountPoint, $storage) {
return new \OCA\Files_Sharing\ReadOnlyWrapper(array('storage' => $storage));
diff --git a/apps/files_sharing/l10n/ru.js b/apps/files_sharing/l10n/ru.js
index f6a24253590..f8a73755cd1 100644
--- a/apps/files_sharing/l10n/ru.js
+++ b/apps/files_sharing/l10n/ru.js
@@ -33,6 +33,9 @@ OC.L10N.register(
"Add to your ownCloud" : "Добавить в свой ownCloud",
"Download" : "Скачать",
"Download %s" : "Скачать %s",
- "Direct link" : "Прямая ссылка"
+ "Direct link" : "Прямая ссылка",
+ "Server-to-Server Sharing" : "Общий доступ Сервер-Сервер",
+ "Allow users on this server to send shares to other servers" : "Разрешить пользователям на этом сервере отправлять файлы на другие сервера",
+ "Allow users on this server to receive shares from other servers" : "Разрешить пользователям на том сервере получать файлы с других серверов"
},
"nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);");
diff --git a/apps/files_sharing/l10n/ru.json b/apps/files_sharing/l10n/ru.json
index 9eaf51586d4..ab20e0c3e92 100644
--- a/apps/files_sharing/l10n/ru.json
+++ b/apps/files_sharing/l10n/ru.json
@@ -31,6 +31,9 @@
"Add to your ownCloud" : "Добавить в свой ownCloud",
"Download" : "Скачать",
"Download %s" : "Скачать %s",
- "Direct link" : "Прямая ссылка"
+ "Direct link" : "Прямая ссылка",
+ "Server-to-Server Sharing" : "Общий доступ Сервер-Сервер",
+ "Allow users on this server to send shares to other servers" : "Разрешить пользователям на этом сервере отправлять файлы на другие сервера",
+ "Allow users on this server to receive shares from other servers" : "Разрешить пользователям на том сервере получать файлы с других серверов"
},"pluralForm" :"nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"
} \ No newline at end of file
diff --git a/apps/files_sharing/lib/controllers/sharecontroller.php b/apps/files_sharing/lib/controllers/sharecontroller.php
index 552d9164344..0a0594ed8ff 100644
--- a/apps/files_sharing/lib/controllers/sharecontroller.php
+++ b/apps/files_sharing/lib/controllers/sharecontroller.php
@@ -23,7 +23,6 @@ use OCP\AppFramework\Controller;
use OCP\IRequest;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Http\RedirectResponse;
-use OCP\AppFramework\IApi;
use OC\URLGenerator;
use OC\AppConfig;
use OCP\ILogger;
@@ -84,7 +83,6 @@ class ShareController extends Controller {
* @NoCSRFRequired
*
* @param string $token
- *
* @return TemplateResponse|RedirectResponse
*/
public function showAuthenticate($token) {
@@ -127,7 +125,6 @@ class ShareController extends Controller {
*
* @param string $token
* @param string $path
- *
* @return TemplateResponse
*/
public function showShare($token, $path = '') {
@@ -161,7 +158,6 @@ class ShareController extends Controller {
$originalSharePath .= $path;
}
- $dir = dirname($originalSharePath);
$file = basename($originalSharePath);
$shareTmpl = array();
@@ -173,7 +169,7 @@ class ShareController extends Controller {
$shareTmpl['sharingToken'] = $token;
$shareTmpl['server2serversharing'] = Helper::isOutgoingServer2serverShareEnabled();
$shareTmpl['protected'] = isset($linkItem['share_with']) ? 'true' : 'false';
- $shareTmpl['dir'] = $dir;
+ $shareTmpl['dir'] = '';
$shareTmpl['fileSize'] = \OCP\Util::humanFileSize(\OC\Files\Filesystem::filesize($originalSharePath));
// Show file list
@@ -186,7 +182,7 @@ class ShareController extends Controller {
$folder = new Template('files', 'list', '');
$folder->assign('dir', $getPath);
$folder->assign('dirToken', $linkItem['token']);
- $folder->assign('permissions', OCP\PERMISSION_READ);
+ $folder->assign('permissions', \OCP\Constants::PERMISSION_READ);
$folder->assign('isPublic', true);
$folder->assign('publicUploadEnabled', 'no');
$folder->assign('files', $files);
@@ -207,6 +203,7 @@ class ShareController extends Controller {
/**
* @PublicPage
* @NoCSRFRequired
+ *
* @param string $token
* @param string $files
* @param string $path
@@ -240,7 +237,7 @@ class ShareController extends Controller {
}
// FIXME: The exit is required here because otherwise the AppFramework is trying to add headers as well
- // after dispatching the request which results in a "Cannot modify header information" notice.
+ // after dispatching the request which results in a "Cannot modify header information" notice.
OC_Files::get($originalSharePath, $files_list, $_SERVER['REQUEST_METHOD'] == 'HEAD');
exit();
} else {
diff --git a/apps/files_sharing/lib/readonlycache.php b/apps/files_sharing/lib/readonlycache.php
index f129ca49433..6dd3b9cf61d 100644
--- a/apps/files_sharing/lib/readonlycache.php
+++ b/apps/files_sharing/lib/readonlycache.php
@@ -13,14 +13,14 @@ use OC\Files\Cache\Cache;
class ReadOnlyCache extends Cache {
public function get($path) {
$data = parent::get($path);
- $data['permissions'] &= (\OCP\PERMISSION_READ | \OCP\PERMISSION_SHARE);
+ $data['permissions'] &= (\OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_SHARE);
return $data;
}
public function getFolderContents($path) {
$content = parent::getFolderContents($path);
foreach ($content as &$data) {
- $data['permissions'] &= (\OCP\PERMISSION_READ | \OCP\PERMISSION_SHARE);
+ $data['permissions'] &= (\OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_SHARE);
}
return $content;
}
diff --git a/apps/files_sharing/lib/readonlywrapper.php b/apps/files_sharing/lib/readonlywrapper.php
index 45ed3fd68bb..58a5695aff8 100644
--- a/apps/files_sharing/lib/readonlywrapper.php
+++ b/apps/files_sharing/lib/readonlywrapper.php
@@ -24,7 +24,7 @@ class ReadOnlyWrapper extends Wrapper {
}
public function getPermissions($path) {
- return $this->storage->getPermissions($path) & (\OCP\PERMISSION_READ | \OCP\PERMISSION_SHARE);
+ return $this->storage->getPermissions($path) & (\OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_SHARE);
}
public function rename($path1, $path2) {
diff --git a/apps/files_sharing/lib/share/folder.php b/apps/files_sharing/lib/share/folder.php
index 2671f5738b7..f86e9624432 100644
--- a/apps/files_sharing/lib/share/folder.php
+++ b/apps/files_sharing/lib/share/folder.php
@@ -26,13 +26,14 @@ class OC_Share_Backend_Folder extends OC_Share_Backend_File implements OCP\Share
*
* @param int $itemSource item source ID
* @param string $shareWith with whom should the item be shared
+ * @param string $owner owner of the item
* @return array with shares
*/
- public function getParents($itemSource, $shareWith = null) {
+ public function getParents($itemSource, $shareWith = null, $owner = null) {
$result = array();
$parent = $this->getParentId($itemSource);
while ($parent) {
- $shares = \OCP\Share::getItemSharedWithUser('folder', $parent, $shareWith);
+ $shares = \OCP\Share::getItemSharedWithUser('folder', $parent, $shareWith, $owner);
if ($shares) {
foreach ($shares as $share) {
$name = substr($share['path'], strrpos($share['path'], '/') + 1);
diff --git a/apps/files_sharing/lib/sharedstorage.php b/apps/files_sharing/lib/sharedstorage.php
index 19ee6085e47..1ac57053e25 100644
--- a/apps/files_sharing/lib/sharedstorage.php
+++ b/apps/files_sharing/lib/sharedstorage.php
@@ -67,7 +67,7 @@ class Shared extends \OC\Files\Storage\Common implements ISharedStorage {
if ($source) {
$source['path'] .= '.part';
// All partial files have delete permission
- $source['permissions'] |= \OCP\PERMISSION_DELETE;
+ $source['permissions'] |= \OCP\Constants::PERMISSION_DELETE;
}
} else {
$source = \OC_Share_Backend_File::getSource($target, $this->getMountPoint(), $this->getItemType());
@@ -109,11 +109,11 @@ class Shared extends \OC\Files\Storage\Common implements ISharedStorage {
$permissions = $this->share['permissions'];
// part files and the mount point always have delete permissions
if ($target === '' || pathinfo($target, PATHINFO_EXTENSION) === 'part') {
- $permissions |= \OCP\PERMISSION_DELETE;
+ $permissions |= \OCP\Constants::PERMISSION_DELETE;
}
if (\OC_Util::isSharingDisabledForUser()) {
- $permissions &= ~\OCP\PERMISSION_SHARE;
+ $permissions &= ~\OCP\Constants::PERMISSION_SHARE;
}
return $permissions;
@@ -197,7 +197,7 @@ class Shared extends \OC\Files\Storage\Common implements ISharedStorage {
}
public function isCreatable($path) {
- return ($this->getPermissions($path) & \OCP\PERMISSION_CREATE);
+ return ($this->getPermissions($path) & \OCP\Constants::PERMISSION_CREATE);
}
public function isReadable($path) {
@@ -205,18 +205,18 @@ class Shared extends \OC\Files\Storage\Common implements ISharedStorage {
}
public function isUpdatable($path) {
- return ($this->getPermissions($path) & \OCP\PERMISSION_UPDATE);
+ return ($this->getPermissions($path) & \OCP\Constants::PERMISSION_UPDATE);
}
public function isDeletable($path) {
- return ($this->getPermissions($path) & \OCP\PERMISSION_DELETE);
+ return ($this->getPermissions($path) & \OCP\Constants::PERMISSION_DELETE);
}
public function isSharable($path) {
if (\OCP\Util::isSharingDisabledForUser()) {
return false;
}
- return ($this->getPermissions($path) & \OCP\PERMISSION_SHARE);
+ return ($this->getPermissions($path) & \OCP\Constants::PERMISSION_SHARE);
}
public function file_exists($path) {
diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php
index d9b8f0f4f30..d9d14f67c33 100644
--- a/apps/files_sharing/public.php
+++ b/apps/files_sharing/public.php
@@ -12,6 +12,6 @@
$urlGenerator = new \OC\URLGenerator(\OC::$server->getConfig());
$token = isset($_GET['t']) ? $_GET['t'] : '';
-$route = isset($_GET['download']) ? 'files_sharing.sharecontroller.downloadshare' : 'files_sharing.sharecontroller.showshare';
+$route = isset($_GET['download']) ? 'files_sharing.sharecontroller.downloadShare' : 'files_sharing.sharecontroller.showShare';
OC_Response::redirect($urlGenerator->linkToRoute($route, array('token' => $token)));
diff --git a/apps/files_sharing/publicwebdav.php b/apps/files_sharing/publicwebdav.php
index 03e43967a40..2c7ccf8d92c 100644
--- a/apps/files_sharing/publicwebdav.php
+++ b/apps/files_sharing/publicwebdav.php
@@ -41,7 +41,7 @@ $server->addPlugin(new OC_Connector_Sabre_ExceptionLoggerPlugin('webdav'));
$server->subscribeEvent('beforeMethod', function () use ($server, $objectTree, $authBackend) {
$share = $authBackend->getShare();
$owner = $share['uid_owner'];
- $isWritable = $share['permissions'] & (\OCP\PERMISSION_UPDATE | \OCP\PERMISSION_CREATE);
+ $isWritable = $share['permissions'] & (\OCP\Constants::PERMISSION_UPDATE | \OCP\Constants::PERMISSION_CREATE);
$fileId = $share['file_source'];
if (!$isWritable) {
diff --git a/apps/files_sharing/tests/api.php b/apps/files_sharing/tests/api.php
index e550dcc27db..1259197423b 100644
--- a/apps/files_sharing/tests/api.php
+++ b/apps/files_sharing/tests/api.php
@@ -788,7 +788,7 @@ class Test_Files_Sharing_Api extends TestCase {
$fileInfo = $this->view->getFileInfo($this->filename);
$result = \OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER,
- \Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER2, \OCP\PERMISSION_ALL);
+ \Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER2, \OCP\Constants::PERMISSION_ALL);
// share was successful?
$this->assertTrue($result);
@@ -822,7 +822,7 @@ class Test_Files_Sharing_Api extends TestCase {
// check if share have expected permissions, single shared files never have
// delete permissions
- $this->assertEquals(\OCP\PERMISSION_ALL & ~\OCP\PERMISSION_DELETE, $userShare['permissions']);
+ $this->assertEquals(\OCP\Constants::PERMISSION_ALL & ~\OCP\Constants::PERMISSION_DELETE, $userShare['permissions']);
// update permissions
@@ -1228,7 +1228,7 @@ class Test_Files_Sharing_Api extends TestCase {
$info = OC\Files\Filesystem::getFileInfo($this->filename);
$this->assertTrue($info instanceof \OC\Files\FileInfo);
- $result = \OCP\Share::shareItem('file', $info->getId(), \OCP\Share::SHARE_TYPE_LINK, null, \OCP\PERMISSION_READ);
+ $result = \OCP\Share::shareItem('file', $info->getId(), \OCP\Share::SHARE_TYPE_LINK, null, \OCP\Constants::PERMISSION_READ);
$this->assertTrue(is_string($result));
$result = \OCP\Share::shareItem('file', $info->getId(), \OCP\Share::SHARE_TYPE_USER, \Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER2, 31);
diff --git a/apps/files_sharing/tests/cache.php b/apps/files_sharing/tests/cache.php
index b6a44f464f9..aec1983bad3 100644
--- a/apps/files_sharing/tests/cache.php
+++ b/apps/files_sharing/tests/cache.php
@@ -348,7 +348,7 @@ class Test_Files_Sharing_Cache extends TestCase {
self::loginHelper(self::TEST_FILES_SHARING_API_USER1);
\OC\Files\Filesystem::file_put_contents('test.txt', 'foo');
$info = \OC\Files\Filesystem::getFileInfo('test.txt');
- \OCP\Share::shareItem('file', $info->getId(), \OCP\Share::SHARE_TYPE_USER, self::TEST_FILES_SHARING_API_USER2, \OCP\PERMISSION_ALL);
+ \OCP\Share::shareItem('file', $info->getId(), \OCP\Share::SHARE_TYPE_USER, self::TEST_FILES_SHARING_API_USER2, \OCP\Constants::PERMISSION_ALL);
\OC_Util::tearDownFS();
self::loginHelper(self::TEST_FILES_SHARING_API_USER2);
@@ -369,7 +369,7 @@ class Test_Files_Sharing_Cache extends TestCase {
\OC\Files\Filesystem::touch('foo/bar/test.txt');
$folderInfo = \OC\Files\Filesystem::getFileInfo('foo');
$fileInfo = \OC\Files\Filesystem::getFileInfo('foo/bar/test.txt');
- \OCP\Share::shareItem('folder', $folderInfo->getId(), \OCP\Share::SHARE_TYPE_USER, self::TEST_FILES_SHARING_API_USER2, \OCP\PERMISSION_ALL);
+ \OCP\Share::shareItem('folder', $folderInfo->getId(), \OCP\Share::SHARE_TYPE_USER, self::TEST_FILES_SHARING_API_USER2, \OCP\Constants::PERMISSION_ALL);
\OC_Util::tearDownFS();
self::loginHelper(self::TEST_FILES_SHARING_API_USER2);
diff --git a/apps/files_sharing/tests/controller/sharecontroller.php b/apps/files_sharing/tests/controller/sharecontroller.php
index 8dcb2475564..f13e5b2e497 100644
--- a/apps/files_sharing/tests/controller/sharecontroller.php
+++ b/apps/files_sharing/tests/controller/sharecontroller.php
@@ -153,7 +153,7 @@ class ShareControllerTest extends \PHPUnit_Framework_TestCase {
'sharingToken' => $this->token,
'server2serversharing' => true,
'protected' => 'true',
- 'dir' => '/',
+ 'dir' => '',
'downloadURL' => null,
'fileSize' => '33 B'
);
diff --git a/apps/files_sharing/tests/share.php b/apps/files_sharing/tests/share.php
index 4318d3c510e..f76f92734d0 100644
--- a/apps/files_sharing/tests/share.php
+++ b/apps/files_sharing/tests/share.php
@@ -105,12 +105,12 @@ class Test_Files_Sharing extends OCA\Files_sharing\Tests\TestCase {
$fileinfo = $this->view->getFileInfo($this->filename);
$result = \OCP\Share::shareItem('file', $fileinfo['fileid'], \OCP\Share::SHARE_TYPE_GROUP,
- \Test_Files_Sharing::TEST_FILES_SHARING_API_GROUP1, \OCP\PERMISSION_READ);
+ \Test_Files_Sharing::TEST_FILES_SHARING_API_GROUP1, \OCP\Constants::PERMISSION_READ);
$this->assertTrue($result);
$result = \OCP\Share::shareItem('file', $fileinfo['fileid'], \OCP\Share::SHARE_TYPE_USER,
- \Test_Files_Sharing::TEST_FILES_SHARING_API_USER2, \OCP\PERMISSION_UPDATE);
+ \Test_Files_Sharing::TEST_FILES_SHARING_API_USER2, \OCP\Constants::PERMISSION_UPDATE);
$this->assertTrue($result);
@@ -124,7 +124,7 @@ class Test_Files_Sharing extends OCA\Files_sharing\Tests\TestCase {
$this->assertSame(1, count($result));
$share = reset($result);
- $this->assertSame(\OCP\PERMISSION_READ | \OCP\PERMISSION_UPDATE, $share['permissions']);
+ $this->assertSame(\OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_UPDATE, $share['permissions']);
\OC\Files\Filesystem::rename($this->filename, $this->filename . '-renamed');
@@ -136,7 +136,7 @@ class Test_Files_Sharing extends OCA\Files_sharing\Tests\TestCase {
$this->assertSame(1, count($result));
$share = reset($result);
- $this->assertSame(\OCP\PERMISSION_READ | \OCP\PERMISSION_UPDATE, $share['permissions']);
+ $this->assertSame(\OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_UPDATE, $share['permissions']);
$this->assertSame($this->filename . '-renamed', $share['file_target']);
self::loginHelper(self::TEST_FILES_SHARING_API_USER1);
@@ -157,7 +157,7 @@ class Test_Files_Sharing extends OCA\Files_sharing\Tests\TestCase {
$share = reset($result);
// only the group share permissions should be available now
- $this->assertSame(\OCP\PERMISSION_READ, $share['permissions']);
+ $this->assertSame(\OCP\Constants::PERMISSION_READ, $share['permissions']);
$this->assertSame($this->filename . '-renamed', $share['file_target']);
}
@@ -172,8 +172,8 @@ class Test_Files_Sharing extends OCA\Files_sharing\Tests\TestCase {
$fileinfo = $this->view->getFileInfo($this->filename);
// share the file to group1 (user2 is a member of this group) and explicitely to user2
- \OCP\Share::shareItem('file', $fileinfo['fileid'], \OCP\Share::SHARE_TYPE_GROUP, self::TEST_FILES_SHARING_API_GROUP1, \OCP\PERMISSION_ALL);
- \OCP\Share::shareItem('file', $fileinfo['fileid'], \OCP\Share::SHARE_TYPE_USER, self::TEST_FILES_SHARING_API_USER2, \OCP\PERMISSION_ALL);
+ \OCP\Share::shareItem('file', $fileinfo['fileid'], \OCP\Share::SHARE_TYPE_GROUP, self::TEST_FILES_SHARING_API_GROUP1, \OCP\Constants::PERMISSION_ALL);
+ \OCP\Share::shareItem('file', $fileinfo['fileid'], \OCP\Share::SHARE_TYPE_USER, self::TEST_FILES_SHARING_API_USER2, \OCP\Constants::PERMISSION_ALL);
// user1 should have to shared files
$shares = \OCP\Share::getItemsShared('file');
@@ -203,7 +203,7 @@ class Test_Files_Sharing extends OCA\Files_sharing\Tests\TestCase {
$this->assertSame(1, count($shares));
// user1 shares a gain the file directly to user2
- \OCP\Share::shareItem('file', $fileinfo['fileid'], \OCP\Share::SHARE_TYPE_USER, self::TEST_FILES_SHARING_API_USER2, \OCP\PERMISSION_ALL);
+ \OCP\Share::shareItem('file', $fileinfo['fileid'], \OCP\Share::SHARE_TYPE_USER, self::TEST_FILES_SHARING_API_USER2, \OCP\Constants::PERMISSION_ALL);
// user2 should see again welcome.txt and the shared file
\Test_Files_Sharing::loginHelper(self::TEST_FILES_SHARING_API_USER2);
@@ -271,14 +271,14 @@ class Test_Files_Sharing extends OCA\Files_sharing\Tests\TestCase {
}
function DataProviderTestFileSharePermissions() {
- $permission1 = \OCP\PERMISSION_ALL;
- $permission3 = \OCP\PERMISSION_READ;
- $permission4 = \OCP\PERMISSION_READ | \OCP\PERMISSION_UPDATE;
- $permission5 = \OCP\PERMISSION_READ | \OCP\PERMISSION_DELETE;
- $permission6 = \OCP\PERMISSION_READ | \OCP\PERMISSION_UPDATE | \OCP\PERMISSION_DELETE;
+ $permission1 = \OCP\Constants::PERMISSION_ALL;
+ $permission3 = \OCP\Constants::PERMISSION_READ;
+ $permission4 = \OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_UPDATE;
+ $permission5 = \OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_DELETE;
+ $permission6 = \OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_UPDATE | \OCP\Constants::PERMISSION_DELETE;
return array(
- array($permission1, \OCP\PERMISSION_ALL & ~\OCP\PERMISSION_DELETE),
+ array($permission1, \OCP\Constants::PERMISSION_ALL & ~\OCP\Constants::PERMISSION_DELETE),
array($permission3, $permission3),
array($permission4, $permission4),
array($permission5, $permission3),
diff --git a/apps/files_trashbin/lib/helper.php b/apps/files_trashbin/lib/helper.php
index c2b81e3dbc8..c99662480df 100644
--- a/apps/files_trashbin/lib/helper.php
+++ b/apps/files_trashbin/lib/helper.php
@@ -88,7 +88,7 @@ class Helper
$entry = \OCA\Files\Helper::formatFileInfo($i);
$entry['id'] = $id++;
$entry['etag'] = $entry['mtime']; // add fake etag, it is only needed to identify the preview image
- $entry['permissions'] = \OCP\PERMISSION_READ;
+ $entry['permissions'] = \OCP\Constants::PERMISSION_READ;
if (\OCP\App::isEnabled('files_encryption')) {
$entry['isPreviewAvailable'] = false;
}
diff --git a/apps/files_versions/tests/versions.php b/apps/files_versions/tests/versions.php
index 436863b28dc..6205a6881f0 100644
--- a/apps/files_versions/tests/versions.php
+++ b/apps/files_versions/tests/versions.php
@@ -277,7 +277,7 @@ class Test_Files_Versioning extends \Test\TestCase {
$this->rootView->file_put_contents($v1, 'version1');
$this->rootView->file_put_contents($v2, 'version2');
- \OCP\Share::shareItem('folder', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, self::TEST_VERSIONS_USER2, OCP\PERMISSION_ALL);
+ \OCP\Share::shareItem('folder', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, self::TEST_VERSIONS_USER2, \OCP\Constants::PERMISSION_ALL);
self::loginHelper(self::TEST_VERSIONS_USER2);
@@ -320,7 +320,7 @@ class Test_Files_Versioning extends \Test\TestCase {
$this->rootView->file_put_contents($v1, 'version1');
$this->rootView->file_put_contents($v2, 'version2');
- \OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, self::TEST_VERSIONS_USER2, OCP\PERMISSION_ALL);
+ \OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, self::TEST_VERSIONS_USER2, \OCP\Constants::PERMISSION_ALL);
self::loginHelper(self::TEST_VERSIONS_USER2);
diff --git a/apps/user_ldap/ajax/wizard.php b/apps/user_ldap/ajax/wizard.php
index ef1241b9147..6d7d70c8c5a 100644
--- a/apps/user_ldap/ajax/wizard.php
+++ b/apps/user_ldap/ajax/wizard.php
@@ -62,6 +62,7 @@ switch($action) {
case 'guessPortAndTLS':
case 'guessBaseDN':
case 'detectEmailAttribute':
+ case 'detectUserDisplayNameAttribute':
case 'determineGroupMemberAssoc':
case 'determineUserObjectClasses':
case 'determineGroupObjectClasses':
@@ -115,4 +116,3 @@ switch($action) {
//TODO: return 4xx error
break;
}
-
diff --git a/apps/user_ldap/js/ldapFilter.js b/apps/user_ldap/js/ldapFilter.js
index bb66c1df2ee..0f7d240adac 100644
--- a/apps/user_ldap/js/ldapFilter.js
+++ b/apps/user_ldap/js/ldapFilter.js
@@ -8,6 +8,7 @@ function LdapFilter(target, determineModeCallback) {
this.determineModeCallback = determineModeCallback;
this.foundFeatures = false;
this.activated = false;
+ this.countPending = false;
if( target === 'User' ||
target === 'Login' ||
@@ -25,9 +26,13 @@ LdapFilter.prototype.activate = function() {
this.determineMode();
};
-LdapFilter.prototype.compose = function(callback) {
+LdapFilter.prototype.compose = function(updateCount) {
var action;
+ if(updateCount === true) {
+ this.countPending = updateCount;
+ }
+
if(this.locked) {
this.lazyRunCompose = true;
return false;
@@ -54,22 +59,36 @@ LdapFilter.prototype.compose = function(callback) {
LdapWizard.ajax(param,
function(result) {
- LdapWizard.applyChanges(result);
- filter.updateCount();
- if(filter.target === 'Group') {
- LdapWizard.detectGroupMemberAssoc();
- }
- if(typeof callback !== 'undefined') {
- callback();
- }
+ filter.afterComposeSuccess(result);
},
function () {
+ filter.countPending = false;
console.log('LDAP Wizard: could not compose filter. '+
'Please check owncloud.log');
}
);
};
+/**
+ * this function is triggered after attribute detectors have completed in
+ * LdapWizard
+ */
+LdapFilter.prototype.afterDetectorsRan = function() {
+ this.updateCount();
+};
+
+/**
+ * this function is triggered after LDAP filters have been composed successfully
+ * @param {object} result returned by the ajax call
+ */
+LdapFilter.prototype.afterComposeSuccess = function(result) {
+ LdapWizard.applyChanges(result);
+ if(this.countPending) {
+ this.countPending = false;
+ this.updateCount();
+ }
+};
+
LdapFilter.prototype.determineMode = function() {
var param = 'action=get'+encodeURIComponent(this.target)+'FilterMode'+
'&ldap_serverconfig_chooser='+
@@ -145,10 +164,26 @@ LdapFilter.prototype.findFeatures = function() {
}
};
+/**
+ * this function is triggered before user and group counts are executed
+ * resolving the passed status variable will fire up counting
+ * @param {object} status an instance of $.Deferred
+ */
+LdapFilter.prototype.beforeUpdateCount = function() {
+ var status = $.Deferred();
+ LdapWizard.runDetectors(this.target, function() {
+ status.resolve();
+ });
+ return status;
+};
+
LdapFilter.prototype.updateCount = function(doneCallback) {
- if(this.target === 'User') {
- LdapWizard.countUsers(doneCallback);
- } else if (this.target === 'Group') {
- LdapWizard.countGroups(doneCallback);
- }
+ var filter = this;
+ $.when(this.beforeUpdateCount()).done(function() {
+ if(filter.target === 'User') {
+ LdapWizard.countUsers(doneCallback);
+ } else if (filter.target === 'Group') {
+ LdapWizard.countGroups(doneCallback);
+ }
+ });
};
diff --git a/apps/user_ldap/js/settings.js b/apps/user_ldap/js/settings.js
index fa40aba73b4..6db210fe435 100644
--- a/apps/user_ldap/js/settings.js
+++ b/apps/user_ldap/js/settings.js
@@ -151,8 +151,10 @@ var LdapWizard = {
ajaxRequests: {},
ajax: function(param, fnOnSuccess, fnOnError, reqID) {
- if(reqID !== undefined) {
+ if(!_.isUndefined(reqID)) {
if(LdapWizard.ajaxRequests.hasOwnProperty(reqID)) {
+ console.log('aborting ' + reqID);
+ console.log(param);
LdapWizard.ajaxRequests[reqID].abort();
}
}
@@ -167,9 +169,10 @@ var LdapWizard = {
}
}
);
- if(reqID !== undefined) {
+ if(!_.isUndefined(reqID)) {
LdapWizard.ajaxRequests[reqID] = request;
}
+ return request;
},
applyChanges: function (result) {
@@ -342,7 +345,7 @@ var LdapWizard = {
},
_countThings: function(method, spinnerID, doneCallback) {
- param = 'action='+method+
+ var param = 'action='+method+
'&ldap_serverconfig_chooser='+
encodeURIComponent($('#ldap_serverconfig_chooser').val());
@@ -351,14 +354,14 @@ var LdapWizard = {
function(result) {
LdapWizard.applyChanges(result);
LdapWizard.hideSpinner(spinnerID);
- if(doneCallback !== undefined) {
+ if(!_.isUndefined(doneCallback)) {
doneCallback(method);
}
},
function (result) {
OC.Notification.show('Counting the entries failed with, ' + result.message);
LdapWizard.hideSpinner(spinnerID);
- if(doneCallback !== undefined) {
+ if(!_.isUndefined(doneCallback)) {
doneCallback(method);
}
},
@@ -374,12 +377,54 @@ var LdapWizard = {
LdapWizard._countThings('countUsers', '#ldap_user_count', doneCallback);
},
+ /**
+ * called after detectors have run
+ * @callback runDetectorsCallback
+ */
+
+ /**
+ * runs detectors to determine appropriate attributes, e.g. displayName
+ * @param {string} type either "User" or "Group"
+ * @param {runDetectorsCallback} triggered after all detectors have completed
+ */
+ runDetectors: function(type, callback) {
+ if(type === 'Group') {
+ $.when(LdapWizard.detectGroupMemberAssoc())
+ .then(callback, callback);
+ if( LdapWizard.admin.isExperienced
+ && !(LdapWizard.detectorsRunInXPMode & LdapWizard.groupDetectors)) {
+ LdapWizard.detectorsRunInXPMode += LdapWizard.groupDetectors;
+ }
+ } else if(type === 'User') {
+ var req1 = LdapWizard.detectUserDisplayNameAttribute();
+ var req2 = LdapWizard.detectEmailAttribute();
+ $.when(req1, req2)
+ .then(callback, callback);
+ if( LdapWizard.admin.isExperienced
+ && !(LdapWizard.detectorsRunInXPMode & LdapWizard.userDetectors)) {
+ LdapWizard.detectorsRunInXPMode += LdapWizard.userDetectors;
+ }
+ }
+ },
+
+ /**
+ * runs detector to find out a fitting user display name attribute
+ */
+ detectUserDisplayNameAttribute: function() {
+ var param = 'action=detectUserDisplayNameAttribute' +
+ '&ldap_serverconfig_chooser='+
+ encodeURIComponent($('#ldap_serverconfig_chooser').val());
+
+ //runs in the background, no callbacks necessary
+ return LdapWizard.ajax(param, LdapWizard.applyChanges, function(){}, 'detectUserDisplayNameAttribute');
+ },
+
detectEmailAttribute: function() {
- param = 'action=detectEmailAttribute'+
+ var param = 'action=detectEmailAttribute'+
'&ldap_serverconfig_chooser='+
encodeURIComponent($('#ldap_serverconfig_chooser').val());
//runs in the background, no callbacks necessary
- LdapWizard.ajax(param, LdapWizard.applyChanges, function(){}, 'detectEmailAttribute');
+ return LdapWizard.ajax(param, LdapWizard.applyChanges, function(){}, 'detectEmailAttribute');
},
detectGroupMemberAssoc: function() {
@@ -387,7 +432,7 @@ var LdapWizard = {
'&ldap_serverconfig_chooser='+
encodeURIComponent($('#ldap_serverconfig_chooser').val());
- LdapWizard.ajax(param,
+ return LdapWizard.ajax(param,
function(result) {
//pure background story
},
@@ -409,7 +454,7 @@ var LdapWizard = {
$('#ldap_loginfilter_attributes').find('option').remove();
for (var i in result.options['ldap_loginfilter_attributes']) {
//FIXME: move HTML into template
- attr = result.options['ldap_loginfilter_attributes'][i];
+ var attr = result.options['ldap_loginfilter_attributes'][i];
$('#ldap_loginfilter_attributes').append(
"<option value='"+attr+"'>"+attr+"</option>");
}
@@ -566,8 +611,12 @@ var LdapWizard = {
},
isConfigurationActiveControlLocked: true,
+ detectorsRunInXPMode: 0,
+ userDetectors: 1,
+ groupDetectors: 2,
init: function() {
+ LdapWizard.detectorsRunInXPMode = 0;
LdapWizard.instantiateFilters();
LdapWizard.admin.setExperienced($('#ldap_experienced_admin').is(':checked'));
LdapWizard.basicStatusCheck();
@@ -620,8 +669,9 @@ var LdapWizard = {
instantiateFilters: function() {
delete LdapWizard.userFilter;
LdapWizard.userFilter = new LdapFilter('User', function(mode) {
- if(mode === LdapWizard.filterModeAssisted) {
- LdapWizard.groupFilter.updateCount();
+ if( !LdapWizard.admin.isExperienced()
+ || mode === LdapWizard.filterModeAssisted) {
+ LdapWizard.userFilter.updateCount();
}
LdapWizard.userFilter.findFeatures();
});
@@ -630,7 +680,6 @@ var LdapWizard = {
$('#ldap_user_count').text('');
LdapWizard.showSpinner('#rawUserFilterContainer .ldapGetEntryCount');
LdapWizard.userFilter.updateCount(LdapWizard.hideTestSpinner);
- LdapWizard.detectEmailAttribute();
$('#ldap_user_count').removeClass('hidden');
});
@@ -641,7 +690,8 @@ var LdapWizard = {
delete LdapWizard.groupFilter;
LdapWizard.groupFilter = new LdapFilter('Group', function(mode) {
- if(mode === LdapWizard.filterModeAssisted) {
+ if( !LdapWizard.admin.isExperienced()
+ || mode === LdapWizard.filterModeAssisted) {
LdapWizard.groupFilter.updateCount();
}
LdapWizard.groupFilter.findFeatures();
@@ -651,7 +701,6 @@ var LdapWizard = {
$('#ldap_group_count').text('');
LdapWizard.showSpinner('#rawGroupFilterContainer .ldapGetEntryCount');
LdapWizard.groupFilter.updateCount(LdapWizard.hideTestSpinner);
- LdapWizard.detectGroupMemberAssoc();
$('#ldap_group_count').removeClass('hidden');
});
},
@@ -668,7 +717,7 @@ var LdapWizard = {
postInitUserFilter: function() {
if(LdapWizard.userFilterObjectClassesHasRun &&
LdapWizard.userFilterAvailableGroupsHasRun) {
- LdapWizard.userFilter.compose(LdapWizard.detectEmailAttribute);
+ LdapWizard.userFilter.compose();
}
},
@@ -679,7 +728,7 @@ var LdapWizard = {
//do not allow to switch tabs as long as a save process is active
return false;
}
- newTabIndex = 0;
+ var newTabIndex = 0;
if(ui.newTab[0].id === '#ldapWizard2') {
LdapWizard.initUserFilter();
newTabIndex = 1;
@@ -691,9 +740,23 @@ var LdapWizard = {
newTabIndex = 3;
}
- curTabIndex = $('#ldapSettings').tabs('option', 'active');
+ var curTabIndex = $('#ldapSettings').tabs('option', 'active');
if(curTabIndex >= 0 && curTabIndex <= 3) {
LdapWizard.controlUpdate(newTabIndex);
+ //run detectors in XP mode, when "Test Filter" button has not been
+ //clicked in order to make sure that email, displayname, member-
+ //group association attributes are properly set.
+ if( curTabIndex === 1
+ && LdapWizard.admin.isExperienced
+ && !(LdapWizard.detecorsRunInXPMode & LdapWizard.userDetectors)
+ ) {
+ LdapWizard.runDetectors('User', function(){});
+ } else if( curTabIndex === 3
+ && LdapWizard.admin.isExperienced
+ && !(LdapWizard.detecorsRunInXPMode & LdapWizard.groupDetectors)
+ ) {
+ LdapWizard.runDetectors('Group', function(){});
+ }
}
},
@@ -711,15 +774,15 @@ var LdapWizard = {
}
}
- if(triggerObj.id === 'ldap_userlist_filter' && !LdapWizard.admin.isExperienced()) {
- LdapWizard.detectEmailAttribute();
- } else if(triggerObj.id === 'ldap_group_filter' && !LdapWizard.admin.isExperienced()) {
- LdapWizard.detectGroupMemberAssoc();
- }
-
if(triggerObj.id === 'ldap_loginfilter_username'
|| triggerObj.id === 'ldap_loginfilter_email') {
LdapWizard.loginFilter.compose();
+ } else if (!LdapWizard.admin.isExperienced()) {
+ if(triggerObj.id === 'ldap_userlist_filter') {
+ LdapWizard.userFilter.updateCount();
+ } else if (triggerObj.id === 'ldap_group_filter') {
+ LdapWizard.groupFilter.updateCount();
+ }
}
if($('#ldapSettings').tabs('option', 'active') == 0) {
@@ -749,7 +812,7 @@ var LdapWizard = {
LdapWizard._save($('#'+originalObj)[0], $.trim(values));
if(originalObj === 'ldap_userfilter_objectclass'
|| originalObj === 'ldap_userfilter_groups') {
- LdapWizard.userFilter.compose(LdapWizard.detectEmailAttribute);
+ LdapWizard.userFilter.compose(true);
//when user filter is changed afterwards, login filter needs to
//be adjusted, too
if(!LdapWizard.loginFilter) {
@@ -760,7 +823,7 @@ var LdapWizard = {
LdapWizard.loginFilter.compose();
} else if(originalObj === 'ldap_groupfilter_objectclass'
|| originalObj === 'ldap_groupfilter_groups') {
- LdapWizard.groupFilter.compose();
+ LdapWizard.groupFilter.compose(true);
}
},
@@ -830,10 +893,10 @@ var LdapWizard = {
LdapWizard._save({ id: modeKey }, LdapWizard.filterModeAssisted);
if(isUser) {
LdapWizard.blacklistRemove('ldap_userlist_filter');
- LdapWizard.userFilter.compose(LdapWizard.detectEmailAttribute);
+ LdapWizard.userFilter.compose(true);
} else {
LdapWizard.blacklistRemove('ldap_group_filter');
- LdapWizard.groupFilter.compose();
+ LdapWizard.groupFilter.compose(true);
}
}
},
diff --git a/apps/user_ldap/l10n/cs_CZ.js b/apps/user_ldap/l10n/cs_CZ.js
index 2b8142bced6..f4782d57d66 100644
--- a/apps/user_ldap/l10n/cs_CZ.js
+++ b/apps/user_ldap/l10n/cs_CZ.js
@@ -33,6 +33,7 @@ OC.L10N.register(
"Confirm Deletion" : "Potvrdit smazání",
"_%s group found_::_%s groups found_" : ["nalezena %s skupina","nalezeny %s skupiny","nalezeno %s skupin"],
"_%s user found_::_%s users found_" : ["nalezen %s uživatel","nalezeni %s uživatelé","nalezeno %s uživatelů"],
+ "Could not detect user display name attribute. Please specify it yourself in advanced ldap settings." : "Nelze detekovat atribut pro zobrazení jména uživatele. Upřesněte ho prosím sami v rozšířeném nastavení LDAP.",
"Could not find the desired feature" : "Nelze nalézt požadovanou vlastnost",
"Invalid Host" : "Neplatný hostitel",
"Server" : "Server",
diff --git a/apps/user_ldap/l10n/cs_CZ.json b/apps/user_ldap/l10n/cs_CZ.json
index 819f4e6d534..e3e51560987 100644
--- a/apps/user_ldap/l10n/cs_CZ.json
+++ b/apps/user_ldap/l10n/cs_CZ.json
@@ -31,6 +31,7 @@
"Confirm Deletion" : "Potvrdit smazání",
"_%s group found_::_%s groups found_" : ["nalezena %s skupina","nalezeny %s skupiny","nalezeno %s skupin"],
"_%s user found_::_%s users found_" : ["nalezen %s uživatel","nalezeni %s uživatelé","nalezeno %s uživatelů"],
+ "Could not detect user display name attribute. Please specify it yourself in advanced ldap settings." : "Nelze detekovat atribut pro zobrazení jména uživatele. Upřesněte ho prosím sami v rozšířeném nastavení LDAP.",
"Could not find the desired feature" : "Nelze nalézt požadovanou vlastnost",
"Invalid Host" : "Neplatný hostitel",
"Server" : "Server",
diff --git a/apps/user_ldap/l10n/fr.js b/apps/user_ldap/l10n/fr.js
index 3736ade73ce..d363530f5c5 100644
--- a/apps/user_ldap/l10n/fr.js
+++ b/apps/user_ldap/l10n/fr.js
@@ -33,6 +33,7 @@ OC.L10N.register(
"Confirm Deletion" : "Confirmer la suppression",
"_%s group found_::_%s groups found_" : ["%s groupe trouvé","%s groupes trouvés"],
"_%s user found_::_%s users found_" : ["%s utilisateur trouvé","%s utilisateurs trouvés"],
+ "Could not detect user display name attribute. Please specify it yourself in advanced ldap settings." : "Impossible de détecter l'attribut contenant le nom d'affichage des utilisateurs. Veuillez l'indiquer vous-même dans les paramètres ldap avancés.",
"Could not find the desired feature" : "Impossible de trouver la fonction souhaitée",
"Invalid Host" : "Hôte invalide",
"Server" : "Serveur",
diff --git a/apps/user_ldap/l10n/fr.json b/apps/user_ldap/l10n/fr.json
index 58ac6f3d248..9879534bac7 100644
--- a/apps/user_ldap/l10n/fr.json
+++ b/apps/user_ldap/l10n/fr.json
@@ -31,6 +31,7 @@
"Confirm Deletion" : "Confirmer la suppression",
"_%s group found_::_%s groups found_" : ["%s groupe trouvé","%s groupes trouvés"],
"_%s user found_::_%s users found_" : ["%s utilisateur trouvé","%s utilisateurs trouvés"],
+ "Could not detect user display name attribute. Please specify it yourself in advanced ldap settings." : "Impossible de détecter l'attribut contenant le nom d'affichage des utilisateurs. Veuillez l'indiquer vous-même dans les paramètres ldap avancés.",
"Could not find the desired feature" : "Impossible de trouver la fonction souhaitée",
"Invalid Host" : "Hôte invalide",
"Server" : "Serveur",
diff --git a/apps/user_ldap/l10n/nl.js b/apps/user_ldap/l10n/nl.js
index e448b161f00..ae280e1a05e 100644
--- a/apps/user_ldap/l10n/nl.js
+++ b/apps/user_ldap/l10n/nl.js
@@ -33,6 +33,7 @@ OC.L10N.register(
"Confirm Deletion" : "Bevestig verwijderen",
"_%s group found_::_%s groups found_" : ["%s groep gevonden","%s groepen gevonden"],
"_%s user found_::_%s users found_" : ["%s gebruiker gevonden","%s gebruikers gevonden"],
+ "Could not detect user display name attribute. Please specify it yourself in advanced ldap settings." : "Kon het weergavenaam attribuut van de gebruiker niet vinden. Geef het zelf op in de geavanceerde ldap instellingen.",
"Could not find the desired feature" : "Kon de gewenste functie niet vinden",
"Invalid Host" : "Ongeldige server",
"Server" : "Server",
diff --git a/apps/user_ldap/l10n/nl.json b/apps/user_ldap/l10n/nl.json
index eb1eecf8201..ed0ce08501a 100644
--- a/apps/user_ldap/l10n/nl.json
+++ b/apps/user_ldap/l10n/nl.json
@@ -31,6 +31,7 @@
"Confirm Deletion" : "Bevestig verwijderen",
"_%s group found_::_%s groups found_" : ["%s groep gevonden","%s groepen gevonden"],
"_%s user found_::_%s users found_" : ["%s gebruiker gevonden","%s gebruikers gevonden"],
+ "Could not detect user display name attribute. Please specify it yourself in advanced ldap settings." : "Kon het weergavenaam attribuut van de gebruiker niet vinden. Geef het zelf op in de geavanceerde ldap instellingen.",
"Could not find the desired feature" : "Kon de gewenste functie niet vinden",
"Invalid Host" : "Ongeldige server",
"Server" : "Server",
diff --git a/apps/user_ldap/l10n/pt_BR.js b/apps/user_ldap/l10n/pt_BR.js
index 32b7697df3e..a4a481524ba 100644
--- a/apps/user_ldap/l10n/pt_BR.js
+++ b/apps/user_ldap/l10n/pt_BR.js
@@ -33,6 +33,7 @@ OC.L10N.register(
"Confirm Deletion" : "Confirmar Exclusão",
"_%s group found_::_%s groups found_" : ["grupo% s encontrado","grupos% s encontrado"],
"_%s user found_::_%s users found_" : ["usuário %s encontrado","usuários %s encontrados"],
+ "Could not detect user display name attribute. Please specify it yourself in advanced ldap settings." : "Não foi possível detectar o nome de exibição do atributo do usuário. Por favor, indique-o você mesmo em configurações avançadas do LDAP.",
"Could not find the desired feature" : "Não foi possível encontrar a função desejada",
"Invalid Host" : "Host Inválido",
"Server" : "Servidor",
diff --git a/apps/user_ldap/l10n/pt_BR.json b/apps/user_ldap/l10n/pt_BR.json
index ea59ed7b4d8..4dd9088b727 100644
--- a/apps/user_ldap/l10n/pt_BR.json
+++ b/apps/user_ldap/l10n/pt_BR.json
@@ -31,6 +31,7 @@
"Confirm Deletion" : "Confirmar Exclusão",
"_%s group found_::_%s groups found_" : ["grupo% s encontrado","grupos% s encontrado"],
"_%s user found_::_%s users found_" : ["usuário %s encontrado","usuários %s encontrados"],
+ "Could not detect user display name attribute. Please specify it yourself in advanced ldap settings." : "Não foi possível detectar o nome de exibição do atributo do usuário. Por favor, indique-o você mesmo em configurações avançadas do LDAP.",
"Could not find the desired feature" : "Não foi possível encontrar a função desejada",
"Invalid Host" : "Host Inválido",
"Server" : "Servidor",
diff --git a/apps/user_ldap/l10n/sq.js b/apps/user_ldap/l10n/sq.js
index 056458c24b6..b436bef7bf2 100644
--- a/apps/user_ldap/l10n/sq.js
+++ b/apps/user_ldap/l10n/sq.js
@@ -32,6 +32,7 @@ OC.L10N.register(
"For anonymous access, leave DN and Password empty." : "Për tu lidhur në mënyre anonime, lini bosh hapsirat e DN dhe fjalëkalim",
"One Base DN per line" : "Një baze DN për rrjesht",
"You can specify Base DN for users and groups in the Advanced tab" : "Ju mund të specifikoni Bazen DN për përdorues dhe grupe në butonin 'Të Përparuara'",
+ "Continue" : "Vazhdo",
"Advanced" : "E përparuar",
"<b>Warning:</b> The PHP LDAP module is not installed, the backend will not work. Please ask your system administrator to install it." : "<b>Njoftim:</b> moduli PHP LDAP nuk është instaluar, motori nuk do të funksionojë.Kontaktoni me administratorin e sistemit.",
"Connection Settings" : "Të dhënat e lidhjes",
diff --git a/apps/user_ldap/l10n/sq.json b/apps/user_ldap/l10n/sq.json
index a3e87869355..5b81af7100d 100644
--- a/apps/user_ldap/l10n/sq.json
+++ b/apps/user_ldap/l10n/sq.json
@@ -30,6 +30,7 @@
"For anonymous access, leave DN and Password empty." : "Për tu lidhur në mënyre anonime, lini bosh hapsirat e DN dhe fjalëkalim",
"One Base DN per line" : "Një baze DN për rrjesht",
"You can specify Base DN for users and groups in the Advanced tab" : "Ju mund të specifikoni Bazen DN për përdorues dhe grupe në butonin 'Të Përparuara'",
+ "Continue" : "Vazhdo",
"Advanced" : "E përparuar",
"<b>Warning:</b> The PHP LDAP module is not installed, the backend will not work. Please ask your system administrator to install it." : "<b>Njoftim:</b> moduli PHP LDAP nuk është instaluar, motori nuk do të funksionojë.Kontaktoni me administratorin e sistemit.",
"Connection Settings" : "Të dhënat e lidhjes",
diff --git a/apps/user_ldap/lib/access.php b/apps/user_ldap/lib/access.php
index d89029abf17..6f28a87d30c 100644
--- a/apps/user_ldap/lib/access.php
+++ b/apps/user_ldap/lib/access.php
@@ -813,7 +813,7 @@ class Access extends LDAPUtility implements user\IUserTools {
}
//check whether paged search should be attempted
- $pagedSearchOK = $this->initPagedSearch($filter, $base, $attr, $limit, $offset);
+ $pagedSearchOK = $this->initPagedSearch($filter, $base, $attr, intval($limit), $offset);
$linkResources = array_pad(array(), count($base), $cr);
$sr = $this->ldap->search($linkResources, $base, $filter, $attr);
@@ -887,8 +887,9 @@ class Access extends LDAPUtility implements user\IUserTools {
private function count($filter, $base, $attr = null, $limit = null, $offset = null, $skipHandling = false) {
\OCP\Util::writeLog('user_ldap', 'Count filter: '.print_r($filter, true), \OCP\Util::DEBUG);
- if(is_null($limit) || $limit <= 0) {
- $limit = intval($this->connection->ldapPagingSize);
+ $limitPerPage = intval($this->connection->ldapPagingSize);
+ if(!is_null($limit) && $limit < $limitPerPage && $limit > 0) {
+ $limitPerPage = $limit;
}
$counter = 0;
@@ -898,19 +899,19 @@ class Access extends LDAPUtility implements user\IUserTools {
do {
$continue = false;
$search = $this->executeSearch($filter, $base, $attr,
- $limit, $offset);
+ $limitPerPage, $offset);
if($search === false) {
return $counter > 0 ? $counter : false;
}
list($sr, $pagedSearchOK) = $search;
- $count = $this->countEntriesInSearchResults($sr, $limit, $continue);
+ $count = $this->countEntriesInSearchResults($sr, $limitPerPage, $continue);
$counter += $count;
- $this->processPagedSearchStatus($sr, $filter, $base, $count, $limit,
+ $this->processPagedSearchStatus($sr, $filter, $base, $count, $limitPerPage,
$offset, $pagedSearchOK, $skipHandling);
- $offset += $limit;
- } while($continue);
+ $offset += $limitPerPage;
+ } while($continue && (is_null($limit) || $limit <= 0 || $limit > $counter));
return $counter;
}
@@ -1168,6 +1169,19 @@ class Access extends LDAPUtility implements user\IUserTools {
}
/**
+ * returns the filter used for counting users
+ * @return string
+ */
+ public function getFilterForUserCount() {
+ $filter = $this->combineFilterWithAnd(array(
+ $this->connection->ldapUserFilter,
+ $this->connection->ldapUserDisplayName . '=*'
+ ));
+
+ return $filter;
+ }
+
+ /**
* @param string $name
* @param string $password
* @return bool
@@ -1457,7 +1471,7 @@ class Access extends LDAPUtility implements user\IUserTools {
*/
private function initPagedSearch($filter, $bases, $attr, $limit, $offset) {
$pagedSearchOK = false;
- if($this->connection->hasPagedResultSupport && !is_null($limit)) {
+ if($this->connection->hasPagedResultSupport && ($limit !== 0)) {
$offset = intval($offset); //can be null
\OCP\Util::writeLog('user_ldap',
'initializing paged search for Filter '.$filter.' base '.print_r($bases, true)
diff --git a/apps/user_ldap/lib/wizard.php b/apps/user_ldap/lib/wizard.php
index 1d7701440e9..578a920f00e 100644
--- a/apps/user_ldap/lib/wizard.php
+++ b/apps/user_ldap/lib/wizard.php
@@ -56,7 +56,7 @@ class Wizard extends LDAPUtility {
Wizard::$l = \OC::$server->getL10N('user_ldap');
}
$this->access = $access;
- $this->result = new WizardResult;
+ $this->result = new WizardResult();
}
public function __destruct() {
@@ -120,7 +120,7 @@ class Wizard extends LDAPUtility {
* @throws \Exception
*/
public function countUsers() {
- $filter = $this->configuration->ldapUserFilter;
+ $filter = $this->access->getFilterForUserCount();
$usersTotal = $this->countEntries($filter, 'users');
$usersTotal = ($usersTotal !== false) ? $usersTotal : 0;
@@ -132,9 +132,10 @@ class Wizard extends LDAPUtility {
/**
* counts users with a specified attribute
* @param string $attr
+ * @param bool $existsCheck
* @return int|bool
*/
- public function countUsersWithAttribute($attr) {
+ public function countUsersWithAttribute($attr, $existsCheck = false) {
if(!$this->checkRequirements(array('ldapHost',
'ldapPort',
'ldapBase',
@@ -148,7 +149,51 @@ class Wizard extends LDAPUtility {
$attr . '=*'
));
- return $this->access->countUsers($filter);
+ $limit = ($existsCheck === false) ? null : 1;
+
+ return $this->access->countUsers($filter, array('dn'), $limit);
+ }
+
+ /**
+ * detects the display name attribute. If a setting is already present that
+ * returns at least one hit, the detection will be canceled.
+ * @return WizardResult|bool
+ * @throws \Exception
+ */
+ public function detectUserDisplayNameAttribute() {
+ if(!$this->checkRequirements(array('ldapHost',
+ 'ldapPort',
+ 'ldapBase',
+ 'ldapUserFilter',
+ ))) {
+ return false;
+ }
+
+ $attr = $this->configuration->ldapUserDisplayName;
+ if($attr !== 'displayName' && !empty($attr)) {
+ // most likely not the default value with upper case N,
+ // verify it still produces a result
+ $count = intval($this->countUsersWithAttribute($attr, true));
+ if($count > 0) {
+ //no change, but we sent it back to make sure the user interface
+ //is still correct, even if the ajax call was cancelled inbetween
+ $this->result->addChange('ldap_display_name', $attr);
+ return $this->result;
+ }
+ }
+
+ // first attribute that has at least one result wins
+ $displayNameAttrs = array('displayname', 'cn');
+ foreach ($displayNameAttrs as $attr) {
+ $count = intval($this->countUsersWithAttribute($attr, true));
+
+ if($count > 0) {
+ $this->applyFind('ldap_display_name', $attr);
+ return $this->result;
+ }
+ };
+
+ throw new \Exception(self::$l->t('Could not detect user display name attribute. Please specify it yourself in advanced ldap settings.'));
}
/**
@@ -168,7 +213,7 @@ class Wizard extends LDAPUtility {
$attr = $this->configuration->ldapEmailAttribute;
if(!empty($attr)) {
- $count = intval($this->countUsersWithAttribute($attr));
+ $count = intval($this->countUsersWithAttribute($attr, true));
if($count > 0) {
return false;
}
@@ -189,7 +234,7 @@ class Wizard extends LDAPUtility {
}
if($winner !== '') {
- $this->result->addChange('ldap_email_attr', $winner);
+ $this->applyFind('ldap_email_attr', $winner);
if($writeLog) {
\OCP\Util::writeLog('user_ldap', 'The mail attribute has ' .
'automatically been reset, because the original value ' .
diff --git a/apps/user_ldap/tests/user_ldap.php b/apps/user_ldap/tests/user_ldap.php
index e91404d47f2..33cec0247b6 100644
--- a/apps/user_ldap/tests/user_ldap.php
+++ b/apps/user_ldap/tests/user_ldap.php
@@ -552,23 +552,9 @@ class Test_User_Ldap_Direct extends \Test\TestCase {
public function testCountUsers() {
$access = $this->getAccessMock();
- $access->connection->expects($this->once())
- ->method('__get')
- ->will($this->returnCallback(function($name) {
- if($name === 'ldapLoginFilter') {
- return 'uid=%uid';
- }
- return null;
- }));
-
$access->expects($this->once())
->method('countUsers')
- ->will($this->returnCallback(function($filter, $a, $b, $c) {
- if($filter !== 'uid=*') {
- return false;
- }
- return 5;
- }));
+ ->will($this->returnValue(5));
$backend = new UserLDAP($access);
@@ -579,23 +565,9 @@ class Test_User_Ldap_Direct extends \Test\TestCase {
public function testCountUsersFailing() {
$access = $this->getAccessMock();
- $access->connection->expects($this->once())
- ->method('__get')
- ->will($this->returnCallback(function($name) {
- if($name === 'ldapLoginFilter') {
- return 'invalidFilter';
- }
- return null;
- }));
-
$access->expects($this->once())
->method('countUsers')
- ->will($this->returnCallback(function($filter, $a, $b, $c) {
- if($filter !== 'uid=*') {
- return false;
- }
- return 5;
- }));
+ ->will($this->returnValue(false));
$backend = new UserLDAP($access);
diff --git a/apps/user_ldap/user_ldap.php b/apps/user_ldap/user_ldap.php
index 6e244311d4a..c2f87ebeb22 100644
--- a/apps/user_ldap/user_ldap.php
+++ b/apps/user_ldap/user_ldap.php
@@ -290,8 +290,7 @@ class USER_LDAP extends BackendUtility implements \OCP\UserInterface {
* @return int|bool
*/
public function countUsers() {
- $filter = \OCP\Util::mb_str_replace(
- '%uid', '*', $this->access->connection->ldapLoginFilter, 'UTF-8');
+ $filter = $this->access->getFilterForUserCount();
$entries = $this->access->countUsers($filter);
return $entries;
}
diff --git a/config/config.sample.php b/config/config.sample.php
index 2287b7af7dd..2a9b43d5690 100644
--- a/config/config.sample.php
+++ b/config/config.sample.php
@@ -134,6 +134,12 @@ $CONFIG = array(
),
/**
+ * sqlite3 journal mode can be specified using this config parameter - can be 'WAL' or 'DELETE'
+ * see for more details https://www.sqlite.org/wal.html
+ */
+'sqlite.journal_mode' => 'DELETE',
+
+/**
* Indicates whether the ownCloud instance was installed successfully; ``true``
* indicates a successful installation, and ``false`` indicates an unsuccessful
* installation.
@@ -617,7 +623,7 @@ $CONFIG = array(
* concerns:
*
* - OC\Preview\Illustrator
- * - OC\Preview\Movies
+ * - OC\Preview\Movie
* - OC\Preview\MSOffice2003
* - OC\Preview\MSOffice2007
* - OC\Preview\MSOfficeDoc
diff --git a/core/js/lostpassword.js b/core/js/lostpassword.js
index 35173fd3d33..294a9d8c1cf 100644
--- a/core/js/lostpassword.js
+++ b/core/js/lostpassword.js
@@ -112,7 +112,11 @@ OC.Lostpassword = {
},
redirect : function(msg){
- window.location = OC.webroot;
+ if(OC.webroot !== '') {
+ window.location = OC.webroot;
+ } else {
+ window.location = '/';
+ }
},
resetError : function(msg){
diff --git a/core/js/oc-requesttoken.js b/core/js/oc-requesttoken.js
index 02175a3d674..2f7548ecb77 100644
--- a/core/js/oc-requesttoken.js
+++ b/core/js/oc-requesttoken.js
@@ -1,3 +1,4 @@
$(document).on('ajaxSend',function(elm, xhr) {
xhr.setRequestHeader('requesttoken', oc_requesttoken);
-}); \ No newline at end of file
+ xhr.setRequestHeader('OCS-APIREQUEST', 'true');
+});
diff --git a/core/l10n/fr.js b/core/l10n/fr.js
index 87e8b017832..0155b0c90c4 100644
--- a/core/l10n/fr.js
+++ b/core/l10n/fr.js
@@ -62,7 +62,7 @@ OC.L10N.register(
"So-so password" : "Mot de passe tout juste acceptable",
"Good password" : "Mot de passe de sécurité suffisante",
"Strong password" : "Mot de passe fort",
- "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 semble ne pas fonctionner.",
+ "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 semble ne pas fonctionner.",
"This server has no working internet connection. This means that some of the features like mounting of external storage, notifications about updates or installation of 3rd party apps don´t work. Accessing files from remote and sending of notification emails might also not work. We suggest to enable internet connection for this server if you want to have all features." : "Ce serveur ne peut se connecter à internet. Cela signifie que certaines fonctionnalités, telles que le montage de supports de stockage distants, les notifications de mises à jour ou l'installation d'applications tierces ne fonctionneront pas. L'accès aux fichiers à distance, ainsi que les notifications par courriel ne fonctionneront pas non plus. Il est recommandé d'activer la connexion internet pour ce serveur si vous souhaitez disposer de l'ensemble des fonctionnalités offertes.",
"Error occurred while checking server setup" : "Une erreur s'est produite lors de la vérification de la configuration du serveur",
"Shared" : "Partagé",
diff --git a/core/l10n/fr.json b/core/l10n/fr.json
index 5b57d86f532..2ddd7d91a39 100644
--- a/core/l10n/fr.json
+++ b/core/l10n/fr.json
@@ -60,7 +60,7 @@
"So-so password" : "Mot de passe tout juste acceptable",
"Good password" : "Mot de passe de sécurité suffisante",
"Strong password" : "Mot de passe fort",
- "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 semble ne pas fonctionner.",
+ "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 semble ne pas fonctionner.",
"This server has no working internet connection. This means that some of the features like mounting of external storage, notifications about updates or installation of 3rd party apps don´t work. Accessing files from remote and sending of notification emails might also not work. We suggest to enable internet connection for this server if you want to have all features." : "Ce serveur ne peut se connecter à internet. Cela signifie que certaines fonctionnalités, telles que le montage de supports de stockage distants, les notifications de mises à jour ou l'installation d'applications tierces ne fonctionneront pas. L'accès aux fichiers à distance, ainsi que les notifications par courriel ne fonctionneront pas non plus. Il est recommandé d'activer la connexion internet pour ce serveur si vous souhaitez disposer de l'ensemble des fonctionnalités offertes.",
"Error occurred while checking server setup" : "Une erreur s'est produite lors de la vérification de la configuration du serveur",
"Shared" : "Partagé",
diff --git a/core/l10n/ru.js b/core/l10n/ru.js
index f3e11f7abda..858595bab64 100644
--- a/core/l10n/ru.js
+++ b/core/l10n/ru.js
@@ -113,7 +113,7 @@ OC.L10N.register(
"Hello world!" : "Привет мир!",
"sunny" : "солнечно",
"Hello {name}, the weather is {weather}" : "Здравствуйте {name}, погода {weather}",
- "_download %n file_::_download %n files_" : ["","",""],
+ "_download %n file_::_download %n files_" : ["загрузить %n файл","загрузить %n файла","загрузить %n файлов"],
"Updating {productName} to version {version}, this may take a while." : "Обновление {productName} до версии {version}, пожалуйста, подождите.",
"Please reload the page." : "Пожалуйста, перезагрузите страницу.",
"The update was unsuccessful." : "Обновление не удалось.",
diff --git a/core/l10n/ru.json b/core/l10n/ru.json
index a77cf869064..990a6e9bf9c 100644
--- a/core/l10n/ru.json
+++ b/core/l10n/ru.json
@@ -111,7 +111,7 @@
"Hello world!" : "Привет мир!",
"sunny" : "солнечно",
"Hello {name}, the weather is {weather}" : "Здравствуйте {name}, погода {weather}",
- "_download %n file_::_download %n files_" : ["","",""],
+ "_download %n file_::_download %n files_" : ["загрузить %n файл","загрузить %n файла","загрузить %n файлов"],
"Updating {productName} to version {version}, this may take a while." : "Обновление {productName} до версии {version}, пожалуйста, подождите.",
"Please reload the page." : "Пожалуйста, перезагрузите страницу.",
"The update was unsuccessful." : "Обновление не удалось.",
diff --git a/core/l10n/sk_SK.js b/core/l10n/sk_SK.js
index 28e3a3b4a4d..791863c0e48 100644
--- a/core/l10n/sk_SK.js
+++ b/core/l10n/sk_SK.js
@@ -173,6 +173,7 @@ OC.L10N.register(
"SQLite will be used as database. For larger installations we recommend to change this." : "Ako databáza bude použitá SQLite. Pri väčších inštaláciách odporúčame zmeniť na inú.",
"Finish setup" : "Dokončiť inštaláciu",
"Finishing …" : "Dokončujem...",
+ "This application requires JavaScript for correct operation. Please <a href=\"http://enable-javascript.com/\" target=\"_blank\">enable JavaScript</a> and reload the page." : "Táto aplikácia potrebuje JavaScript pre správne fungovanie. Prosím <a href=\"http://enable-javascript.com/\" target=\"_blank\">zapnite si JavaScript</a> a obnovte stránku",
"%s is available. Get more information on how to update." : "%s je dostupná. Získajte viac informácií o postupe aktualizácie.",
"Log out" : "Odhlásiť",
"Server side authentication failed!" : "Autentifikácia na serveri zlyhala!",
diff --git a/core/l10n/sk_SK.json b/core/l10n/sk_SK.json
index 17daa232693..6a539ccd773 100644
--- a/core/l10n/sk_SK.json
+++ b/core/l10n/sk_SK.json
@@ -171,6 +171,7 @@
"SQLite will be used as database. For larger installations we recommend to change this." : "Ako databáza bude použitá SQLite. Pri väčších inštaláciách odporúčame zmeniť na inú.",
"Finish setup" : "Dokončiť inštaláciu",
"Finishing …" : "Dokončujem...",
+ "This application requires JavaScript for correct operation. Please <a href=\"http://enable-javascript.com/\" target=\"_blank\">enable JavaScript</a> and reload the page." : "Táto aplikácia potrebuje JavaScript pre správne fungovanie. Prosím <a href=\"http://enable-javascript.com/\" target=\"_blank\">zapnite si JavaScript</a> a obnovte stránku",
"%s is available. Get more information on how to update." : "%s je dostupná. Získajte viac informácií o postupe aktualizácie.",
"Log out" : "Odhlásiť",
"Server side authentication failed!" : "Autentifikácia na serveri zlyhala!",
diff --git a/core/l10n/sq.js b/core/l10n/sq.js
index 246c12bd9ec..d0692b8a63e 100644
--- a/core/l10n/sq.js
+++ b/core/l10n/sq.js
@@ -35,14 +35,38 @@ OC.L10N.register(
"December" : "Dhjetor",
"Settings" : "Parametra",
"Saving..." : "Duke ruajtur...",
+ "Couldn't send reset email. Please contact your administrator." : "Emaili i rivendosjes nuk mund të dërgohet. Ju lutem kontaktoni me administratorin.",
+ "The link to reset your password has been sent to your email. If you do not receive it within a reasonable amount of time, check your spam/junk folders.<br>If it is not there ask your local administrator." : "Lidhja për rivendosjen e kodit tuaj u dërgua tek email-i juaj. Nëse nuk e merrni brenda një kohe të arsyeshme, kontrolloni dosjet e postës së padëshirueshme spam.<br>Nëse nuk është as aty, pyesni administratorin tuaj.",
+ "Your files are encrypted. If you haven't enabled the recovery key, there will be no way to get your data back after your password is reset.<br />If you are not sure what to do, please contact your administrator before you continue. <br />Do you really want to continue?" : "Skedarët tuaj janë të kodifikuar. Nëse nuk keni aktivizuar çelësin e restaurimit, të dhënat tuaja nuk do të jenë të arritshme pasi të keni rivendosur kodin.<br />Nëse nuk jeni i sigurt, ju lutemi kontaktoni administratorin tuaj përpara se të vazhdoni. Jeni i sigurt që dëshironi të vazhdoni?",
+ "I know what I'm doing" : "Unë e di se çfarë po bëj",
+ "Password can not be changed. Please contact your administrator." : "Fjalëkalimi nuk mund të ndryshohet. Ju lutem kontaktoni me administratorin.",
"No" : "Jo",
"Yes" : "Po",
"Choose" : "Zgjidh",
+ "Error loading file picker template: {error}" : "Gabim gjatë ngarkimit të shabllonit të zgjedhësit të skedarëve: {error}",
"Ok" : "Në rregull",
- "_{count} file conflict_::_{count} file conflicts_" : ["",""],
+ "Error loading message template: {error}" : "Gabim gjatë ngarkimit të shabllonit të mesazheve: {error}",
+ "_{count} file conflict_::_{count} file conflicts_" : ["{count} konflikt skedari","{count} konflikte skedarësh"],
+ "One file conflict" : "Një konflikt skedari",
+ "New Files" : "Skedarë të rinj",
+ "Already existing files" : "Skedarë ekzistues",
+ "Which files do you want to keep?" : "Cilët skedarë dëshironi të mbani?",
+ "If you select both versions, the copied file will have a number added to its name." : "Nëse i zgjidhni të dyja versionet, skedarit të kopjuar do ti shtohet një numër në emrin e tij.",
"Cancel" : "Anulo",
+ "Continue" : "Vazhdo",
+ "(all selected)" : "(të gjitha të zgjedhura)",
+ "({count} selected)" : "({count} të zgjedhur)",
+ "Error loading file exists template" : "Gabim gjatë ngarkimit të shabllonit të skedarit ekzistues",
+ "Very weak password" : "Fjalëkalim shumë i dobët",
+ "Weak password" : "Fjalëkalim i dobët",
+ "So-so password" : "Fjalëkalim i pranueshëm",
+ "Good password" : "Fjalëkalim i mirë",
+ "Strong password" : "Fjalëkalim shumë i mirë",
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." : "Web Serveri juaj nuk është konfigurar sic duhet në mënyre që të lejojë sinkronizimin e skedare pasi ndërfaqja WevDAV duket të jetë e demtuar.",
+ "This server has no working internet connection. This means that some of the features like mounting of external storage, notifications about updates or installation of 3rd party apps don´t work. Accessing files from remote and sending of notification emails might also not work. We suggest to enable internet connection for this server if you want to have all features." : "Ky server nuk ka lidhje në internet. Kjo dmth qe disa nga funksionalitetet si të montohet ruajtje e jashtme, njoftime mbi versione të reja apo instalimi i aplikacioneve nga palë të 3ta nuk do të funksionojnë. Qasja në distancë e skedarëve dhe dërgimi i emaileve njoftues gjithashtu mund të mos funksionojnë. Ju sugjerojmë që të aktivizoni lidhjen në internet për këtë server nëse dëshironi ti keni të gjitha funksionalitetet.",
+ "Error occurred while checking server setup" : "Gabim gjatë kontrollit të konfigurimit të serverit",
"Shared" : "Ndarë",
+ "Shared with {recipients}" : "Ndarë me {recipients}",
"Share" : "Nda",
"Error" : "Veprim i gabuar",
"Error while sharing" : "Veprim i gabuar gjatë ndarjes",
@@ -50,16 +74,22 @@ OC.L10N.register(
"Error while changing permissions" : "Veprim i gabuar gjatë ndryshimit të lejeve",
"Shared with you and the group {group} by {owner}" : "Ndarë me ju dhe me grupin {group} nga {owner}",
"Shared with you by {owner}" : "Ndarë me ju nga {owner}",
+ "Share with user or group …" : "Ndajeni me përdorues ose grup ...",
+ "Share link" : "Ndaje lidhjen",
+ "The public link will expire no later than {days} days after it is created" : "Lidhja publike do të skadojë jo më vonë se {days} ditë pas krijimit",
"Password protect" : "Mbro me kod",
+ "Choose a password for the public link" : "Zgjidhni një fjalëkalim për lidhjen publike",
"Allow Public Upload" : "Lejo Ngarkimin Publik",
"Email link to person" : "Dërgo email me lidhjen",
"Send" : "Dërgo",
"Set expiration date" : "Cakto datën e përfundimit",
"Expiration date" : "Data e përfundimit",
+ "Adding user..." : "Duke shtuar përdoruesin ...",
"group" : "grupi",
"Resharing is not allowed" : "Rindarja nuk lejohet",
"Shared in {item} with {user}" : "Ndarë në {item} me {user}",
"Unshare" : "Hiq ndarjen",
+ "notify by email" : "njofto me email",
"can share" : "mund të ndajnë",
"can edit" : "mund të ndryshosh",
"access control" : "kontrollimi i hyrjeve",
@@ -71,21 +101,64 @@ OC.L10N.register(
"Error setting expiration date" : "Veprim i gabuar gjatë caktimit të datës së përfundimit",
"Sending ..." : "Duke dërguar...",
"Email sent" : "Email-i u dërgua",
+ "Warning" : "Kujdes",
"The object type is not specified." : "Nuk është specifikuar tipi i objektit.",
+ "Enter new" : "Jep të re",
"Delete" : "Elimino",
"Add" : "Shto",
- "_download %n file_::_download %n files_" : ["",""],
+ "Edit tags" : "Modifiko tag",
+ "Error loading dialog template: {error}" : "Gabim gjatë ngarkimit të shabllonit: {error}",
+ "No tags selected for deletion." : "Nuk është zgjedhur asnjë tag për fshirje.",
+ "unknown text" : "tekst i panjohur",
+ "Hello world!" : "Përshendetje të gjithëve!",
+ "sunny" : "diell",
+ "Hello {name}, the weather is {weather}" : "Përshëndetje {name}, koha është {weather}",
+ "_download %n file_::_download %n files_" : ["shkarko %n skedar","shkarko %n skedarë"],
+ "Updating {productName} to version {version}, this may take a while." : "Po përditësoj {productName} në versionin {version}, kjo mund të zgjasë pak.",
+ "Please reload the page." : "Ju lutem ringarkoni faqen.",
+ "The update was unsuccessful." : "Përditësimi nuk rezultoi me sukses.",
"The update was successful. Redirecting you to ownCloud now." : "Azhurnimi u krye. Tani do t'ju kaloj tek ownCloud-i.",
+ "Couldn't reset password because the token is invalid" : "Nuk mund të rivendos fjalëkalimin sepse shenja është e pavlefshme.",
+ "Couldn't send reset email. Please make sure your username is correct." : "Emaili i rivendosjes nuk mund të dërgohet. Ju lutem sigurohuni që përdoruesi juaj është i saktë.",
+ "Couldn't send reset email because there is no email address for this username. Please contact your administrator." : "Emaili i rivendosjes nuk mund të dërgohet sepse nuk ekziston asnjë adresë email për këtë përdorues. Ju lutem kontaktoni me administratorin.",
"%s password reset" : "Kodi i %s -it u rivendos",
"Use the following link to reset your password: {link}" : "Përdorni lidhjen në vijim për të rivendosur kodin: {link}",
"New password" : "Kodi i ri",
+ "New Password" : "Fjalëkalim i ri",
"Reset password" : "Rivendos kodin",
+ "Mac OS X is not supported and %s will not work properly on this platform. Use it at your own risk! " : "Mac OS X nuk është i mbështetur dhe %s nuk do të funksionojë si duhet në këtë platformë. Përdoreni nën përgjegjësinë tuaj!",
+ "For the best results, please consider using a GNU/Linux server instead." : "Për të arritur rezultatet më të mira të mundshme, ju lutem më mirë konsideroni përdorimin e një serveri GNU/Linux.",
"Personal" : "Personale",
"Users" : "Përdoruesit",
"Apps" : "App",
"Admin" : "Admin",
"Help" : "Ndihmë",
+ "Error loading tags" : "Gabim gjatë ngarkimit të etiketave.",
+ "Tag already exists" : "Etiketa ekziston",
+ "Error deleting tag(s)" : "Gabim gjatë fshirjes së etiketës(ave)",
+ "Error tagging" : "Gabim etiketimi",
+ "Error untagging" : "Gabim në heqjen e etiketës",
+ "Error favoriting" : "Gabim në ruajtjen si të preferuar",
+ "Error unfavoriting" : "Gabim në heqjen nga të preferuarat",
"Access forbidden" : "Ndalohet hyrja",
+ "File not found" : "Skedari nuk mund të gjendet",
+ "The specified document has not been found on the server." : "Dokumenti i përcaktuar nuk mund të gjendet në server.",
+ "You can click here to return to %s." : "Ju mund të klikoni këtu për tu kthyer në %s.",
+ "Hey there,\n\njust letting you know that %s shared %s with you.\nView it: %s\n\n" : "Tungjatjeta,\n\nju njoftojmë se %s ka ndarë %s me ju.\nShikojeni në: %s\n\n",
+ "The share will expire on %s." : "Ndarja do të skadojë në %s.",
+ "Cheers!" : "Gjithë të mirat",
+ "Internal Server Error" : "Gabim i brendshëm në server",
+ "The server encountered an internal error and was unable to complete your request." : "Serveri u përball me një gabim të brendshem dhe nuk mundet të mbarojë detyrën që i keni ngarkuar.",
+ "Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report." : "Ju lutem kontaktoni me administratorin e serverit nëse ky gabim shfaqet herë të tjera, ju lutem përfshini dhe detajet e mëposhtme teknike në raportin tuaj.",
+ "More details can be found in the server log." : "Detaje të mëtejshme mund të gjenden në listën e veprimeve të serverit.",
+ "Technical details" : "Detaje teknike",
+ "Remote Address: %s" : "Adresa tjetër: %s",
+ "Request ID: %s" : "ID e kërkesës: %s",
+ "Code: %s" : "Kodi: %s",
+ "Message: %s" : "Mesazhi: %s",
+ "File: %s" : "Skedari: %s",
+ "Line: %s" : "Rreshti: %s",
+ "Trace" : "Gjurmim",
"Security Warning" : "Paralajmërim sigurie",
"Your PHP version is vulnerable to the NULL Byte attack (CVE-2006-7243)" : "Versioni juaj i PHP-së është i cënueshëm nga sulmi NULL Byte (CVE-2006-7243)",
"Please update your PHP installation to use %s securely." : "Ju lutem azhurnoni instalimin tuaj të PHP-së që të përdorni %s -in në mënyrë të sigurt.",
@@ -94,18 +167,43 @@ OC.L10N.register(
"Create an <strong>admin account</strong>" : "Krijo një <strong>llogari administruesi</strong>",
"Username" : "Përdoruesi",
"Password" : "Kodi",
+ "Storage & database" : "Ruajtja dhe baza e të dhënave",
"Data folder" : "Emri i dosjes",
"Configure the database" : "Konfiguro database-in",
+ "Only %s is available." : "Vetëm %s është e disponueshme.",
"Database user" : "Përdoruesi i database-it",
"Database password" : "Kodi i database-it",
"Database name" : "Emri i database-it",
"Database tablespace" : "Tablespace-i i database-it",
"Database host" : "Pozicioni (host) i database-it",
+ "SQLite will be used as database. For larger installations we recommend to change this." : "SQLite do të përdoret si bazë të dhënash. Për instalime më të mëdha ju rekomandojmë që ta ndryshoni këtë.",
"Finish setup" : "Mbaro setup-in",
+ "Finishing …" : "Duke përfunduar ...",
+ "This application requires JavaScript for correct operation. Please <a href=\"http://enable-javascript.com/\" target=\"_blank\">enable JavaScript</a> and reload the page." : "Këtij aplikacioni i nevojitet JavaScript për funksionim të rregullt. Ju lutem <a href=\"http://enable-javascript.com/\" target=\"_blank\">aktivizoni JavaScript</a> dhe ringarkoni faqen.",
"%s is available. Get more information on how to update." : "%s është i disponueshëm. Merrni më shumë informacione mbi azhurnimin.",
"Log out" : "Dalje",
+ "Server side authentication failed!" : "Verifikimi në krahun e serverit dështoi!",
+ "Please contact your administrator." : "Ju lutem kontaktoni administratorin.",
+ "Forgot your password? Reset it!" : "Keni harruar fjalëkalimin tuaj? Rivendoseni!",
"remember" : "kujto",
"Log in" : "Hyrje",
- "Alternative Logins" : "Hyrje alternative"
+ "Alternative Logins" : "Hyrje alternative",
+ "Hey there,<br><br>just letting you know that %s shared <strong>%s</strong> with you.<br><a href=\"%s\">View it!</a><br><br>" : "Tungjatjeta,<br><br>dëshirojmë t'ju njoftojmë se %s ka ndarë <strong>%s</strong> me ju.<br><a href=\"%s\">Klikoni këtu për ta shikuar!</a><br>",
+ "This ownCloud instance is currently in single user mode." : "Kjo instancë ownCloud është aktualisht në gjendje me përdorues të vetëm.",
+ "This means only administrators can use the instance." : "Kjo dmth që vetëm administratorët mund të shfrytëzojnë instancën.",
+ "Contact your system administrator if this message persists or appeared unexpectedly." : "Kontaktoni administratorin e sistemit nëse ky mesazh vazhdon ose është shfaqur papritmas.",
+ "Thank you for your patience." : "Ju faleminderit për durimin tuaj.",
+ "You are accessing the server from an untrusted domain." : "Ju po qaseni në server nga një domain jo i besuar.",
+ "Please contact your administrator. If you are an administrator of this instance, configure the \"trusted_domain\" setting in config/config.php. An example configuration is provided in config/config.sample.php." : "Ju lutem kontaktoni me administratorin. Nëse jeni administrator i kësaj instance, konfiguroni parametrin \"domain i besuar\" në config/config.php . Një konfigurim shembull është dhënë në config/config.sample.php",
+ "Depending on your configuration, as an administrator you might also be able to use the button below to trust this domain." : "Në varësi të konfigurimit tuaj, ju si administrator mundet gjithashtu të jeni i aftë të përdorni butonin e mëposhtëm për ti dhënë besim këtij domain.",
+ "Add \"%s\" as trusted domain" : "Shtoni \"%s\" si domain të besuar",
+ "%s will be updated to version %s." : "%s to të përditësohet në versionin %s.",
+ "The following apps will be disabled:" : "Keto aplikacione do të bllokohen:",
+ "The theme %s has been disabled." : "Tema %s u bllokua.",
+ "Please make sure that the database, the config folder and the data folder have been backed up before proceeding." : "Ju lutem sigurohuni që bazës së të dhënave, dosjes së konfigurimit dhe dosjes së të dhënave ti jetë bërë një kopje rezervë përpara se të vazhdoni më tutje.",
+ "Start update" : "Fillo përditësimin.",
+ "To avoid timeouts with larger installations, you can instead run the following command from your installation directory:" : "Për të shmangur momente bllokimi gjatë punës me instalime të mëdha, në vend të kësaj ju mund të kryeni komandën e mëposhtme nga dosja juaj e instalimit:",
+ "This %s instance is currently being updated, which may take a while." : "Kjo instancë %s është në proces përditësimi, i cili mund të zgjasë pak kohë.",
+ "This page will refresh itself when the %s instance is available again." : "Kjo faqe do të ringarkohet automatikisht kur instanca %s të jetë sërish e disponueshme."
},
"nplurals=2; plural=(n != 1);");
diff --git a/core/l10n/sq.json b/core/l10n/sq.json
index e183fafb33c..3cf8cae21d3 100644
--- a/core/l10n/sq.json
+++ b/core/l10n/sq.json
@@ -33,14 +33,38 @@
"December" : "Dhjetor",
"Settings" : "Parametra",
"Saving..." : "Duke ruajtur...",
+ "Couldn't send reset email. Please contact your administrator." : "Emaili i rivendosjes nuk mund të dërgohet. Ju lutem kontaktoni me administratorin.",
+ "The link to reset your password has been sent to your email. If you do not receive it within a reasonable amount of time, check your spam/junk folders.<br>If it is not there ask your local administrator." : "Lidhja për rivendosjen e kodit tuaj u dërgua tek email-i juaj. Nëse nuk e merrni brenda një kohe të arsyeshme, kontrolloni dosjet e postës së padëshirueshme spam.<br>Nëse nuk është as aty, pyesni administratorin tuaj.",
+ "Your files are encrypted. If you haven't enabled the recovery key, there will be no way to get your data back after your password is reset.<br />If you are not sure what to do, please contact your administrator before you continue. <br />Do you really want to continue?" : "Skedarët tuaj janë të kodifikuar. Nëse nuk keni aktivizuar çelësin e restaurimit, të dhënat tuaja nuk do të jenë të arritshme pasi të keni rivendosur kodin.<br />Nëse nuk jeni i sigurt, ju lutemi kontaktoni administratorin tuaj përpara se të vazhdoni. Jeni i sigurt që dëshironi të vazhdoni?",
+ "I know what I'm doing" : "Unë e di se çfarë po bëj",
+ "Password can not be changed. Please contact your administrator." : "Fjalëkalimi nuk mund të ndryshohet. Ju lutem kontaktoni me administratorin.",
"No" : "Jo",
"Yes" : "Po",
"Choose" : "Zgjidh",
+ "Error loading file picker template: {error}" : "Gabim gjatë ngarkimit të shabllonit të zgjedhësit të skedarëve: {error}",
"Ok" : "Në rregull",
- "_{count} file conflict_::_{count} file conflicts_" : ["",""],
+ "Error loading message template: {error}" : "Gabim gjatë ngarkimit të shabllonit të mesazheve: {error}",
+ "_{count} file conflict_::_{count} file conflicts_" : ["{count} konflikt skedari","{count} konflikte skedarësh"],
+ "One file conflict" : "Një konflikt skedari",
+ "New Files" : "Skedarë të rinj",
+ "Already existing files" : "Skedarë ekzistues",
+ "Which files do you want to keep?" : "Cilët skedarë dëshironi të mbani?",
+ "If you select both versions, the copied file will have a number added to its name." : "Nëse i zgjidhni të dyja versionet, skedarit të kopjuar do ti shtohet një numër në emrin e tij.",
"Cancel" : "Anulo",
+ "Continue" : "Vazhdo",
+ "(all selected)" : "(të gjitha të zgjedhura)",
+ "({count} selected)" : "({count} të zgjedhur)",
+ "Error loading file exists template" : "Gabim gjatë ngarkimit të shabllonit të skedarit ekzistues",
+ "Very weak password" : "Fjalëkalim shumë i dobët",
+ "Weak password" : "Fjalëkalim i dobët",
+ "So-so password" : "Fjalëkalim i pranueshëm",
+ "Good password" : "Fjalëkalim i mirë",
+ "Strong password" : "Fjalëkalim shumë i mirë",
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." : "Web Serveri juaj nuk është konfigurar sic duhet në mënyre që të lejojë sinkronizimin e skedare pasi ndërfaqja WevDAV duket të jetë e demtuar.",
+ "This server has no working internet connection. This means that some of the features like mounting of external storage, notifications about updates or installation of 3rd party apps don´t work. Accessing files from remote and sending of notification emails might also not work. We suggest to enable internet connection for this server if you want to have all features." : "Ky server nuk ka lidhje në internet. Kjo dmth qe disa nga funksionalitetet si të montohet ruajtje e jashtme, njoftime mbi versione të reja apo instalimi i aplikacioneve nga palë të 3ta nuk do të funksionojnë. Qasja në distancë e skedarëve dhe dërgimi i emaileve njoftues gjithashtu mund të mos funksionojnë. Ju sugjerojmë që të aktivizoni lidhjen në internet për këtë server nëse dëshironi ti keni të gjitha funksionalitetet.",
+ "Error occurred while checking server setup" : "Gabim gjatë kontrollit të konfigurimit të serverit",
"Shared" : "Ndarë",
+ "Shared with {recipients}" : "Ndarë me {recipients}",
"Share" : "Nda",
"Error" : "Veprim i gabuar",
"Error while sharing" : "Veprim i gabuar gjatë ndarjes",
@@ -48,16 +72,22 @@
"Error while changing permissions" : "Veprim i gabuar gjatë ndryshimit të lejeve",
"Shared with you and the group {group} by {owner}" : "Ndarë me ju dhe me grupin {group} nga {owner}",
"Shared with you by {owner}" : "Ndarë me ju nga {owner}",
+ "Share with user or group …" : "Ndajeni me përdorues ose grup ...",
+ "Share link" : "Ndaje lidhjen",
+ "The public link will expire no later than {days} days after it is created" : "Lidhja publike do të skadojë jo më vonë se {days} ditë pas krijimit",
"Password protect" : "Mbro me kod",
+ "Choose a password for the public link" : "Zgjidhni një fjalëkalim për lidhjen publike",
"Allow Public Upload" : "Lejo Ngarkimin Publik",
"Email link to person" : "Dërgo email me lidhjen",
"Send" : "Dërgo",
"Set expiration date" : "Cakto datën e përfundimit",
"Expiration date" : "Data e përfundimit",
+ "Adding user..." : "Duke shtuar përdoruesin ...",
"group" : "grupi",
"Resharing is not allowed" : "Rindarja nuk lejohet",
"Shared in {item} with {user}" : "Ndarë në {item} me {user}",
"Unshare" : "Hiq ndarjen",
+ "notify by email" : "njofto me email",
"can share" : "mund të ndajnë",
"can edit" : "mund të ndryshosh",
"access control" : "kontrollimi i hyrjeve",
@@ -69,21 +99,64 @@
"Error setting expiration date" : "Veprim i gabuar gjatë caktimit të datës së përfundimit",
"Sending ..." : "Duke dërguar...",
"Email sent" : "Email-i u dërgua",
+ "Warning" : "Kujdes",
"The object type is not specified." : "Nuk është specifikuar tipi i objektit.",
+ "Enter new" : "Jep të re",
"Delete" : "Elimino",
"Add" : "Shto",
- "_download %n file_::_download %n files_" : ["",""],
+ "Edit tags" : "Modifiko tag",
+ "Error loading dialog template: {error}" : "Gabim gjatë ngarkimit të shabllonit: {error}",
+ "No tags selected for deletion." : "Nuk është zgjedhur asnjë tag për fshirje.",
+ "unknown text" : "tekst i panjohur",
+ "Hello world!" : "Përshendetje të gjithëve!",
+ "sunny" : "diell",
+ "Hello {name}, the weather is {weather}" : "Përshëndetje {name}, koha është {weather}",
+ "_download %n file_::_download %n files_" : ["shkarko %n skedar","shkarko %n skedarë"],
+ "Updating {productName} to version {version}, this may take a while." : "Po përditësoj {productName} në versionin {version}, kjo mund të zgjasë pak.",
+ "Please reload the page." : "Ju lutem ringarkoni faqen.",
+ "The update was unsuccessful." : "Përditësimi nuk rezultoi me sukses.",
"The update was successful. Redirecting you to ownCloud now." : "Azhurnimi u krye. Tani do t'ju kaloj tek ownCloud-i.",
+ "Couldn't reset password because the token is invalid" : "Nuk mund të rivendos fjalëkalimin sepse shenja është e pavlefshme.",
+ "Couldn't send reset email. Please make sure your username is correct." : "Emaili i rivendosjes nuk mund të dërgohet. Ju lutem sigurohuni që përdoruesi juaj është i saktë.",
+ "Couldn't send reset email because there is no email address for this username. Please contact your administrator." : "Emaili i rivendosjes nuk mund të dërgohet sepse nuk ekziston asnjë adresë email për këtë përdorues. Ju lutem kontaktoni me administratorin.",
"%s password reset" : "Kodi i %s -it u rivendos",
"Use the following link to reset your password: {link}" : "Përdorni lidhjen në vijim për të rivendosur kodin: {link}",
"New password" : "Kodi i ri",
+ "New Password" : "Fjalëkalim i ri",
"Reset password" : "Rivendos kodin",
+ "Mac OS X is not supported and %s will not work properly on this platform. Use it at your own risk! " : "Mac OS X nuk është i mbështetur dhe %s nuk do të funksionojë si duhet në këtë platformë. Përdoreni nën përgjegjësinë tuaj!",
+ "For the best results, please consider using a GNU/Linux server instead." : "Për të arritur rezultatet më të mira të mundshme, ju lutem më mirë konsideroni përdorimin e një serveri GNU/Linux.",
"Personal" : "Personale",
"Users" : "Përdoruesit",
"Apps" : "App",
"Admin" : "Admin",
"Help" : "Ndihmë",
+ "Error loading tags" : "Gabim gjatë ngarkimit të etiketave.",
+ "Tag already exists" : "Etiketa ekziston",
+ "Error deleting tag(s)" : "Gabim gjatë fshirjes së etiketës(ave)",
+ "Error tagging" : "Gabim etiketimi",
+ "Error untagging" : "Gabim në heqjen e etiketës",
+ "Error favoriting" : "Gabim në ruajtjen si të preferuar",
+ "Error unfavoriting" : "Gabim në heqjen nga të preferuarat",
"Access forbidden" : "Ndalohet hyrja",
+ "File not found" : "Skedari nuk mund të gjendet",
+ "The specified document has not been found on the server." : "Dokumenti i përcaktuar nuk mund të gjendet në server.",
+ "You can click here to return to %s." : "Ju mund të klikoni këtu për tu kthyer në %s.",
+ "Hey there,\n\njust letting you know that %s shared %s with you.\nView it: %s\n\n" : "Tungjatjeta,\n\nju njoftojmë se %s ka ndarë %s me ju.\nShikojeni në: %s\n\n",
+ "The share will expire on %s." : "Ndarja do të skadojë në %s.",
+ "Cheers!" : "Gjithë të mirat",
+ "Internal Server Error" : "Gabim i brendshëm në server",
+ "The server encountered an internal error and was unable to complete your request." : "Serveri u përball me një gabim të brendshem dhe nuk mundet të mbarojë detyrën që i keni ngarkuar.",
+ "Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report." : "Ju lutem kontaktoni me administratorin e serverit nëse ky gabim shfaqet herë të tjera, ju lutem përfshini dhe detajet e mëposhtme teknike në raportin tuaj.",
+ "More details can be found in the server log." : "Detaje të mëtejshme mund të gjenden në listën e veprimeve të serverit.",
+ "Technical details" : "Detaje teknike",
+ "Remote Address: %s" : "Adresa tjetër: %s",
+ "Request ID: %s" : "ID e kërkesës: %s",
+ "Code: %s" : "Kodi: %s",
+ "Message: %s" : "Mesazhi: %s",
+ "File: %s" : "Skedari: %s",
+ "Line: %s" : "Rreshti: %s",
+ "Trace" : "Gjurmim",
"Security Warning" : "Paralajmërim sigurie",
"Your PHP version is vulnerable to the NULL Byte attack (CVE-2006-7243)" : "Versioni juaj i PHP-së është i cënueshëm nga sulmi NULL Byte (CVE-2006-7243)",
"Please update your PHP installation to use %s securely." : "Ju lutem azhurnoni instalimin tuaj të PHP-së që të përdorni %s -in në mënyrë të sigurt.",
@@ -92,18 +165,43 @@
"Create an <strong>admin account</strong>" : "Krijo një <strong>llogari administruesi</strong>",
"Username" : "Përdoruesi",
"Password" : "Kodi",
+ "Storage & database" : "Ruajtja dhe baza e të dhënave",
"Data folder" : "Emri i dosjes",
"Configure the database" : "Konfiguro database-in",
+ "Only %s is available." : "Vetëm %s është e disponueshme.",
"Database user" : "Përdoruesi i database-it",
"Database password" : "Kodi i database-it",
"Database name" : "Emri i database-it",
"Database tablespace" : "Tablespace-i i database-it",
"Database host" : "Pozicioni (host) i database-it",
+ "SQLite will be used as database. For larger installations we recommend to change this." : "SQLite do të përdoret si bazë të dhënash. Për instalime më të mëdha ju rekomandojmë që ta ndryshoni këtë.",
"Finish setup" : "Mbaro setup-in",
+ "Finishing …" : "Duke përfunduar ...",
+ "This application requires JavaScript for correct operation. Please <a href=\"http://enable-javascript.com/\" target=\"_blank\">enable JavaScript</a> and reload the page." : "Këtij aplikacioni i nevojitet JavaScript për funksionim të rregullt. Ju lutem <a href=\"http://enable-javascript.com/\" target=\"_blank\">aktivizoni JavaScript</a> dhe ringarkoni faqen.",
"%s is available. Get more information on how to update." : "%s është i disponueshëm. Merrni më shumë informacione mbi azhurnimin.",
"Log out" : "Dalje",
+ "Server side authentication failed!" : "Verifikimi në krahun e serverit dështoi!",
+ "Please contact your administrator." : "Ju lutem kontaktoni administratorin.",
+ "Forgot your password? Reset it!" : "Keni harruar fjalëkalimin tuaj? Rivendoseni!",
"remember" : "kujto",
"Log in" : "Hyrje",
- "Alternative Logins" : "Hyrje alternative"
+ "Alternative Logins" : "Hyrje alternative",
+ "Hey there,<br><br>just letting you know that %s shared <strong>%s</strong> with you.<br><a href=\"%s\">View it!</a><br><br>" : "Tungjatjeta,<br><br>dëshirojmë t'ju njoftojmë se %s ka ndarë <strong>%s</strong> me ju.<br><a href=\"%s\">Klikoni këtu për ta shikuar!</a><br>",
+ "This ownCloud instance is currently in single user mode." : "Kjo instancë ownCloud është aktualisht në gjendje me përdorues të vetëm.",
+ "This means only administrators can use the instance." : "Kjo dmth që vetëm administratorët mund të shfrytëzojnë instancën.",
+ "Contact your system administrator if this message persists or appeared unexpectedly." : "Kontaktoni administratorin e sistemit nëse ky mesazh vazhdon ose është shfaqur papritmas.",
+ "Thank you for your patience." : "Ju faleminderit për durimin tuaj.",
+ "You are accessing the server from an untrusted domain." : "Ju po qaseni në server nga një domain jo i besuar.",
+ "Please contact your administrator. If you are an administrator of this instance, configure the \"trusted_domain\" setting in config/config.php. An example configuration is provided in config/config.sample.php." : "Ju lutem kontaktoni me administratorin. Nëse jeni administrator i kësaj instance, konfiguroni parametrin \"domain i besuar\" në config/config.php . Një konfigurim shembull është dhënë në config/config.sample.php",
+ "Depending on your configuration, as an administrator you might also be able to use the button below to trust this domain." : "Në varësi të konfigurimit tuaj, ju si administrator mundet gjithashtu të jeni i aftë të përdorni butonin e mëposhtëm për ti dhënë besim këtij domain.",
+ "Add \"%s\" as trusted domain" : "Shtoni \"%s\" si domain të besuar",
+ "%s will be updated to version %s." : "%s to të përditësohet në versionin %s.",
+ "The following apps will be disabled:" : "Keto aplikacione do të bllokohen:",
+ "The theme %s has been disabled." : "Tema %s u bllokua.",
+ "Please make sure that the database, the config folder and the data folder have been backed up before proceeding." : "Ju lutem sigurohuni që bazës së të dhënave, dosjes së konfigurimit dhe dosjes së të dhënave ti jetë bërë një kopje rezervë përpara se të vazhdoni më tutje.",
+ "Start update" : "Fillo përditësimin.",
+ "To avoid timeouts with larger installations, you can instead run the following command from your installation directory:" : "Për të shmangur momente bllokimi gjatë punës me instalime të mëdha, në vend të kësaj ju mund të kryeni komandën e mëposhtme nga dosja juaj e instalimit:",
+ "This %s instance is currently being updated, which may take a while." : "Kjo instancë %s është në proces përditësimi, i cili mund të zgjasë pak kohë.",
+ "This page will refresh itself when the %s instance is available again." : "Kjo faqe do të ringarkohet automatikisht kur instanca %s të jetë sërish e disponueshme."
},"pluralForm" :"nplurals=2; plural=(n != 1);"
} \ No newline at end of file
diff --git a/lib/l10n/fr.js b/lib/l10n/fr.js
index ec7e949abcc..18a20a37148 100644
--- a/lib/l10n/fr.js
+++ b/lib/l10n/fr.js
@@ -102,7 +102,7 @@ OC.L10N.register(
"Cannot create \"data\" directory (%s)" : "Impossible de créer le répertoire \"data\" (%s)",
"This can usually be fixed by <a href=\"%s\" target=\"_blank\">giving the webserver write access to the root directory</a>." : "Ce problème est généralement résolu <a href=\"%s\" target=\"_blank\">en donnant au serveur web un accès en écriture au répertoire racine</a>.",
"Setting locale to %s failed" : "Le choix de la langue pour %s a échoué",
- "Please install one of these locales on your system and restart your webserver." : "Veuillez installer l'une de ces langues sur votre système et redémarrer votre serveur web.",
+ "Please install one of these locales on your system and restart your webserver." : "Veuillez installer l'un de ces paramètres régionaux sur votre système et redémarrer votre serveur web.",
"Please ask your server administrator to install the module." : "Veuillez demander à votre administrateur d’installer le module.",
"PHP module %s not installed." : "Le module PHP %s n’est pas installé.",
"PHP %s or higher is required." : "PHP %s ou supérieur est requis.",
diff --git a/lib/l10n/fr.json b/lib/l10n/fr.json
index ecba239d076..b8cecae6c5d 100644
--- a/lib/l10n/fr.json
+++ b/lib/l10n/fr.json
@@ -100,7 +100,7 @@
"Cannot create \"data\" directory (%s)" : "Impossible de créer le répertoire \"data\" (%s)",
"This can usually be fixed by <a href=\"%s\" target=\"_blank\">giving the webserver write access to the root directory</a>." : "Ce problème est généralement résolu <a href=\"%s\" target=\"_blank\">en donnant au serveur web un accès en écriture au répertoire racine</a>.",
"Setting locale to %s failed" : "Le choix de la langue pour %s a échoué",
- "Please install one of these locales on your system and restart your webserver." : "Veuillez installer l'une de ces langues sur votre système et redémarrer votre serveur web.",
+ "Please install one of these locales on your system and restart your webserver." : "Veuillez installer l'un de ces paramètres régionaux sur votre système et redémarrer votre serveur web.",
"Please ask your server administrator to install the module." : "Veuillez demander à votre administrateur d’installer le module.",
"PHP module %s not installed." : "Le module PHP %s n’est pas installé.",
"PHP %s or higher is required." : "PHP %s ou supérieur est requis.",
diff --git a/lib/l10n/sk_SK.js b/lib/l10n/sk_SK.js
index a2e87c5b631..ec902af2641 100644
--- a/lib/l10n/sk_SK.js
+++ b/lib/l10n/sk_SK.js
@@ -17,6 +17,8 @@ OC.L10N.register(
"No app name specified" : "Nešpecifikované meno aplikácie",
"Unknown filetype" : "Neznámy typ súboru",
"Invalid image" : "Chybný obrázok",
+ "Database Error" : "Error databázy",
+ "Please contact your system administrator." : "Prosím kontaktujte administrátora.",
"web services under your control" : "webové služby pod Vašou kontrolou",
"App directory already exists" : "Aplikačný priečinok už existuje",
"Can't create app folder. Please fix permissions. %s" : "Nemožno vytvoriť aplikačný priečinok. Prosím upravte povolenia. %s",
diff --git a/lib/l10n/sk_SK.json b/lib/l10n/sk_SK.json
index 84ab8c4a007..e2c219d5a1c 100644
--- a/lib/l10n/sk_SK.json
+++ b/lib/l10n/sk_SK.json
@@ -15,6 +15,8 @@
"No app name specified" : "Nešpecifikované meno aplikácie",
"Unknown filetype" : "Neznámy typ súboru",
"Invalid image" : "Chybný obrázok",
+ "Database Error" : "Error databázy",
+ "Please contact your system administrator." : "Prosím kontaktujte administrátora.",
"web services under your control" : "webové služby pod Vašou kontrolou",
"App directory already exists" : "Aplikačný priečinok už existuje",
"Can't create app folder. Please fix permissions. %s" : "Nemožno vytvoriť aplikačný priečinok. Prosím upravte povolenia. %s",
diff --git a/lib/l10n/sl.js b/lib/l10n/sl.js
index aa783fbd69e..8277186b0b3 100644
--- a/lib/l10n/sl.js
+++ b/lib/l10n/sl.js
@@ -17,6 +17,8 @@ OC.L10N.register(
"No app name specified" : "Ni podanega imena programa",
"Unknown filetype" : "Neznana vrsta datoteke",
"Invalid image" : "Neveljavna slika",
+ "Database Error" : "Napaka podatkovne zbirke",
+ "Please contact your system administrator." : "Stopite v stik s skrbnikom sistema.",
"web services under your control" : "spletne storitve pod vašim nadzorom",
"App directory already exists" : "Programska mapa že obstaja",
"Can't create app folder. Please fix permissions. %s" : "Programske mape ni mogoče ustvariti. Ni ustreznih dovoljenj. %s",
diff --git a/lib/l10n/sl.json b/lib/l10n/sl.json
index c0cbf41f719..a5d22213f1d 100644
--- a/lib/l10n/sl.json
+++ b/lib/l10n/sl.json
@@ -15,6 +15,8 @@
"No app name specified" : "Ni podanega imena programa",
"Unknown filetype" : "Neznana vrsta datoteke",
"Invalid image" : "Neveljavna slika",
+ "Database Error" : "Napaka podatkovne zbirke",
+ "Please contact your system administrator." : "Stopite v stik s skrbnikom sistema.",
"web services under your control" : "spletne storitve pod vašim nadzorom",
"App directory already exists" : "Programska mapa že obstaja",
"Can't create app folder. Please fix permissions. %s" : "Programske mape ni mogoče ustvariti. Ni ustreznih dovoljenj. %s",
diff --git a/lib/l10n/sq.js b/lib/l10n/sq.js
index f547c7b9104..c3be28ef1c6 100644
--- a/lib/l10n/sq.js
+++ b/lib/l10n/sq.js
@@ -6,6 +6,7 @@ OC.L10N.register(
"Settings" : "Parametra",
"Users" : "Përdoruesit",
"Admin" : "Admin",
+ "Recommended" : "E rekomanduar",
"Unknown filetype" : "Tip i panjohur skedari",
"Invalid image" : "Imazh i pavlefshëm",
"web services under your control" : "shërbime web nën kontrollin tënd",
diff --git a/lib/l10n/sq.json b/lib/l10n/sq.json
index 8f2d062b91b..cd10a590bd1 100644
--- a/lib/l10n/sq.json
+++ b/lib/l10n/sq.json
@@ -4,6 +4,7 @@
"Settings" : "Parametra",
"Users" : "Përdoruesit",
"Admin" : "Admin",
+ "Recommended" : "E rekomanduar",
"Unknown filetype" : "Tip i panjohur skedari",
"Invalid image" : "Imazh i pavlefshëm",
"web services under your control" : "shërbime web nën kontrollin tënd",
diff --git a/lib/private/app.php b/lib/private/app.php
index bc9ca0351ea..8e36d43bfb1 100644
--- a/lib/private/app.php
+++ b/lib/private/app.php
@@ -635,63 +635,10 @@ class OC_App {
}
$file = self::getAppPath($appId) . '/appinfo/info.xml';
}
- $data = array();
- if (!file_exists($file)) {
- return null;
- }
- $content = @file_get_contents($file);
- if (!$content) {
- return null;
- }
- $xml = new SimpleXMLElement($content);
- $data['info'] = array();
- $data['remote'] = array();
- $data['public'] = array();
- foreach ($xml->children() as $child) {
- /**
- * @var $child SimpleXMLElement
- */
- if ($child->getName() == 'remote') {
- foreach ($child->children() as $remote) {
- /**
- * @var $remote SimpleXMLElement
- */
- $data['remote'][$remote->getName()] = (string)$remote;
- }
- } elseif ($child->getName() == 'public') {
- foreach ($child->children() as $public) {
- /**
- * @var $public SimpleXMLElement
- */
- $data['public'][$public->getName()] = (string)$public;
- }
- } elseif ($child->getName() == 'types') {
- $data['types'] = array();
- foreach ($child->children() as $type) {
- /**
- * @var $type SimpleXMLElement
- */
- $data['types'][] = $type->getName();
- }
- } elseif ($child->getName() == 'description') {
- $xml = (string)$child->asXML();
- $data[$child->getName()] = substr($xml, 13, -14); //script <description> tags
- } elseif ($child->getName() == 'documentation') {
- foreach ($child as $subChild) {
- $url = (string) $subChild;
-
- // If it is not an absolute URL we assume it is a key
- // i.e. admin-ldap will get converted to go.php?to=admin-ldap
- if(!\OC::$server->getHTTPHelper()->isHTTPURL($url)) {
- $url = OC_Helper::linkToDocs($url);
- }
- $data["documentation"][$subChild->getName()] = $url;
- }
- } else {
- $data[$child->getName()] = (string)$child;
- }
- }
+ $parser = new \OC\App\InfoParser(\OC::$server->getHTTPHelper(), \OC::$server->getURLGenerator());
+ $data = $parser->parse($file);
+
self::$appInfo[$appId] = $data;
return $data;
diff --git a/lib/private/app/infoparser.php b/lib/private/app/infoparser.php
new file mode 100644
index 00000000000..b4bdbea5c04
--- /dev/null
+++ b/lib/private/app/infoparser.php
@@ -0,0 +1,84 @@
+<?php
+ /**
+ * @author Thomas Müller
+ * @copyright 2014 Thomas Müller deepdiver@owncloud.com
+ *
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+namespace OC\App;
+
+use OCP\IURLGenerator;
+
+class InfoParser {
+ /**
+ * @var \OC\HTTPHelper
+ */
+ private $httpHelper;
+
+ /**
+ * @var IURLGenerator
+ */
+ private $urlGenerator;
+
+ /**
+ * @param \OC\HTTPHelper $httpHelper
+ * @param IURLGenerator $urlGenerator
+ */
+ public function __construct(\OC\HTTPHelper $httpHelper, IURLGenerator $urlGenerator) {
+ $this->httpHelper = $httpHelper;
+ $this->urlGenerator = $urlGenerator;
+ }
+
+ /**
+ * @param string $file the xml file to be loaded
+ * @return null|array where null is an indicator for an error
+ */
+ public function parse($file) {
+ if (!file_exists($file)) {
+ return null;
+ }
+
+ $loadEntities = libxml_disable_entity_loader(false);
+ $xml = @simplexml_load_file($file);
+ libxml_disable_entity_loader($loadEntities);
+ if ($xml == false) {
+ return null;
+ }
+ $array = json_decode(json_encode((array)$xml), TRUE);
+ if (is_null($array)) {
+ return null;
+ }
+ if (!array_key_exists('info', $array)) {
+ $array['info'] = array();
+ }
+ if (!array_key_exists('remote', $array)) {
+ $array['remote'] = array();
+ }
+ if (!array_key_exists('public', $array)) {
+ $array['public'] = array();
+ }
+
+ if (array_key_exists('documentation', $array)) {
+ foreach ($array['documentation'] as $key => $url) {
+ // If it is not an absolute URL we assume it is a key
+ // i.e. admin-ldap will get converted to go.php?to=admin-ldap
+ if (!$this->httpHelper->isHTTPURL($url)) {
+ $url = $this->urlGenerator->linkToDocs($url);
+ }
+
+ $array['documentation'][$key] = $url;
+ }
+ }
+ if (array_key_exists('types', $array)) {
+ foreach ($array['types'] as $type => $v) {
+ unset($array['types'][$type]);
+ $array['types'][] = $type;
+ }
+ }
+
+ return $array;
+ }
+}
diff --git a/lib/private/appframework/core/api.php b/lib/private/appframework/core/api.php
index 279f4bf97f7..f68c677d106 100644
--- a/lib/private/appframework/core/api.php
+++ b/lib/private/appframework/core/api.php
@@ -49,6 +49,7 @@ class API implements IApi{
/**
* Gets the userid of the current user
* @return string the user id of the current user
+ * @deprecated Use \OC::$server->getUserSession()->getUser()->getUID()
*/
public function getUserId(){
return \OCP\User::getUser();
@@ -112,6 +113,7 @@ class API implements IApi{
/**
* used to return and open a new event source
* @return \OCP\IEventSource a new open EventSource class
+ * @deprecated Use \OC::$server->createEventSource();
*/
public function openEventSource(){
return \OC::$server->createEventSource();
@@ -159,6 +161,7 @@ class API implements IApi{
* @param string $className full namespace and class name of the class
* @param string $methodName the name of the static method that should be
* called
+ * @deprecated Use \OC::$server->getJobList()->add();
*/
public function addRegularTask($className, $methodName) {
\OCP\Backgroundjob::addRegularTask($className, $methodName);
diff --git a/lib/private/appframework/routing/routeconfig.php b/lib/private/appframework/routing/routeconfig.php
index 91687b9c83c..9816b062b8d 100644
--- a/lib/private/appframework/routing/routeconfig.php
+++ b/lib/private/appframework/routing/routeconfig.php
@@ -69,6 +69,12 @@ class RouteConfig {
$simpleRoutes = isset($routes['routes']) ? $routes['routes'] : array();
foreach ($simpleRoutes as $simpleRoute) {
$name = $simpleRoute['name'];
+ $postfix = '';
+
+ if (isset($simpleRoute['postfix'])) {
+ $postfix = $simpleRoute['postfix'];
+ }
+
$url = $simpleRoute['url'];
$verb = isset($simpleRoute['verb']) ? strtoupper($simpleRoute['verb']) : 'GET';
@@ -84,7 +90,7 @@ class RouteConfig {
// register the route
$handler = new RouteActionHandler($this->container, $controllerName, $actionName);
- $router = $this->router->create($this->appName.'.'.$controller.'.'.$action, $url)
+ $router = $this->router->create($this->appName.'.'.$controller.'.'.$action . $postfix, $url)
->method($verb)
->action($handler);
diff --git a/lib/private/contacts/localaddressbook.php b/lib/private/contacts/localaddressbook.php
index 483bbee83f8..91ddb5798f2 100644
--- a/lib/private/contacts/localaddressbook.php
+++ b/lib/private/contacts/localaddressbook.php
@@ -91,7 +91,7 @@ class LocalAddressBook implements \OCP\IAddressBook {
* @return int
*/
public function getPermissions() {
- return \OCP\PERMISSION_READ;
+ return \OCP\Constants::PERMISSION_READ;
}
/**
diff --git a/lib/private/contactsmanager.php b/lib/private/contactsmanager.php
index 338cc048651..737fc4f0e3a 100644
--- a/lib/private/contactsmanager.php
+++ b/lib/private/contactsmanager.php
@@ -62,7 +62,7 @@ namespace OC {
return null;
}
- if ($addressBook->getPermissions() & \OCP\PERMISSION_DELETE) {
+ if ($addressBook->getPermissions() & \OCP\Constants::PERMISSION_DELETE) {
return null;
}
@@ -83,7 +83,7 @@ namespace OC {
return null;
}
- if ($addressBook->getPermissions() & \OCP\PERMISSION_CREATE) {
+ if ($addressBook->getPermissions() & \OCP\Constants::PERMISSION_CREATE) {
return null;
}
diff --git a/lib/private/db/connectionfactory.php b/lib/private/db/connectionfactory.php
index f6253e09b95..58043b30440 100644
--- a/lib/private/db/connectionfactory.php
+++ b/lib/private/db/connectionfactory.php
@@ -90,7 +90,8 @@ class ConnectionFactory {
$eventManager->addEventSubscriber(new \Doctrine\DBAL\Event\Listeners\OracleSessionInit);
break;
case 'sqlite3':
- $eventManager->addEventSubscriber(new SQLiteSessionInit);
+ $journalMode = $additionalConnectionParams['sqlite.journal_mode'];
+ $eventManager->addEventSubscriber(new SQLiteSessionInit(true, $journalMode));
break;
}
$connection = \Doctrine\DBAL\DriverManager::getConnection(
@@ -153,6 +154,7 @@ class ConnectionFactory {
}
$connectionParams['tablePrefix'] = $config->getSystemValue('dbtableprefix', 'oc_');
+ $connectionParams['sqlite.journal_mode'] = $config->getSystemValue('sqlite.journal_mode', 'WAL');
//additional driver options, eg. for mysql ssl
$driverOptions = $config->getSystemValue('dbdriveroptions', null);
diff --git a/lib/private/db/sqlitesessioninit.php b/lib/private/db/sqlitesessioninit.php
index 7e1166be95b..1fff22b883a 100644
--- a/lib/private/db/sqlitesessioninit.php
+++ b/lib/private/db/sqlitesessioninit.php
@@ -19,12 +19,19 @@ class SQLiteSessionInit implements EventSubscriber {
private $caseSensitiveLike;
/**
+ * @var string
+ */
+ private $journalMode;
+
+ /**
* Configure case sensitive like for each connection
*
* @param bool $caseSensitiveLike
+ * @param string $journalMode
*/
- public function __construct($caseSensitiveLike = true) {
+ public function __construct($caseSensitiveLike, $journalMode) {
$this->caseSensitiveLike = $caseSensitiveLike;
+ $this->journalMode = $journalMode;
}
/**
@@ -34,6 +41,7 @@ class SQLiteSessionInit implements EventSubscriber {
public function postConnect(ConnectionEventArgs $args) {
$sensitive = ($this->caseSensitiveLike) ? 'true' : 'false';
$args->getConnection()->executeUpdate('PRAGMA case_sensitive_like = ' . $sensitive);
+ $args->getConnection()->executeUpdate('PRAGMA journal_mode = ' . $this->journalMode);
}
public function getSubscribedEvents() {
diff --git a/lib/private/files/fileinfo.php b/lib/private/files/fileinfo.php
index d6d6a245e44..8bab51f0737 100644
--- a/lib/private/files/fileinfo.php
+++ b/lib/private/files/fileinfo.php
@@ -173,14 +173,14 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess {
* @return bool
*/
public function isReadable() {
- return $this->checkPermissions(\OCP\PERMISSION_READ);
+ return $this->checkPermissions(\OCP\Constants::PERMISSION_READ);
}
/**
* @return bool
*/
public function isUpdateable() {
- return $this->checkPermissions(\OCP\PERMISSION_UPDATE);
+ return $this->checkPermissions(\OCP\Constants::PERMISSION_UPDATE);
}
/**
@@ -189,21 +189,21 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess {
* @return bool
*/
public function isCreatable() {
- return $this->checkPermissions(\OCP\PERMISSION_CREATE);
+ return $this->checkPermissions(\OCP\Constants::PERMISSION_CREATE);
}
/**
* @return bool
*/
public function isDeletable() {
- return $this->checkPermissions(\OCP\PERMISSION_DELETE);
+ return $this->checkPermissions(\OCP\Constants::PERMISSION_DELETE);
}
/**
* @return bool
*/
public function isShareable() {
- return $this->checkPermissions(\OCP\PERMISSION_SHARE);
+ return $this->checkPermissions(\OCP\Constants::PERMISSION_SHARE);
}
/**
diff --git a/lib/private/files/node/file.php b/lib/private/files/node/file.php
index 75d5e0166b6..81e251c20b8 100644
--- a/lib/private/files/node/file.php
+++ b/lib/private/files/node/file.php
@@ -16,7 +16,7 @@ class File extends Node implements \OCP\Files\File {
* @throws \OCP\Files\NotPermittedException
*/
public function getContent() {
- if ($this->checkPermissions(\OCP\PERMISSION_READ)) {
+ if ($this->checkPermissions(\OCP\Constants::PERMISSION_READ)) {
/**
* @var \OC\Files\Storage\Storage $storage;
*/
@@ -31,7 +31,7 @@ class File extends Node implements \OCP\Files\File {
* @throws \OCP\Files\NotPermittedException
*/
public function putContent($data) {
- if ($this->checkPermissions(\OCP\PERMISSION_UPDATE)) {
+ if ($this->checkPermissions(\OCP\Constants::PERMISSION_UPDATE)) {
$this->sendHooks(array('preWrite'));
$this->view->file_put_contents($this->path, $data);
$this->sendHooks(array('postWrite'));
@@ -55,7 +55,7 @@ class File extends Node implements \OCP\Files\File {
public function fopen($mode) {
$preHooks = array();
$postHooks = array();
- $requiredPermissions = \OCP\PERMISSION_READ;
+ $requiredPermissions = \OCP\Constants::PERMISSION_READ;
switch ($mode) {
case 'r+':
case 'rb+':
@@ -73,7 +73,7 @@ class File extends Node implements \OCP\Files\File {
case 'ab':
$preHooks[] = 'preWrite';
$postHooks[] = 'postWrite';
- $requiredPermissions |= \OCP\PERMISSION_UPDATE;
+ $requiredPermissions |= \OCP\Constants::PERMISSION_UPDATE;
break;
}
@@ -88,7 +88,7 @@ class File extends Node implements \OCP\Files\File {
}
public function delete() {
- if ($this->checkPermissions(\OCP\PERMISSION_DELETE)) {
+ if ($this->checkPermissions(\OCP\Constants::PERMISSION_DELETE)) {
$this->sendHooks(array('preDelete'));
$this->view->unlink($this->path);
$nonExisting = new NonExistingFile($this->root, $this->view, $this->path);
diff --git a/lib/private/files/node/folder.php b/lib/private/files/node/folder.php
index 8c7acc339ae..83e20871528 100644
--- a/lib/private/files/node/folder.php
+++ b/lib/private/files/node/folder.php
@@ -180,7 +180,7 @@ class Folder extends Node implements \OCP\Files\Folder {
* @throws \OCP\Files\NotPermittedException
*/
public function newFolder($path) {
- if ($this->checkPermissions(\OCP\PERMISSION_CREATE)) {
+ if ($this->checkPermissions(\OCP\Constants::PERMISSION_CREATE)) {
$fullPath = $this->getFullPath($path);
$nonExisting = new NonExistingFolder($this->root, $this->view, $fullPath);
$this->root->emit('\OC\Files', 'preWrite', array($nonExisting));
@@ -201,7 +201,7 @@ class Folder extends Node implements \OCP\Files\Folder {
* @throws \OCP\Files\NotPermittedException
*/
public function newFile($path) {
- if ($this->checkPermissions(\OCP\PERMISSION_CREATE)) {
+ if ($this->checkPermissions(\OCP\Constants::PERMISSION_CREATE)) {
$fullPath = $this->getFullPath($path);
$nonExisting = new NonExistingFile($this->root, $this->view, $fullPath);
$this->root->emit('\OC\Files', 'preWrite', array($nonExisting));
@@ -325,11 +325,11 @@ class Folder extends Node implements \OCP\Files\Folder {
* @return bool
*/
public function isCreatable() {
- return $this->checkPermissions(\OCP\PERMISSION_CREATE);
+ return $this->checkPermissions(\OCP\Constants::PERMISSION_CREATE);
}
public function delete() {
- if ($this->checkPermissions(\OCP\PERMISSION_DELETE)) {
+ if ($this->checkPermissions(\OCP\Constants::PERMISSION_DELETE)) {
$this->sendHooks(array('preDelete'));
$this->view->rmdir($this->path);
$nonExisting = new NonExistingFolder($this->root, $this->view, $this->path);
diff --git a/lib/private/files/node/node.php b/lib/private/files/node/node.php
index bc075911749..c52f5bbd54f 100644
--- a/lib/private/files/node/node.php
+++ b/lib/private/files/node/node.php
@@ -81,7 +81,7 @@ class Node implements \OCP\Files\Node {
* @throws \OCP\Files\NotPermittedException
*/
public function touch($mtime = null) {
- if ($this->checkPermissions(\OCP\PERMISSION_UPDATE)) {
+ if ($this->checkPermissions(\OCP\Constants::PERMISSION_UPDATE)) {
$this->sendHooks(array('preTouch'));
$this->view->touch($this->path, $mtime);
$this->sendHooks(array('postTouch'));
@@ -163,28 +163,28 @@ class Node implements \OCP\Files\Node {
* @return bool
*/
public function isReadable() {
- return $this->checkPermissions(\OCP\PERMISSION_READ);
+ return $this->checkPermissions(\OCP\Constants::PERMISSION_READ);
}
/**
* @return bool
*/
public function isUpdateable() {
- return $this->checkPermissions(\OCP\PERMISSION_UPDATE);
+ return $this->checkPermissions(\OCP\Constants::PERMISSION_UPDATE);
}
/**
* @return bool
*/
public function isDeletable() {
- return $this->checkPermissions(\OCP\PERMISSION_DELETE);
+ return $this->checkPermissions(\OCP\Constants::PERMISSION_DELETE);
}
/**
* @return bool
*/
public function isShareable() {
- return $this->checkPermissions(\OCP\PERMISSION_SHARE);
+ return $this->checkPermissions(\OCP\Constants::PERMISSION_SHARE);
}
/**
diff --git a/lib/private/files/node/root.php b/lib/private/files/node/root.php
index 18e7a6b681a..1e8387dc5cb 100644
--- a/lib/private/files/node/root.php
+++ b/lib/private/files/node/root.php
@@ -262,7 +262,7 @@ class Root extends Folder implements Emitter {
* @return int
*/
public function getPermissions() {
- return \OCP\PERMISSION_CREATE;
+ return \OCP\Constants::PERMISSION_CREATE;
}
/**
diff --git a/lib/private/files/objectstore/objectstorestorage.php b/lib/private/files/objectstore/objectstorestorage.php
index ae8bff52896..b0095ad94bb 100644
--- a/lib/private/files/objectstore/objectstorestorage.php
+++ b/lib/private/files/objectstore/objectstorestorage.php
@@ -72,7 +72,7 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common {
'size' => 0,
'mtime' => $mTime,
'storage_mtime' => $mTime,
- 'permissions' => \OCP\PERMISSION_ALL,
+ 'permissions' => \OCP\Constants::PERMISSION_ALL,
);
if ($dirName === '' && !$parentExists) {
@@ -332,7 +332,7 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common {
'size' => 0,
'mtime' => $mtime,
'storage_mtime' => $mtime,
- 'permissions' => \OCP\PERMISSION_ALL,
+ 'permissions' => \OCP\Constants::PERMISSION_ALL,
);
$fileId = $this->getCache()->put($path, $stat);
try {
@@ -357,7 +357,7 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common {
if (empty($stat)) {
// create new file
$stat = array(
- 'permissions' => \OCP\PERMISSION_ALL,
+ 'permissions' => \OCP\Constants::PERMISSION_ALL,
);
}
// update stat with new data
diff --git a/lib/private/files/storage/common.php b/lib/private/files/storage/common.php
index 518d3ec400c..d76c6aa031b 100644
--- a/lib/private/files/storage/common.php
+++ b/lib/private/files/storage/common.php
@@ -113,19 +113,19 @@ abstract class Common implements \OC\Files\Storage\Storage {
public function getPermissions($path) {
$permissions = 0;
if ($this->isCreatable($path)) {
- $permissions |= \OCP\PERMISSION_CREATE;
+ $permissions |= \OCP\Constants::PERMISSION_CREATE;
}
if ($this->isReadable($path)) {
- $permissions |= \OCP\PERMISSION_READ;
+ $permissions |= \OCP\Constants::PERMISSION_READ;
}
if ($this->isUpdatable($path)) {
- $permissions |= \OCP\PERMISSION_UPDATE;
+ $permissions |= \OCP\Constants::PERMISSION_UPDATE;
}
if ($this->isDeletable($path)) {
- $permissions |= \OCP\PERMISSION_DELETE;
+ $permissions |= \OCP\Constants::PERMISSION_DELETE;
}
if ($this->isSharable($path)) {
- $permissions |= \OCP\PERMISSION_SHARE;
+ $permissions |= \OCP\Constants::PERMISSION_SHARE;
}
return $permissions;
}
diff --git a/lib/private/files/storage/dav.php b/lib/private/files/storage/dav.php
index 26fa69408a8..a2832bce009 100644
--- a/lib/private/files/storage/dav.php
+++ b/lib/private/files/storage/dav.php
@@ -416,19 +416,19 @@ class DAV extends \OC\Files\Storage\Common {
}
public function isUpdatable($path) {
- return (bool)($this->getPermissions($path) & \OCP\PERMISSION_UPDATE);
+ return (bool)($this->getPermissions($path) & \OCP\Constants::PERMISSION_UPDATE);
}
public function isCreatable($path) {
- return (bool)($this->getPermissions($path) & \OCP\PERMISSION_CREATE);
+ return (bool)($this->getPermissions($path) & \OCP\Constants::PERMISSION_CREATE);
}
public function isSharable($path) {
- return (bool)($this->getPermissions($path) & \OCP\PERMISSION_SHARE);
+ return (bool)($this->getPermissions($path) & \OCP\Constants::PERMISSION_SHARE);
}
public function isDeletable($path) {
- return (bool)($this->getPermissions($path) & \OCP\PERMISSION_DELETE);
+ return (bool)($this->getPermissions($path) & \OCP\Constants::PERMISSION_DELETE);
}
public function getPermissions($path) {
@@ -438,9 +438,9 @@ class DAV extends \OC\Files\Storage\Common {
if (isset($response['{http://owncloud.org/ns}permissions'])) {
return $this->parsePermissions($response['{http://owncloud.org/ns}permissions']);
} else if ($this->is_dir($path)) {
- return \OCP\PERMISSION_ALL;
+ return \OCP\Constants::PERMISSION_ALL;
} else if ($this->file_exists($path)) {
- return \OCP\PERMISSION_ALL - \OCP\PERMISSION_CREATE;
+ return \OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_CREATE;
} else {
return 0;
}
@@ -451,19 +451,19 @@ class DAV extends \OC\Files\Storage\Common {
* @return int
*/
protected function parsePermissions($permissionsString) {
- $permissions = \OCP\PERMISSION_READ;
+ $permissions = \OCP\Constants::PERMISSION_READ;
if (strpos($permissionsString, 'R') !== false) {
- $permissions |= \OCP\PERMISSION_SHARE;
+ $permissions |= \OCP\Constants::PERMISSION_SHARE;
}
if (strpos($permissionsString, 'D') !== false) {
- $permissions |= \OCP\PERMISSION_DELETE;
+ $permissions |= \OCP\Constants::PERMISSION_DELETE;
}
if (strpos($permissionsString, 'W') !== false) {
- $permissions |= \OCP\PERMISSION_UPDATE;
+ $permissions |= \OCP\Constants::PERMISSION_UPDATE;
}
if (strpos($permissionsString, 'CK') !== false) {
- $permissions |= \OCP\PERMISSION_CREATE;
- $permissions |= \OCP\PERMISSION_UPDATE;
+ $permissions |= \OCP\Constants::PERMISSION_CREATE;
+ $permissions |= \OCP\Constants::PERMISSION_UPDATE;
}
return $permissions;
}
diff --git a/lib/private/files/view.php b/lib/private/files/view.php
index 19676524a0e..331ab9ba6cd 100644
--- a/lib/private/files/view.php
+++ b/lib/private/files/view.php
@@ -933,7 +933,7 @@ class View {
}
if ($mount instanceof MoveableMount && $internalPath === '') {
- $data['permissions'] |= \OCP\PERMISSION_DELETE | \OCP\PERMISSION_UPDATE;
+ $data['permissions'] |= \OCP\Constants::PERMISSION_DELETE | \OCP\Constants::PERMISSION_UPDATE;
}
$data = \OC_FileProxy::runPostProxies('getFileInfo', $path, $data);
@@ -988,7 +988,7 @@ class View {
}
// if sharing was disabled for the user we remove the share permissions
if (\OCP\Util::isSharingDisabledForUser()) {
- $content['permissions'] = $content['permissions'] & ~\OCP\PERMISSION_SHARE;
+ $content['permissions'] = $content['permissions'] & ~\OCP\Constants::PERMISSION_SHARE;
}
$files[] = new FileInfo($path . '/' . $content['name'], $storage, $content['path'], $content);
}
@@ -1025,9 +1025,9 @@ class View {
// do not allow renaming/deleting the mount point if they are not shared files/folders
// for shared files/folders we use the permissions given by the owner
if ($mount instanceof MoveableMount) {
- $rootEntry['permissions'] = $permissions | \OCP\PERMISSION_UPDATE | \OCP\PERMISSION_DELETE;
+ $rootEntry['permissions'] = $permissions | \OCP\Constants::PERMISSION_UPDATE | \OCP\Constants::PERMISSION_DELETE;
} else {
- $rootEntry['permissions'] = $permissions & (\OCP\PERMISSION_ALL - (\OCP\PERMISSION_UPDATE | \OCP\PERMISSION_DELETE));
+ $rootEntry['permissions'] = $permissions & (\OCP\Constants::PERMISSION_ALL - (\OCP\Constants::PERMISSION_UPDATE | \OCP\Constants::PERMISSION_DELETE));
}
//remove any existing entry with the same name
@@ -1041,7 +1041,7 @@ class View {
// if sharing was disabled for the user we remove the share permissions
if (\OCP\Util::isSharingDisabledForUser()) {
- $content['permissions'] = $content['permissions'] & ~\OCP\PERMISSION_SHARE;
+ $content['permissions'] = $content['permissions'] & ~\OCP\Constants::PERMISSION_SHARE;
}
$files[] = new FileInfo($path . '/' . $rootEntry['name'], $subStorage, '', $rootEntry);
diff --git a/lib/private/helper.php b/lib/private/helper.php
index 5b1d31bfc59..d43eefcdc52 100644
--- a/lib/private/helper.php
+++ b/lib/private/helper.php
@@ -58,12 +58,11 @@ class OC_Helper {
}
/**
- * @param $key
+ * @param string $key
* @return string url to the online documentation
*/
public static function linkToDocs($key) {
- $theme = new OC_Defaults();
- return $theme->buildDocLinkToKey($key);
+ return OC::$server->getURLGenerator()->linkToDocs($key);
}
/**
@@ -873,6 +872,23 @@ class OC_Helper {
}
/**
+ * Try to find a program
+ * Note: currently windows is not supported
+ *
+ * @param string $program
+ * @return null|string
+ */
+ public static function findBinaryPath($program) {
+ if (!\OC_Util::runningOnWindows() && self::is_function_enabled('exec')) {
+ exec('command -v ' . escapeshellarg($program) . ' 2> /dev/null', $output, $returnCode);
+ if ($returnCode === 0 && count($output) > 0) {
+ return escapeshellcmd($output[0]);
+ }
+ }
+ return null;
+ }
+
+ /**
* Calculate the disc space for the given path
*
* @param string $path
diff --git a/lib/private/l10n.php b/lib/private/l10n.php
index 6ec4e967c7f..afa066c30ef 100644
--- a/lib/private/l10n.php
+++ b/lib/private/l10n.php
@@ -7,19 +7,9 @@
* @copyright 2012 Frank Karlitschek frank@owncloud.org
* @copyright 2013 Jakob Sack
*
- * 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/>.
- *
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
*/
/**
@@ -89,7 +79,8 @@ class OC_L10N implements \OCP\IL10N {
}
/**
- * @param string $transFile
+ * @param $transFile
+ * @param bool $mergeTranslations
* @return bool
*/
public function load($transFile, $mergeTranslations = false) {
@@ -141,8 +132,8 @@ class OC_L10N implements \OCP\IL10N {
// load the translations file
if($this->load($transFile)) {
//merge with translations from theme
- $theme = OC_Config::getValue( "theme" );
- if (!is_null($theme)) {
+ $theme = \OC::$server->getConfig()->getSystemValue('theme');
+ if (!empty($theme)) {
$transFile = OC::$SERVERROOT.'/themes/'.$theme.substr($transFile, strlen(OC::$SERVERROOT));
if (file_exists($transFile)) {
$this->load($transFile, true);
@@ -285,7 +276,8 @@ class OC_L10N implements \OCP\IL10N {
* Localization
* @param string $type Type of localization
* @param array|int|string $data parameters for this localization
- * @return String or false
+ * @param array $options
+ * @return string|false
*
* Returns the localized data.
*
@@ -393,8 +385,8 @@ class OC_L10N implements \OCP\IL10N {
return self::$language;
}
- if(OC_User::getUser() && OC_Preferences::getValue(OC_User::getUser(), 'core', 'lang')) {
- $lang = OC_Preferences::getValue(OC_User::getUser(), 'core', 'lang');
+ if(OC_User::getUser() && \OC::$server->getConfig()->getUserValue(OC_User::getUser(), 'core', 'lang')) {
+ $lang = \OC::$server->getConfig()->getUserValue(OC_User::getUser(), 'core', 'lang');
self::$language = $lang;
if(is_array($app)) {
$available = $app;
@@ -407,7 +399,7 @@ class OC_L10N implements \OCP\IL10N {
}
}
- $default_language = OC_Config::getValue('default_language', false);
+ $default_language = \OC::$server->getConfig()->getSystemValue('default_language', false);
if($default_language !== false) {
return $default_language;
@@ -457,17 +449,17 @@ class OC_L10N implements \OCP\IL10N {
*/
protected static function findI18nDir($app) {
// find the i18n dir
- $i18ndir = OC::$SERVERROOT.'/core/l10n/';
+ $i18nDir = OC::$SERVERROOT.'/core/l10n/';
if($app != '') {
// Check if the app is in the app folder
if(file_exists(OC_App::getAppPath($app).'/l10n/')) {
- $i18ndir = OC_App::getAppPath($app).'/l10n/';
+ $i18nDir = OC_App::getAppPath($app).'/l10n/';
}
else{
- $i18ndir = OC::$SERVERROOT.'/'.$app.'/l10n/';
+ $i18nDir = OC::$SERVERROOT.'/'.$app.'/l10n/';
}
}
- return $i18ndir;
+ return $i18nDir;
}
/**
@@ -496,7 +488,7 @@ class OC_L10N implements \OCP\IL10N {
* @return bool
*/
public static function languageExists($app, $lang) {
- if ($lang == 'en') {//english is always available
+ if ($lang === 'en') {//english is always available
return true;
}
$dir = self::findI18nDir($app);
diff --git a/lib/private/migrate.php b/lib/private/migrate.php
deleted file mode 100644
index 8351155aa55..00000000000
--- a/lib/private/migrate.php
+++ /dev/null
@@ -1,626 +0,0 @@
-<?php
-/**
- * ownCloud
- *
- * @author Tom Needham
- * @copyright 2012 Tom Needham tom@owncloud.com
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
- *
- * You should have received a copy of the GNU Affero General Public
- * License along with this library. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-
-/**
- * provides an interface to migrate users and whole ownclouds
- */
-class OC_Migrate{
-
-
- // Array of OC_Migration_Provider objects
- static private $providers=array();
- // User id of the user to import/export
- static private $uid=false;
- // Holds the ZipArchive object
- static private $zip=false;
- // Stores the type of export
- static private $exporttype=false;
- // Holds the db object
- static private $migration_database=false;
- // Path to the sqlite db
- static private $dbpath=false;
- // Holds the path to the zip file
- static private $zippath=false;
- // Holds the OC_Migration_Content object
- static private $content=false;
-
- /**
- * register a new migration provider
- * @param OC_Migration_Provider $provider
- */
- public static function registerProvider($provider) {
- self::$providers[]=$provider;
- }
-
- /**
- * finds and loads the providers
- */
- static private function findProviders() {
- // Find the providers
- $apps = OC_App::getAllApps();
-
- foreach($apps as $app) {
- $path = OC_App::getAppPath($app) . '/appinfo/migrate.php';
- if( file_exists( $path ) ) {
- include_once $path;
- }
- }
- }
-
- /**
- * exports a user, or owncloud instance
- * @param string $uid user id of user to export if export type is user, defaults to current
- * @param string $type type of export, defualts to user
- * @param string $path path to zip output folder
- * @return string on error, path to zip on success
- */
- public static function export( $uid=null, $type='user', $path=null ) {
- $datadir = OC_Config::getValue( 'datadirectory' );
- // Validate export type
- $types = array( 'user', 'instance', 'system', 'userfiles' );
- if( !in_array( $type, $types ) ) {
- OC_Log::write( 'migration', 'Invalid export type', OC_Log::ERROR );
- return json_encode( array( 'success' => false ) );
- }
- self::$exporttype = $type;
- // Userid?
- if( self::$exporttype == 'user' ) {
- // Check user exists
- self::$uid = is_null($uid) ? OC_User::getUser() : $uid;
- if(!OC_User::userExists(self::$uid)) {
- return json_encode( array( 'success' => false) );
- }
- }
- // Calculate zipname
- if( self::$exporttype == 'user' ) {
- $zipname = 'oc_export_' . self::$uid . '_' . date("y-m-d_H-i-s") . '.zip';
- } else {
- $zipname = 'oc_export_' . self::$exporttype . '_' . date("y-m-d_H-i-s") . '.zip';
- }
- // Calculate path
- if( self::$exporttype == 'user' ) {
- self::$zippath = $datadir . '/' . self::$uid . '/' . $zipname;
- } else {
- if( !is_null( $path ) ) {
- // Validate custom path
- if( !file_exists( $path ) || !is_writeable( $path ) ) {
- OC_Log::write( 'migration', 'Path supplied is invalid.', OC_Log::ERROR );
- return json_encode( array( 'success' => false ) );
- }
- self::$zippath = $path . $zipname;
- } else {
- // Default path
- self::$zippath = get_temp_dir() . '/' . $zipname;
- }
- }
- // Create the zip object
- if( !self::createZip() ) {
- return json_encode( array( 'success' => false ) );
- }
- // Do the export
- self::findProviders();
- $exportdata = array();
- switch( self::$exporttype ) {
- case 'user':
- // Connect to the db
- self::$dbpath = $datadir . '/' . self::$uid . '/migration.db';
- if( !self::connectDB() ) {
- return json_encode( array( 'success' => false ) );
- }
- self::$content = new OC_Migration_Content( self::$zip, self::$migration_database );
- // Export the app info
- $exportdata = self::exportAppData();
- // Add the data dir to the zip
- self::$content->addDir(OC_User::getHome(self::$uid), true, '/' );
- break;
- case 'instance':
- self::$content = new OC_Migration_Content( self::$zip );
- // Creates a zip that is compatable with the import function
- $dbfile = tempnam( get_temp_dir(), "owncloud_export_data_" );
- OC_DB::getDbStructure( $dbfile, 'MDB2_SCHEMA_DUMP_ALL');
-
- // Now add in *dbname* and *dbprefix*
- $dbexport = file_get_contents( $dbfile );
- $dbnamestring = "<database>\n\n <name>" . OC_Config::getValue( "dbname", "owncloud" );
- $dbtableprefixstring = "<table>\n\n <name>" . OC_Config::getValue( "dbtableprefix", "oc_" );
- $dbexport = str_replace( $dbnamestring, "<database>\n\n <name>*dbname*", $dbexport );
- $dbexport = str_replace( $dbtableprefixstring, "<table>\n\n <name>*dbprefix*", $dbexport );
- // Add the export to the zip
- self::$content->addFromString( $dbexport, "dbexport.xml" );
- // Add user data
- foreach(OC_User::getUsers() as $user) {
- self::$content->addDir(OC_User::getHome($user), true, "/userdata/" );
- }
- break;
- case 'userfiles':
- self::$content = new OC_Migration_Content( self::$zip );
- // Creates a zip with all of the users files
- foreach(OC_User::getUsers() as $user) {
- self::$content->addDir(OC_User::getHome($user), true, "/" );
- }
- break;
- case 'system':
- self::$content = new OC_Migration_Content( self::$zip );
- // Creates a zip with the owncloud system files
- self::$content->addDir( OC::$SERVERROOT . '/', false, '/');
- foreach (array(
- ".git",
- "3rdparty",
- "apps",
- "core",
- "files",
- "l10n",
- "lib",
- "ocs",
- "search",
- "settings",
- "tests"
- ) as $dir) {
- self::$content->addDir( OC::$SERVERROOT . '/' . $dir, true, "/");
- }
- break;
- }
- if( !$info = self::getExportInfo( $exportdata ) ) {
- return json_encode( array( 'success' => false ) );
- }
- // Add the export info json to the export zip
- self::$content->addFromString( $info, 'export_info.json' );
- if( !self::$content->finish() ) {
- return json_encode( array( 'success' => false ) );
- }
- return json_encode( array( 'success' => true, 'data' => self::$zippath ) );
- }
-
- /**
- * imports a user, or owncloud instance
- * @param string $path path to zip
- * @param string $type type of import (user or instance)
- * @param string|null|int $uid userid of new user
- * @return string
- */
- public static function import( $path, $type='user', $uid=null ) {
-
- $datadir = OC_Config::getValue( 'datadirectory' );
- // Extract the zip
- if( !$extractpath = self::extractZip( $path ) ) {
- return json_encode( array( 'success' => false ) );
- }
- // Get export_info.json
- $scan = scandir( $extractpath );
- // Check for export_info.json
- if( !in_array( 'export_info.json', $scan ) ) {
- OC_Log::write( 'migration', 'Invalid import file, export_info.json not found', OC_Log::ERROR );
- return json_encode( array( 'success' => false ) );
- }
- $json = json_decode( file_get_contents( $extractpath . 'export_info.json' ) );
- if( $json->exporttype != $type ) {
- OC_Log::write( 'migration', 'Invalid import file', OC_Log::ERROR );
- return json_encode( array( 'success' => false ) );
- }
- self::$exporttype = $type;
-
- $currentuser = OC_User::getUser();
-
- // Have we got a user if type is user
- if( self::$exporttype == 'user' ) {
- self::$uid = !is_null($uid) ? $uid : $currentuser;
- }
-
- // We need to be an admin if we are not importing our own data
- if(($type == 'user' && self::$uid != $currentuser) || $type != 'user' ) {
- if( !OC_User::isAdminUser($currentuser)) {
- // Naughty.
- OC_Log::write( 'migration', 'Import not permitted.', OC_Log::ERROR );
- return json_encode( array( 'success' => false ) );
- }
- }
-
- // Handle export types
- switch( self::$exporttype ) {
- case 'user':
- // Check user availability
- if( !OC_User::userExists( self::$uid ) ) {
- 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($userfolder.'/'.$file)) {
- $file = str_replace(array('/', '\\'), '', $file);
-
- // Then copy the folder over
- OC_Helper::copyr($userfolder.'/'.$file, $newuserfolder.'/'.$file);
- }
- }
- // Import user app data
- if(file_exists($extractpath . $json->exporteduser . '/migration.db')) {
- if( !$appsimported = self::importAppData( $extractpath . $json->exporteduser . '/migration.db',
- $json,
- self::$uid ) ) {
- return json_encode( array( 'success' => false ) );
- }
- }
- // All done!
- if( !self::unlink_r( $extractpath ) ) {
- OC_Log::write( 'migration', 'Failed to delete the extracted zip', OC_Log::ERROR );
- }
- return json_encode( array( 'success' => true, 'data' => $appsimported ) );
- break;
- case 'instance':
- /*
- * EXPERIMENTAL
- // Check for new data dir and dbexport before doing anything
- // TODO
-
- // Delete current data folder.
- OC_Log::write( 'migration', "Deleting current data dir", OC_Log::INFO );
- if( !self::unlink_r( $datadir, false ) ) {
- OC_Log::write( 'migration', 'Failed to delete the current data dir', OC_Log::ERROR );
- return json_encode( array( 'success' => false ) );
- }
-
- // Copy over data
- if( !self::copy_r( $extractpath . 'userdata', $datadir ) ) {
- OC_Log::write( 'migration', 'Failed to copy over data directory', OC_Log::ERROR );
- return json_encode( array( 'success' => false ) );
- }
-
- // Import the db
- if( !OC_DB::replaceDB( $extractpath . 'dbexport.xml' ) ) {
- return json_encode( array( 'success' => false ) );
- }
- // Done
- return json_encode( array( 'success' => true ) );
- */
- break;
- }
-
- }
-
- /**
- * recursively deletes a directory
- * @param string $dir path of dir to delete
- * @param bool $deleteRootToo delete the root directory
- * @return bool
- */
- private static function unlink_r( $dir, $deleteRootToo=true ) {
- if( !$dh = @opendir( $dir ) ) {
- return false;
- }
- while (false !== ($obj = readdir($dh))) {
- if($obj == '.' || $obj == '..') {
- continue;
- }
- if (!@unlink($dir . '/' . $obj)) {
- self::unlink_r($dir.'/'.$obj, true);
- }
- }
- closedir($dh);
- if ( $deleteRootToo ) {
- @rmdir($dir);
- }
- return true;
- }
-
- /**
- * tries to extract the import zip
- * @param string $path path to the zip
- * @return string path to extract location (with a trailing slash) or false on failure
- */
- static private function extractZip( $path ) {
- self::$zip = new ZipArchive;
- // Validate path
- if( !file_exists( $path ) ) {
- OC_Log::write( 'migration', 'Zip not found', OC_Log::ERROR );
- return false;
- }
- if ( self::$zip->open( $path ) != true ) {
- OC_Log::write( 'migration', "Failed to open zip file", OC_Log::ERROR );
- return false;
- }
- $to = get_temp_dir() . '/oc_import_' . self::$exporttype . '_' . date("y-m-d_H-i-s") . '/';
- if( !self::$zip->extractTo( $to ) ) {
- return false;
- }
- self::$zip->close();
- return $to;
- }
-
- /**
- * creates a migration.db in the users data dir with their app data in
- * @return bool whether operation was successfull
- */
- private static function exportAppData( ) {
-
- $success = true;
- $return = array();
-
- // Foreach provider
- foreach( self::$providers as $provider ) {
- // Check if the app is enabled
- if( OC_App::isEnabled( $provider->getID() ) ) {
- $success = true;
- // Does this app use the database?
- if( file_exists( OC_App::getAppPath($provider->getID()).'/appinfo/database.xml' ) ) {
- // Create some app tables
- $tables = self::createAppTables( $provider->getID() );
- if( is_array( $tables ) ) {
- // Save the table names
- foreach($tables as $table) {
- $return['apps'][$provider->getID()]['tables'][] = $table;
- }
- } else {
- // It failed to create the tables
- $success = false;
- }
- }
-
- // Run the export function?
- if( $success ) {
- // Set the provider properties
- $provider->setData( self::$uid, self::$content );
- $return['apps'][$provider->getID()]['success'] = $provider->export();
- } else {
- $return['apps'][$provider->getID()]['success'] = false;
- $return['apps'][$provider->getID()]['message'] = 'failed to create the app tables';
- }
-
- // Now add some app info the the return array
- $appinfo = OC_App::getAppInfo( $provider->getID() );
- $return['apps'][$provider->getID()]['version'] = OC_App::getAppVersion($provider->getID());
- }
- }
-
- return $return;
-
- }
-
-
- /**
- * generates json containing export info, and merges any data supplied
- * @param array $array of data to include in the returned json
- * @return string
- */
- static private function getExportInfo( $array=array() ) {
- $info = array(
- 'ocversion' => OC_Util::getVersion(),
- 'exporttime' => time(),
- 'exportedby' => OC_User::getUser(),
- 'exporttype' => self::$exporttype,
- 'exporteduser' => self::$uid
- );
-
- if( !is_array( $array ) ) {
- OC_Log::write( 'migration', 'Supplied $array was not an array in getExportInfo()', OC_Log::ERROR );
- }
- // Merge in other data
- $info = array_merge( $info, (array)$array );
- // Create json
- $json = json_encode( $info );
- return $json;
- }
-
- /**
- * connects to migration.db, or creates if not found
- * @param string $path to migration.db, defaults to user data dir
- * @return bool whether the operation was successful
- */
- static private function connectDB( $path=null ) {
- // Has the dbpath been set?
- self::$dbpath = !is_null( $path ) ? $path : self::$dbpath;
- if( !self::$dbpath ) {
- OC_Log::write( 'migration', 'connectDB() was called without dbpath being set', OC_Log::ERROR );
- return false;
- }
- // Already connected
- if(!self::$migration_database) {
- $datadir = OC_Config::getValue( "datadirectory", OC::$SERVERROOT."/data" );
- $connectionParams = array(
- 'path' => self::$dbpath,
- 'driver' => 'pdo_sqlite',
- );
- $connectionParams['adapter'] = '\OC\DB\AdapterSqlite';
- $connectionParams['wrapperClass'] = 'OC\DB\Connection';
- $connectionParams['tablePrefix'] = '';
-
- // Try to establish connection
- self::$migration_database = \Doctrine\DBAL\DriverManager::getConnection($connectionParams);
- }
- return true;
-
- }
-
- /**
- * creates the tables in migration.db from an apps database.xml
- * @param string $appid id of the app
- * @return bool whether the operation was successful
- */
- static private function createAppTables( $appid ) {
- $schema_manager = new OC\DB\MDB2SchemaManager(self::$migration_database);
-
- // There is a database.xml file
- $content = file_get_contents(OC_App::getAppPath($appid) . '/appinfo/database.xml' );
-
- $file2 = 'static://db_scheme';
- // TODO get the relative path to migration.db from the data dir
- // For now just cheat
- $path = pathinfo( self::$dbpath );
- $content = str_replace( '*dbname*', self::$uid.'/migration', $content );
- $content = str_replace( '*dbprefix*', '', $content );
-
- $xml = new SimpleXMLElement($content);
- foreach($xml->table as $table) {
- $tables[] = (string)$table->name;
- }
-
- file_put_contents( $file2, $content );
-
- // Try to create tables
- try {
- $schema_manager->createDbFromStructure($file2);
- } catch(Exception $e) {
- unlink( $file2 );
- OC_Log::write( 'migration', 'Failed to create tables for: '.$appid, OC_Log::FATAL );
- OC_Log::write( 'migration', $e->getMessage(), OC_Log::FATAL );
- return false;
- }
-
- return $tables;
- }
-
- /**
- * tries to create the zip
- * @return bool
- */
- static private function createZip() {
- self::$zip = new ZipArchive;
- // Check if properties are set
- if( !self::$zippath ) {
- OC_Log::write('migration', 'createZip() called but $zip and/or $zippath have not been set', OC_Log::ERROR);
- return false;
- }
- if ( self::$zip->open( self::$zippath, ZIPARCHIVE::CREATE | ZIPARCHIVE::OVERWRITE ) !== true ) {
- OC_Log::write('migration',
- 'Failed to create the zip with error: '.self::$zip->getStatusString(),
- OC_Log::ERROR);
- return false;
- } else {
- return true;
- }
- }
-
- /**
- * returns an array of apps that support migration
- * @return array
- */
- static public function getApps() {
- $allapps = OC_App::getAllApps();
- foreach($allapps as $app) {
- $path = self::getAppPath($app) . '/lib/migrate.php';
- if( file_exists( $path ) ) {
- $supportsmigration[] = $app;
- }
- }
- return $supportsmigration;
- }
-
- /**
- * imports a new user
- * @param string $db string path to migration.db
- * @param object $info object of migration info
- * @param string|null|int $uid uid to use
- * @return array an array of apps with import statuses, or false on failure.
- */
- public static function importAppData( $db, $info, $uid=null ) {
- // Check if the db exists
- if( file_exists( $db ) ) {
- // Connect to the db
- if(!self::connectDB( $db )) {
- OC_Log::write('migration', 'Failed to connect to migration.db', OC_Log::ERROR);
- return false;
- }
- } else {
- OC_Log::write('migration', 'Migration.db not found at: '.$db, OC_Log::FATAL );
- return false;
- }
-
- // Find providers
- self::findProviders();
-
- // Generate importinfo array
- $importinfo = array(
- 'olduid' => $info->exporteduser,
- 'newuid' => self::$uid
- );
-
- foreach( self::$providers as $provider) {
- // Is the app in the export?
- $id = $provider->getID();
- if( isset( $info->apps->$id ) ) {
- // Is the app installed
- if( !OC_App::isEnabled( $id ) ) {
- OC_Log::write( 'migration',
- 'App: ' . $id . ' is not installed, can\'t import data.',
- OC_Log::INFO );
- $appsstatus[$id] = 'notsupported';
- } else {
- // Did it succeed on export?
- if( $info->apps->$id->success ) {
- // Give the provider the content object
- if( !self::connectDB( $db ) ) {
- return false;
- }
- $content = new OC_Migration_Content( self::$zip, self::$migration_database );
- $provider->setData( self::$uid, $content, $info );
- // Then do the import
- if( !$appsstatus[$id] = $provider->import( $info->apps->$id, $importinfo ) ) {
- // Failed to import app
- OC_Log::write( 'migration',
- 'Failed to import app data for user: ' . self::$uid . ' for app: ' . $id,
- OC_Log::ERROR );
- }
- } else {
- // Add to failed list
- $appsstatus[$id] = false;
- }
- }
- }
- }
-
- return $appsstatus;
-
- }
-
- /**
- * creates a new user in the database
- * @param string $uid user_id of the user to be created
- * @param string $hash hash of the user to be created
- * @return bool result of user creation
- */
- public static function createUser( $uid, $hash ) {
-
- // Check if userid exists
- if(OC_User::userExists( $uid )) {
- return false;
- }
-
- // Create the user
- $query = OC_DB::prepare( "INSERT INTO `*PREFIX*users` ( `uid`, `password` ) VALUES( ?, ? )" );
- $result = $query->execute( array( $uid, $hash));
- if( !$result ) {
- OC_Log::write('migration', 'Failed to create the new user "'.$uid."", OC_Log::ERROR);
- }
- return $result ? true : false;
-
- }
-
-}
diff --git a/lib/private/migration/content.php b/lib/private/migration/content.php
deleted file mode 100644
index cb5d9ad1472..00000000000
--- a/lib/private/migration/content.php
+++ /dev/null
@@ -1,246 +0,0 @@
-<?php
-/**
- * ownCloud
- *
- * @author Tom Needham
- * @copyright 2012 Tom Needham tom@owncloud.com
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
- *
- * You should have received a copy of the GNU Affero General Public
- * License along with this library. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-
-/**
- * provides methods to add and access data from the migration
- */
-class OC_Migration_Content{
-
- private $zip=false;
- // Holds the database object
- private $db=null;
- // Holds an array of tmpfiles to delete after zip creation
- private $tmpfiles=array();
-
- /**
- * sets up the
- * @param ZipArchive $zip ZipArchive object
- * @param object $db a database object (required for exporttype user)
- * @return bool|null
- */
- public function __construct( $zip, $db=null ) {
-
- $this->zip = $zip;
- $this->db = $db;
-
- }
-
- /**
- * prepares the db
- * @param string $query the sql query to prepare
- */
- public function prepare( $query ) {
-
- // Only add database to tmpfiles if actually used
- if( !is_null( $this->db ) ) {
- // Get db path
- $db = $this->db->getDatabase();
- if(!in_array($db, $this->tmpfiles)) {
- $this->tmpfiles[] = $db;
- }
- }
-
- // Optimize the query
- $query = $this->processQuery( $query );
-
- // Optimize the query
- $query = $this->db->prepare( $query );
- $query = new OC_DB_StatementWrapper($query, false);
-
- return $query;
- }
-
- /**
- * processes the db query
- * @param string $query the query to process
- * @return string of processed query
- */
- private function processQuery( $query ) {
- $query = str_replace( '`', '\'', $query );
- $query = str_replace( 'NOW()', 'datetime(\'now\')', $query );
- $query = str_replace( 'now()', 'datetime(\'now\')', $query );
- // remove table prefixes
- $query = str_replace( '*PREFIX*', '', $query );
- return $query;
- }
-
- /**
- * copys rows to migration.db from the main database
- * @param array $options array of options.
- * @return bool
- */
- public function copyRows( $options ) {
- if( !array_key_exists( 'table', $options ) ) {
- return false;
- }
-
- $return = array();
-
- // Need to include 'where' in the query?
- if( array_key_exists( 'matchval', $options ) && array_key_exists( 'matchcol', $options ) ) {
-
- // If only one matchval, create an array
- if(!is_array($options['matchval'])) {
- $options['matchval'] = array( $options['matchval'] );
- }
-
- foreach( $options['matchval'] as $matchval ) {
- // Run the query for this match value (where x = y value)
- $sql = 'SELECT * FROM `*PREFIX*' . $options['table'] . '` WHERE `' . $options['matchcol'] . '` = ?';
- $query = OC_DB::prepare( $sql );
- $results = $query->execute( array( $matchval ) );
- $newreturns = $this->insertData( $results, $options );
- $return = array_merge( $return, $newreturns );
- }
-
- } else {
- // Just get everything
- $sql = 'SELECT * FROM `*PREFIX*' . $options['table'] . '`';
- $query = OC_DB::prepare( $sql );
- $results = $query->execute();
- $return = $this->insertData( $results, $options );
-
- }
-
- return $return;
-
- }
-
- /**
- * saves a sql data set into migration.db
- * @param OC_DB_StatementWrapper $data a sql data set returned from self::prepare()->query()
- * @param array $options array of copyRows options
- * @return void
- */
- private function insertData( $data, $options ) {
- $return = array();
- // Foreach row of data to insert
- while( $row = $data->fetchRow() ) {
- // Now save all this to the migration.db
- foreach($row as $field=>$value) {
- $fields[] = $field;
- $values[] = $value;
- }
-
- // Generate some sql
- $sql = "INSERT INTO `" . $options['table'] . '` ( `';
- $fieldssql = implode( '`, `', $fields );
- $sql .= $fieldssql . "` ) VALUES( ";
- $valuessql = substr( str_repeat( '?, ', count( $fields ) ), 0, -2 );
- $sql .= $valuessql . " )";
- // Make the query
- $query = $this->prepare( $sql );
- $query->execute( $values );
- // Do we need to return some values?
- if( array_key_exists( 'idcol', $options ) ) {
- // Yes we do
- $return[] = $row[$options['idcol']];
- } else {
- // Take a guess and return the first field :)
- $return[] = reset($row);
- }
- $fields = '';
- $values = '';
- }
- return $return;
- }
-
- /**
- * adds a directory to the zip object
- * @param boolean|string $dir string path of the directory to add
- * @param bool $recursive
- * @param string $internaldir path of folder to add dir to in zip
- * @return bool
- */
- public function addDir( $dir, $recursive=true, $internaldir='' ) {
- $dirname = basename($dir);
- $this->zip->addEmptyDir($internaldir . $dirname);
- $internaldir.=$dirname.='/';
- if( !file_exists( $dir ) ) {
- return false;
- }
- $dirhandle = opendir($dir);
- if(is_resource($dirhandle)) {
- while (false !== ( $file = readdir($dirhandle))) {
-
- if (( $file != '.' ) && ( $file != '..' )) {
-
- if (is_dir($dir . '/' . $file) && $recursive) {
- $this->addDir($dir . '/' . $file, $recursive, $internaldir);
- } elseif (is_file($dir . '/' . $file)) {
- $this->zip->addFile($dir . '/' . $file, $internaldir . $file);
- }
- }
- }
- closedir($dirhandle);
- } else {
- OC_Log::write('admin_export', "Was not able to open directory: " . $dir, OC_Log::ERROR);
- return false;
- }
- return true;
- }
-
- /**
- * adds a file to the zip from a given string
- * @param string $data string of data to add
- * @param string $path the relative path inside of the zip to save the file to
- * @return bool
- */
- public function addFromString( $data, $path ) {
- // Create a temp file
- $file = tempnam( get_temp_dir(). '/', 'oc_export_tmp_' );
- $this->tmpfiles[] = $file;
- if( !file_put_contents( $file, $data ) ) {
- OC_Log::write( 'migation', 'Failed to save data to a temporary file', OC_Log::ERROR );
- return false;
- }
- // Add file to the zip
- $this->zip->addFile( $file, $path );
- return true;
- }
-
- /**
- * closes the zip, removes temp files
- * @return bool
- */
- public function finish() {
- if( !$this->zip->close() ) {
- OC_Log::write( 'migration',
- 'Failed to write the zip file with error: '.$this->zip->getStatusString(),
- OC_Log::ERROR );
- return false;
- }
- $this->cleanup();
- return true;
- }
-
- /**
- * cleans up after the zip
- */
- private function cleanup() {
- // Delete tmp files
- foreach($this->tmpfiles as $i) {
- unlink( $i );
- }
- }
-}
diff --git a/lib/private/migration/provider.php b/lib/private/migration/provider.php
deleted file mode 100644
index a7c611dcdd4..00000000000
--- a/lib/private/migration/provider.php
+++ /dev/null
@@ -1,52 +0,0 @@
-<?php
-/**
- * provides search functionalty
- */
-abstract class OC_Migration_Provider{
-
- protected $id=false;
- protected $content=false;
- protected $uid=false;
- protected $olduid=false;
- protected $appinfo=false;
-
- public function __construct( $appid ) {
- // Set the id
- $this->id = $appid;
- OC_Migrate::registerProvider( $this );
- }
-
- /**
- * exports data for apps
- * @return array appdata to be exported
- */
- abstract function export( );
-
- /**
- * imports data for the app
- * @return void
- */
- abstract function import( );
-
- /**
- * sets the OC_Migration_Content object to $this->content
- * @param OC_Migration_Content $content a OC_Migration_Content object
- */
- public function setData( $uid, $content, $info=null ) {
- $this->content = $content;
- $this->uid = $uid;
- $id = $this->id;
- if( !is_null( $info ) ) {
- $this->olduid = $info->exporteduser;
- $this->appinfo = $info->apps->$id;
- }
- }
-
- /**
- * returns the appid of the provider
- * @return string
- */
- public function getID() {
- return $this->id;
- }
-}
diff --git a/lib/private/preview.php b/lib/private/preview.php
index f50bdcb4c9e..c9d8810be6f 100644
--- a/lib/private/preview.php
+++ b/lib/private/preview.php
@@ -17,7 +17,7 @@ use OC\Preview\Provider;
use OCP\Files\NotFoundException;
require_once 'preview/image.php';
-require_once 'preview/movies.php';
+require_once 'preview/movie.php';
require_once 'preview/mp3.php';
require_once 'preview/svg.php';
require_once 'preview/txt.php';
@@ -713,7 +713,7 @@ class Preview {
* - OC\Preview\OpenDocument
* - OC\Preview\StarOffice
* - OC\Preview\SVG
- * - OC\Preview\Movies
+ * - OC\Preview\Movie
* - OC\Preview\PDF
* - OC\Preview\TIFF
* - OC\Preview\Illustrator
@@ -892,16 +892,6 @@ class Preview {
self::initProviders();
}
- // FIXME: Ugly hack to prevent SVG of being returned if the SVG
- // provider is not enabled.
- // This is required because the preview system is designed in a
- // bad way and relies on opt-in with asterisks (i.e. image/*)
- // which will lead to the fact that a SVG will also match the image
- // provider.
- if($mimeType === 'image/svg+xml' && !array_key_exists('/image\/svg\+xml/', self::$providers)) {
- return false;
- }
-
foreach(self::$providers as $supportedMimetype => $provider) {
if(preg_match($supportedMimetype, $mimeType)) {
return true;
diff --git a/lib/private/preview/image.php b/lib/private/preview/image.php
index ec5b87befea..7bcbddc649e 100644
--- a/lib/private/preview/image.php
+++ b/lib/private/preview/image.php
@@ -11,7 +11,7 @@ namespace OC\Preview;
class Image extends Provider {
public function getMimeType() {
- return '/image\/.*/';
+ return '/image\/(?!tiff$)(?!svg.*).*/';
}
public function getThumbnail($path, $maxX, $maxY, $scalingup, $fileview) {
diff --git a/lib/private/preview/movies.php b/lib/private/preview/movie.php
index 2a23c2141c1..d69266ceb33 100644
--- a/lib/private/preview/movies.php
+++ b/lib/private/preview/movie.php
@@ -8,28 +8,12 @@
*/
namespace OC\Preview;
-function findBinaryPath($program) {
- exec('command -v ' . escapeshellarg($program) . ' 2> /dev/null', $output, $returnCode);
- if ($returnCode === 0 && count($output) > 0) {
- return escapeshellcmd($output[0]);
- }
- return null;
-}
-
// movie preview is currently not supported on Windows
if (!\OC_Util::runningOnWindows()) {
- $isExecEnabled = \OC_Helper::is_function_enabled('exec');
- $ffmpegBinary = null;
- $avconvBinary = null;
-
- if ($isExecEnabled) {
- $avconvBinary = findBinaryPath('avconv');
- if (!$avconvBinary) {
- $ffmpegBinary = findBinaryPath('ffmpeg');
- }
- }
+ $avconvBinary = \OC_Helper::findBinaryPath('avconv');
+ $ffmpegBinary = ($avconvBinary) ? null : \OC_Helper::findBinaryPath('ffmpeg');
- if($isExecEnabled && ( $avconvBinary || $ffmpegBinary )) {
+ if ($avconvBinary || $ffmpegBinary) {
class Movie extends Provider {
public static $avconvBinary;
diff --git a/lib/private/share/share.php b/lib/private/share/share.php
index a8febc9aca7..c6fd1604ac7 100644
--- a/lib/private/share/share.php
+++ b/lib/private/share/share.php
@@ -287,12 +287,12 @@ class Share extends \OC\Share\Constants {
* Get the item of item type shared with a given user by source
* @param string $itemType
* @param string $itemSource
- * @param string $user User user to whom the item was shared
+ * @param string $user User to whom the item was shared
+ * @param string $owner Owner of the share
* @param int $shareType only look for a specific share type
* @return array Return list of items with file_target, permissions and expiration
*/
- public static function getItemSharedWithUser($itemType, $itemSource, $user, $shareType = null) {
-
+ public static function getItemSharedWithUser($itemType, $itemSource, $user, $owner = null, $shareType = null) {
$shares = array();
$fileDependend = false;
@@ -320,6 +320,11 @@ class Share extends \OC\Share\Constants {
$arguments[] = $shareType;
}
+ if ($owner !== null) {
+ $where .= ' AND `uid_owner` = ? ';
+ $arguments[] = $owner;
+ }
+
$query = \OC_DB::prepare('SELECT ' . $select . ' FROM `*PREFIX*share` '. $where);
$result = \OC_DB::executeAudited($query, $arguments);
@@ -542,7 +547,7 @@ class Share extends \OC\Share\Constants {
// single file shares should never have delete permissions
if ($itemType === 'file') {
- $permissions = (int)$permissions & ~\OCP\PERMISSION_DELETE;
+ $permissions = (int)$permissions & ~\OCP\Constants::PERMISSION_DELETE;
}
// Verify share type and sharing conditions are met
@@ -701,7 +706,7 @@ class Share extends \OC\Share\Constants {
// check if it is a valid itemType
self::getBackend($itemType);
- $items = self::getItemSharedWithUser($itemType, $itemSource, $shareWith, $shareType);
+ $items = self::getItemSharedWithUser($itemType, $itemSource, $shareWith, null, $shareType);
$toDelete = array();
$newParent = null;
@@ -924,7 +929,7 @@ class Share extends \OC\Share\Constants {
// Check if permissions were removed
if ($item['permissions'] & ~$permissions) {
// If share permission is removed all reshares must be deleted
- if (($item['permissions'] & \OCP\PERMISSION_SHARE) && (~$permissions & \OCP\PERMISSION_SHARE)) {
+ if (($item['permissions'] & \OCP\Constants::PERMISSION_SHARE) && (~$permissions & \OCP\Constants::PERMISSION_SHARE)) {
Helper::delete($item['id'], true);
} else {
$ids = array();
@@ -1453,8 +1458,8 @@ class Share extends \OC\Share\Constants {
}
// Switch ids if sharing permission is granted on only
// one share to ensure correct parent is used if resharing
- if (~(int)$items[$id]['permissions'] & \OCP\PERMISSION_SHARE
- && (int)$row['permissions'] & \OCP\PERMISSION_SHARE) {
+ if (~(int)$items[$id]['permissions'] & \OCP\Constants::PERMISSION_SHARE
+ && (int)$row['permissions'] & \OCP\Constants::PERMISSION_SHARE) {
$items[$row['id']] = $items[$id];
$switchedItems[$id] = $row['id'];
unset($items[$id]);
@@ -1511,7 +1516,7 @@ class Share extends \OC\Share\Constants {
}
// Check if resharing is allowed, if not remove share permission
if (isset($row['permissions']) && (!self::isResharingAllowed() | \OC_Util::isSharingDisabledForUser())) {
- $row['permissions'] &= ~\OCP\PERMISSION_SHARE;
+ $row['permissions'] &= ~\OCP\Constants::PERMISSION_SHARE;
}
// Add display names to result
if ( isset($row['share_with']) && $row['share_with'] != '' &&
@@ -1629,7 +1634,7 @@ class Share extends \OC\Share\Constants {
// Need to find a solution which works for all back-ends
$collectionItems = array();
$collectionBackend = self::getBackend('folder');
- $sharedParents = $collectionBackend->getParents($item, $shareWith);
+ $sharedParents = $collectionBackend->getParents($item, $shareWith, $uidOwner);
foreach ($sharedParents as $parent) {
$collectionItems[] = $parent;
}
@@ -1906,7 +1911,7 @@ class Share extends \OC\Share\Constants {
}
// Check if share permissions is granted
- if (self::isResharingAllowed() && (int)$checkReshare['permissions'] & \OCP\PERMISSION_SHARE) {
+ if (self::isResharingAllowed() && (int)$checkReshare['permissions'] & \OCP\Constants::PERMISSION_SHARE) {
if (~(int)$checkReshare['permissions'] & $permissions) {
$message = 'Sharing %s failed, because the permissions exceed permissions granted to %s';
$message_t = $l->t('Sharing %s failed, because the permissions exceed permissions granted to %s', array($itemSourceName, $uidOwner));
diff --git a/lib/private/urlgenerator.php b/lib/private/urlgenerator.php
index e50e9eed6af..d263d25aeef 100644
--- a/lib/private/urlgenerator.php
+++ b/lib/private/urlgenerator.php
@@ -8,6 +8,7 @@
*/
namespace OC;
+use OC_Defaults;
use OCP\IURLGenerator;
use RuntimeException;
@@ -156,7 +157,7 @@ class URLGenerator implements IURLGenerator {
/**
* Makes an URL absolute
- * @param string $url the url in the owncloud host
+ * @param string $url the url in the ownCloud host
* @return string the absolute version of the url
*/
public function getAbsoluteURL($url) {
@@ -173,4 +174,13 @@ class URLGenerator implements IURLGenerator {
return \OC_Request::serverProtocol() . '://' . \OC_Request::serverHost(). $webRoot . $separator . $url;
}
+
+ /**
+ * @param string $key
+ * @return string url to the online documentation
+ */
+ public function linkToDocs($key) {
+ $theme = new OC_Defaults();
+ return $theme->buildDocLinkToKey($key);
+ }
}
diff --git a/lib/private/util.php b/lib/private/util.php
index 4190f0aa3d8..a18a4e44232 100644
--- a/lib/private/util.php
+++ b/lib/private/util.php
@@ -1336,7 +1336,7 @@ class OC_Util {
return false;
}
foreach (str_split($trimmed) as $char) {
- if (strpos(\OCP\FILENAME_INVALID_CHARS, $char) !== false) {
+ if (strpos(\OCP\Constants::FILENAME_INVALID_CHARS, $char) !== false) {
return false;
}
}
diff --git a/lib/public/appframework/iapi.php b/lib/public/appframework/iapi.php
index 9af251be850..ecbc0fd1900 100644
--- a/lib/public/appframework/iapi.php
+++ b/lib/public/appframework/iapi.php
@@ -37,6 +37,7 @@ interface IApi {
/**
* Gets the userid of the current user
* @return string the user id of the current user
+ * @deprecated Use \OC::$server->getUserSession()->getUser()->getUID()
*/
function getUserId();
diff --git a/lib/public/constants.php b/lib/public/constants.php
index 350646a0ac0..78cafd11847 100644
--- a/lib/public/constants.php
+++ b/lib/public/constants.php
@@ -26,15 +26,37 @@
namespace OCP;
-/**
- * CRUDS permissions.
- */
+/** @deprecated Use \OCP\Constants::PERMISSION_CREATE instead */
const PERMISSION_CREATE = 4;
+
+/** @deprecated Use \OCP\Constants::PERMISSION_READ instead */
const PERMISSION_READ = 1;
+
+/** @deprecated Use \OCP\Constants::PERMISSION_UPDATE instead */
const PERMISSION_UPDATE = 2;
+
+/** @deprecated Use \OCP\Constants::PERMISSION_DELETE instead */
const PERMISSION_DELETE = 8;
+
+/** @deprecated Use \OCP\Constants::PERMISSION_SHARE instead */
const PERMISSION_SHARE = 16;
+
+/** @deprecated Use \OCP\Constants::PERMISSION_ALL instead */
const PERMISSION_ALL = 31;
+/** @deprecated Use \OCP\Constants::FILENAME_INVALID_CHARS instead */
const FILENAME_INVALID_CHARS = "\\/<>:\"|?*\n";
+class Constants {
+ /**
+ * CRUDS permissions.
+ */
+ const PERMISSION_CREATE = 4;
+ const PERMISSION_READ = 1;
+ const PERMISSION_UPDATE = 2;
+ const PERMISSION_DELETE = 8;
+ const PERMISSION_SHARE = 16;
+ const PERMISSION_ALL = 31;
+
+ const FILENAME_INVALID_CHARS = "\\/<>:\"|?*\n";
+}
diff --git a/lib/public/files/fileinfo.php b/lib/public/files/fileinfo.php
index ec81a541564..3a407ed67ca 100644
--- a/lib/public/files/fileinfo.php
+++ b/lib/public/files/fileinfo.php
@@ -103,12 +103,12 @@ interface FileInfo {
/**
* Get the permissions of the file or folder as bitmasked combination of the following constants
- * \OCP\PERMISSION_CREATE
- * \OCP\PERMISSION_READ
- * \OCP\PERMISSION_UPDATE
- * \OCP\PERMISSION_DELETE
- * \OCP\PERMISSION_SHARE
- * \OCP\PERMISSION_ALL
+ * \OCP\Constants::PERMISSION_CREATE
+ * \OCP\Constants::PERMISSION_READ
+ * \OCP\Constants::PERMISSION_UPDATE
+ * \OCP\Constants::PERMISSION_DELETE
+ * \OCP\Constants::PERMISSION_SHARE
+ * \OCP\Constants::PERMISSION_ALL
*
* @return int
*/
diff --git a/lib/public/files/node.php b/lib/public/files/node.php
index a380394095b..35c20b487c9 100644
--- a/lib/public/files/node.php
+++ b/lib/public/files/node.php
@@ -128,11 +128,11 @@ interface Node {
/**
* Get the permissions of the file or folder as a combination of one or more of the following constants:
- * - \OCP\PERMISSION_READ
- * - \OCP\PERMISSION_UPDATE
- * - \OCP\PERMISSION_CREATE
- * - \OCP\PERMISSION_DELETE
- * - \OCP\PERMISSION_SHARE
+ * - \OCP\Constants::PERMISSION_READ
+ * - \OCP\Constants::PERMISSION_UPDATE
+ * - \OCP\Constants::PERMISSION_CREATE
+ * - \OCP\Constants::PERMISSION_DELETE
+ * - \OCP\Constants::PERMISSION_SHARE
*
* @return int
*/
diff --git a/lib/public/iavatar.php b/lib/public/iavatar.php
index 1e80682c4f7..213d2e6cef5 100644
--- a/lib/public/iavatar.php
+++ b/lib/public/iavatar.php
@@ -23,9 +23,9 @@ interface IAvatar {
/**
* sets the users avatar
* @param Image $data mixed imagedata or path to set a new avatar
- * @throws Exception if the provided file is not a jpg or png image
- * @throws Exception if the provided image is not valid
- * @throws \OCP\NotSquareException if the image is not square
+ * @throws \Exception if the provided file is not a jpg or png image
+ * @throws \Exception if the provided image is not valid
+ * @throws \OC\NotSquareException if the image is not square
* @return void
*/
function set($data);
diff --git a/lib/public/iurlgenerator.php b/lib/public/iurlgenerator.php
index dbbd8a3bb63..fa817c10ea5 100644
--- a/lib/public/iurlgenerator.php
+++ b/lib/public/iurlgenerator.php
@@ -69,8 +69,14 @@ interface IURLGenerator {
/**
* Makes an URL absolute
- * @param string $url the url in the owncloud host
+ * @param string $url the url in the ownCloud host
* @return string the absolute version of the url
*/
public function getAbsoluteURL($url);
+
+ /**
+ * @param string $key
+ * @return string url to the online documentation
+ */
+ public function linkToDocs($key);
}
diff --git a/lib/public/share.php b/lib/public/share.php
index 449d1fa211e..333e0a26970 100644
--- a/lib/public/share.php
+++ b/lib/public/share.php
@@ -125,11 +125,12 @@ class Share extends \OC\Share\Constants {
* Get the item of item type shared with a given user by source
* @param string $itemType
* @param string $itemSource
- * @param string $user User user to whom the item was shared
+ * @param string $user User to whom the item was shared
+ * @param string $owner Owner of the share
* @return array Return list of items with file_target, permissions and expiration
*/
- public static function getItemSharedWithUser($itemType, $itemSource, $user) {
- return \OC\Share\Share::getItemSharedWithUser($itemType, $itemSource, $user);
+ public static function getItemSharedWithUser($itemType, $itemSource, $user, $owner = null) {
+ return \OC\Share\Share::getItemSharedWithUser($itemType, $itemSource, $user, $owner);
}
/**
diff --git a/lib/public/template.php b/lib/public/template.php
index 2e265bb5e8e..a1b650649ff 100644
--- a/lib/public/template.php
+++ b/lib/public/template.php
@@ -88,7 +88,7 @@ function human_file_size( $bytes ) {
* Return the relative date in relation to today. Returns something like "last hour" or "two month ago"
* @param int $timestamp unix timestamp
* @param boolean $dateOnly
- * @return OC_L10N_String human readable interpretation of the timestamp
+ * @return \OC_L10N_String human readable interpretation of the timestamp
*/
function relative_modified_date( $timestamp, $dateOnly = false ) {
return(\relative_modified_date($timestamp, null, $dateOnly));
diff --git a/lib/public/user.php b/lib/public/user.php
index 925410d37d5..e9835620433 100644
--- a/lib/public/user.php
+++ b/lib/public/user.php
@@ -38,6 +38,7 @@ class User {
/**
* Get the user id of the user currently logged in.
* @return string uid or false
+ * @deprecated Use \OC::$server->getUserSession()->getUser()->getUID()
*/
public static function getUser() {
return \OC_User::getUser();
@@ -94,6 +95,7 @@ class User {
/**
* Logs the user out including all the session data
* Logout, destroys session
+ * @deprecated Use \OC::$server->getUserSession()->logout();
*/
public static function logout() {
\OC_User::logout();
@@ -106,6 +108,7 @@ class User {
* @return string|false username on success, false otherwise
*
* Check if the password is correct without logging in the user
+ * @deprecated Use \OC::$server->getUserManager()->checkPassword();
*/
public static function checkPassword( $uid, $password ) {
return \OC_User::checkPassword( $uid, $password );
diff --git a/lib/public/util.php b/lib/public/util.php
index a87d26a4004..793a16c4d84 100644
--- a/lib/public/util.php
+++ b/lib/public/util.php
@@ -508,8 +508,8 @@ class Util {
/**
* Compare two strings to provide a natural sort
- * @param $a first string to compare
- * @param $b second string to compare
+ * @param string $a first string to compare
+ * @param string $b second string to compare
* @return -1 if $b comes before $a, 1 if $a comes before $b
* or 0 if the strings are identical
*/
diff --git a/settings/admin.php b/settings/admin.php
index d1ed6e75f50..a669974891c 100644
--- a/settings/admin.php
+++ b/settings/admin.php
@@ -17,7 +17,7 @@ $config = \OC::$server->getConfig();
$appConfig = \OC::$server->getAppConfig();
// Should we display sendmail as an option?
-$template->assign('sendmail_is_available', (bool)findBinaryPath('sendmail'));
+$template->assign('sendmail_is_available', (bool) \OC_Helper::findBinaryPath('sendmail'));
$template->assign('loglevel', $config->getSystemValue("loglevel", 2));
$template->assign('mail_domain', $config->getSystemValue("mail_domain", ''));
@@ -115,19 +115,3 @@ $formsAndMore[] = array('anchor' => 'log-section', 'section-name' => $l->t('Log'
$template->assign('forms', $formsAndMore);
$template->printPage();
-
-/**
- * Try to find a program
- *
- * @param string $program
- * @return null|string
- */
-function findBinaryPath($program) {
- if (OC_Helper::is_function_enabled('exec')) {
- exec('command -v ' . escapeshellarg($program) . ' 2> /dev/null', $output, $returnCode);
- if ($returnCode === 0 && count($output) > 0) {
- return escapeshellcmd($output[0]);
- }
- }
- return null;
-}
diff --git a/settings/l10n/cs_CZ.js b/settings/l10n/cs_CZ.js
index b16dbe013b8..d4871378c04 100644
--- a/settings/l10n/cs_CZ.js
+++ b/settings/l10n/cs_CZ.js
@@ -117,6 +117,7 @@ OC.L10N.register(
"Locale not working" : "Lokalizace nefunguje",
"System locale can not be set to a one which supports UTF-8." : "Není možné nastavit znakovou sadu, která podporuje UTF-8.",
"This means that there might be problems with certain characters in file names." : "To znamená, že se mohou vyskytnout problémy s určitými znaky v názvech souborů.",
+ "We strongly suggest installing the required packages on your system to support one of the following locales: %s." : "Velmi doporučujeme nainstalovat požadované balíčky do systému, pro podporu jednoho z následujících národních prostředí: %s.",
"URL generation in notification emails" : "Generování adresy URL v oznamovacích e-mailech",
"If your installation is not installed in the root of the domain and uses system cron, there can be issues with the URL generation. To avoid these problems, please set the \"overwritewebroot\" option in your config.php file to the webroot path of your installation (Suggested: \"%s\")" : "Instalace mimo kořenový adresář domény a používání systémového příkazu cron může způsobit problém s generováním správné URL. Pro zabránění těmto chybám nastavte prosím správnou cestu ve svém config.php souboru v hodnotě \"overwritewebroot\" (Doporučujeme: \"%s\")",
"Connectivity Checks" : "Ověřování připojení",
diff --git a/settings/l10n/cs_CZ.json b/settings/l10n/cs_CZ.json
index c6059695c26..572dd26dfe3 100644
--- a/settings/l10n/cs_CZ.json
+++ b/settings/l10n/cs_CZ.json
@@ -115,6 +115,7 @@
"Locale not working" : "Lokalizace nefunguje",
"System locale can not be set to a one which supports UTF-8." : "Není možné nastavit znakovou sadu, která podporuje UTF-8.",
"This means that there might be problems with certain characters in file names." : "To znamená, že se mohou vyskytnout problémy s určitými znaky v názvech souborů.",
+ "We strongly suggest installing the required packages on your system to support one of the following locales: %s." : "Velmi doporučujeme nainstalovat požadované balíčky do systému, pro podporu jednoho z následujících národních prostředí: %s.",
"URL generation in notification emails" : "Generování adresy URL v oznamovacích e-mailech",
"If your installation is not installed in the root of the domain and uses system cron, there can be issues with the URL generation. To avoid these problems, please set the \"overwritewebroot\" option in your config.php file to the webroot path of your installation (Suggested: \"%s\")" : "Instalace mimo kořenový adresář domény a používání systémového příkazu cron může způsobit problém s generováním správné URL. Pro zabránění těmto chybám nastavte prosím správnou cestu ve svém config.php souboru v hodnotě \"overwritewebroot\" (Doporučujeme: \"%s\")",
"Connectivity Checks" : "Ověřování připojení",
diff --git a/settings/l10n/da.js b/settings/l10n/da.js
index 6f5112cad1f..67022dd176e 100644
--- a/settings/l10n/da.js
+++ b/settings/l10n/da.js
@@ -117,6 +117,7 @@ OC.L10N.register(
"Locale not working" : "Landestandard fungerer ikke",
"System locale can not be set to a one which supports UTF-8." : "Systemets locale kan ikke sættes til et der bruger UTF-8.",
"This means that there might be problems with certain characters in file names." : "Det betyder at der kan være problemer med visse tegn i filnavne.",
+ "We strongly suggest installing the required packages on your system to support one of the following locales: %s." : "Vi anbefaler kraftigt, at du installerer den krævede pakke på dit system, for at understøtte følgende lokaliteter: %s.",
"URL generation in notification emails" : "URL-oprettelse i e-mailnotifikationer.",
"If your installation is not installed in the root of the domain and uses system cron, there can be issues with the URL generation. To avoid these problems, please set the \"overwritewebroot\" option in your config.php file to the webroot path of your installation (Suggested: \"%s\")" : "Hvis din installation ikke er installeret i roden af domænet, og bruger systemets cron, så kan der være problemer med URL-oprettelsen. For at undgå disse problemer, så angiv tilvalget \"overwritewebroot\" i din fil config.php til webrodens sti for din installation (foreslået værdi: \"%s\")",
"Connectivity Checks" : "Forbindelsestjek",
diff --git a/settings/l10n/da.json b/settings/l10n/da.json
index 33deff944cb..48ee293e1ec 100644
--- a/settings/l10n/da.json
+++ b/settings/l10n/da.json
@@ -115,6 +115,7 @@
"Locale not working" : "Landestandard fungerer ikke",
"System locale can not be set to a one which supports UTF-8." : "Systemets locale kan ikke sættes til et der bruger UTF-8.",
"This means that there might be problems with certain characters in file names." : "Det betyder at der kan være problemer med visse tegn i filnavne.",
+ "We strongly suggest installing the required packages on your system to support one of the following locales: %s." : "Vi anbefaler kraftigt, at du installerer den krævede pakke på dit system, for at understøtte følgende lokaliteter: %s.",
"URL generation in notification emails" : "URL-oprettelse i e-mailnotifikationer.",
"If your installation is not installed in the root of the domain and uses system cron, there can be issues with the URL generation. To avoid these problems, please set the \"overwritewebroot\" option in your config.php file to the webroot path of your installation (Suggested: \"%s\")" : "Hvis din installation ikke er installeret i roden af domænet, og bruger systemets cron, så kan der være problemer med URL-oprettelsen. For at undgå disse problemer, så angiv tilvalget \"overwritewebroot\" i din fil config.php til webrodens sti for din installation (foreslået værdi: \"%s\")",
"Connectivity Checks" : "Forbindelsestjek",
diff --git a/settings/l10n/de.js b/settings/l10n/de.js
index 01068350307..e11aa7c23d7 100644
--- a/settings/l10n/de.js
+++ b/settings/l10n/de.js
@@ -117,6 +117,7 @@ OC.L10N.register(
"Locale not working" : "Ländereinstellung funktioniert nicht",
"System locale can not be set to a one which supports UTF-8." : "Systemgebietsschema kann nicht auf eine UTF-8 unterstützende eingestellt werden.",
"This means that there might be problems with certain characters in file names." : "Dies bedeutet, dass Probleme mit bestimmten Zeichen in den Dateinamen geben kann.",
+ "We strongly suggest installing the required packages on your system to support one of the following locales: %s." : "Wir empfehlen dringend, die erforderlichen Pakete auf Ihrem System zu installieren, damit eine der folgenden Gebietsschemas unterstützt wird: %s.",
"URL generation in notification emails" : "URL-Generierung in Mail-Benachrichtungen",
"If your installation is not installed in the root of the domain and uses system cron, there can be issues with the URL generation. To avoid these problems, please set the \"overwritewebroot\" option in your config.php file to the webroot path of your installation (Suggested: \"%s\")" : "Wenn sich Deine Installation nicht im Wurzelverzeichnis der Domain befindet und Cron aus dem System genutzt wird, kann es zu Fehlern bei der URL-Generierung kommen. Um dies zu verhindern, setze bitte die \"overwritewebroot\"-Option in Deiner config.php auf das Web-Wurzelverzeichnis Deiner Installation (Vorschlag: \"%s\").",
"Connectivity Checks" : "Verbindungsüberprüfungen",
diff --git a/settings/l10n/de.json b/settings/l10n/de.json
index b63775263e7..74c3f7cf970 100644
--- a/settings/l10n/de.json
+++ b/settings/l10n/de.json
@@ -115,6 +115,7 @@
"Locale not working" : "Ländereinstellung funktioniert nicht",
"System locale can not be set to a one which supports UTF-8." : "Systemgebietsschema kann nicht auf eine UTF-8 unterstützende eingestellt werden.",
"This means that there might be problems with certain characters in file names." : "Dies bedeutet, dass Probleme mit bestimmten Zeichen in den Dateinamen geben kann.",
+ "We strongly suggest installing the required packages on your system to support one of the following locales: %s." : "Wir empfehlen dringend, die erforderlichen Pakete auf Ihrem System zu installieren, damit eine der folgenden Gebietsschemas unterstützt wird: %s.",
"URL generation in notification emails" : "URL-Generierung in Mail-Benachrichtungen",
"If your installation is not installed in the root of the domain and uses system cron, there can be issues with the URL generation. To avoid these problems, please set the \"overwritewebroot\" option in your config.php file to the webroot path of your installation (Suggested: \"%s\")" : "Wenn sich Deine Installation nicht im Wurzelverzeichnis der Domain befindet und Cron aus dem System genutzt wird, kann es zu Fehlern bei der URL-Generierung kommen. Um dies zu verhindern, setze bitte die \"overwritewebroot\"-Option in Deiner config.php auf das Web-Wurzelverzeichnis Deiner Installation (Vorschlag: \"%s\").",
"Connectivity Checks" : "Verbindungsüberprüfungen",
diff --git a/settings/l10n/de_DE.js b/settings/l10n/de_DE.js
index 7869e5583e9..a802c80f719 100644
--- a/settings/l10n/de_DE.js
+++ b/settings/l10n/de_DE.js
@@ -117,6 +117,7 @@ OC.L10N.register(
"Locale not working" : "Die Lokalisierung funktioniert nicht",
"System locale can not be set to a one which supports UTF-8." : "Systemgebietsschema kann nicht auf eine UTF-8 unterstützende eingestellt werden.",
"This means that there might be problems with certain characters in file names." : "Dieses bedeutet, dass es Probleme mit bestimmten Zeichen in den Dateinamen geben kann.",
+ "We strongly suggest installing the required packages on your system to support one of the following locales: %s." : "Wir empfehlen dringend, die erforderlichen Pakete auf Ihrem System zu installieren, damit eine der folgenden Gebietsschemas unterstützt wird: %s.",
"URL generation in notification emails" : "Adresserstellung in E-Mail-Benachrichtungen",
"If your installation is not installed in the root of the domain and uses system cron, there can be issues with the URL generation. To avoid these problems, please set the \"overwritewebroot\" option in your config.php file to the webroot path of your installation (Suggested: \"%s\")" : "Wenn sich Ihre Installation nicht im Wurzelverzeichnis der Domain befindet und Cron aus dem System genutzt wird, kann es zu Fehlern bei der Adresserstellung kommen. Um dieses zu verhindern, stellen Sie bitte die »overwritewebroot«-Option in Ihrer config.php auf das Internetwurzelverzeichnis Ihrer Installation (Vorschlag: »%s«).",
"Connectivity Checks" : "Verbindungsüberprüfungen",
diff --git a/settings/l10n/de_DE.json b/settings/l10n/de_DE.json
index 9466f295c4a..0f1e8d07932 100644
--- a/settings/l10n/de_DE.json
+++ b/settings/l10n/de_DE.json
@@ -115,6 +115,7 @@
"Locale not working" : "Die Lokalisierung funktioniert nicht",
"System locale can not be set to a one which supports UTF-8." : "Systemgebietsschema kann nicht auf eine UTF-8 unterstützende eingestellt werden.",
"This means that there might be problems with certain characters in file names." : "Dieses bedeutet, dass es Probleme mit bestimmten Zeichen in den Dateinamen geben kann.",
+ "We strongly suggest installing the required packages on your system to support one of the following locales: %s." : "Wir empfehlen dringend, die erforderlichen Pakete auf Ihrem System zu installieren, damit eine der folgenden Gebietsschemas unterstützt wird: %s.",
"URL generation in notification emails" : "Adresserstellung in E-Mail-Benachrichtungen",
"If your installation is not installed in the root of the domain and uses system cron, there can be issues with the URL generation. To avoid these problems, please set the \"overwritewebroot\" option in your config.php file to the webroot path of your installation (Suggested: \"%s\")" : "Wenn sich Ihre Installation nicht im Wurzelverzeichnis der Domain befindet und Cron aus dem System genutzt wird, kann es zu Fehlern bei der Adresserstellung kommen. Um dieses zu verhindern, stellen Sie bitte die »overwritewebroot«-Option in Ihrer config.php auf das Internetwurzelverzeichnis Ihrer Installation (Vorschlag: »%s«).",
"Connectivity Checks" : "Verbindungsüberprüfungen",
diff --git a/settings/l10n/en_GB.js b/settings/l10n/en_GB.js
index 07f565291be..f33ccbcfdce 100644
--- a/settings/l10n/en_GB.js
+++ b/settings/l10n/en_GB.js
@@ -117,6 +117,7 @@ OC.L10N.register(
"Locale not working" : "Locale not working",
"System locale can not be set to a one which supports UTF-8." : "System locale can not be set to a one which supports UTF-8.",
"This means that there might be problems with certain characters in file names." : "This means that there might be problems with certain characters in file names.",
+ "We strongly suggest installing the required packages on your system to support one of the following locales: %s." : "We strongly suggest installing the required packages on your system to support one of the following locales: %s.",
"URL generation in notification emails" : "URL generation in notification emails",
"If your installation is not installed in the root of the domain and uses system cron, there can be issues with the URL generation. To avoid these problems, please set the \"overwritewebroot\" option in your config.php file to the webroot path of your installation (Suggested: \"%s\")" : "If your installation is not installed in the root of the domain and uses system cron, there can be issues with the URL generation. To avoid these problems, please set the \"overwritewebroot\" option in your config.php file to the webroot path of your installation (Suggested: \"%s\")",
"Connectivity Checks" : "Connectivity Checks",
diff --git a/settings/l10n/en_GB.json b/settings/l10n/en_GB.json
index ca307c39c23..5ad52ed5b56 100644
--- a/settings/l10n/en_GB.json
+++ b/settings/l10n/en_GB.json
@@ -115,6 +115,7 @@
"Locale not working" : "Locale not working",
"System locale can not be set to a one which supports UTF-8." : "System locale can not be set to a one which supports UTF-8.",
"This means that there might be problems with certain characters in file names." : "This means that there might be problems with certain characters in file names.",
+ "We strongly suggest installing the required packages on your system to support one of the following locales: %s." : "We strongly suggest installing the required packages on your system to support one of the following locales: %s.",
"URL generation in notification emails" : "URL generation in notification emails",
"If your installation is not installed in the root of the domain and uses system cron, there can be issues with the URL generation. To avoid these problems, please set the \"overwritewebroot\" option in your config.php file to the webroot path of your installation (Suggested: \"%s\")" : "If your installation is not installed in the root of the domain and uses system cron, there can be issues with the URL generation. To avoid these problems, please set the \"overwritewebroot\" option in your config.php file to the webroot path of your installation (Suggested: \"%s\")",
"Connectivity Checks" : "Connectivity Checks",
diff --git a/settings/l10n/es.js b/settings/l10n/es.js
index feb83325f3e..d49f8116bb7 100644
--- a/settings/l10n/es.js
+++ b/settings/l10n/es.js
@@ -117,6 +117,7 @@ OC.L10N.register(
"Locale not working" : "La configuración regional no está funcionando",
"System locale can not be set to a one which supports UTF-8." : "No se puede escoger una configuración regional que soporte UTF-8.",
"This means that there might be problems with certain characters in file names." : "Esto significa que puede haber problemas con ciertos caracteres en los nombres de los archivos.",
+ "We strongly suggest installing the required packages on your system to support one of the following locales: %s." : "Es muy recomendable instalar los paquetes necesarios para poder soportar una de las siguientes configuraciones regionales: %s. ",
"URL generation in notification emails" : "Generación de URL en mensajes de notificación",
"If your installation is not installed in the root of the domain and uses system cron, there can be issues with the URL generation. To avoid these problems, please set the \"overwritewebroot\" option in your config.php file to the webroot path of your installation (Suggested: \"%s\")" : "Si su instalación no está ubicada en la raíz del dominio y usa el cron del sistema, puede haber problemas al generarse los URL. Para evitarlos, configure la opción \"overwritewebroot\" en su archivo config.php para que use la ruta de la raíz del sitio web de su instalación (sugerencia: \"%s\")",
"Connectivity Checks" : "Probar la Conectividad",
diff --git a/settings/l10n/es.json b/settings/l10n/es.json
index 21b02b3797e..256e9fa7beb 100644
--- a/settings/l10n/es.json
+++ b/settings/l10n/es.json
@@ -115,6 +115,7 @@
"Locale not working" : "La configuración regional no está funcionando",
"System locale can not be set to a one which supports UTF-8." : "No se puede escoger una configuración regional que soporte UTF-8.",
"This means that there might be problems with certain characters in file names." : "Esto significa que puede haber problemas con ciertos caracteres en los nombres de los archivos.",
+ "We strongly suggest installing the required packages on your system to support one of the following locales: %s." : "Es muy recomendable instalar los paquetes necesarios para poder soportar una de las siguientes configuraciones regionales: %s. ",
"URL generation in notification emails" : "Generación de URL en mensajes de notificación",
"If your installation is not installed in the root of the domain and uses system cron, there can be issues with the URL generation. To avoid these problems, please set the \"overwritewebroot\" option in your config.php file to the webroot path of your installation (Suggested: \"%s\")" : "Si su instalación no está ubicada en la raíz del dominio y usa el cron del sistema, puede haber problemas al generarse los URL. Para evitarlos, configure la opción \"overwritewebroot\" en su archivo config.php para que use la ruta de la raíz del sitio web de su instalación (sugerencia: \"%s\")",
"Connectivity Checks" : "Probar la Conectividad",
diff --git a/settings/l10n/fi_FI.js b/settings/l10n/fi_FI.js
index 762eda8c7b4..3965f7e9159 100644
--- a/settings/l10n/fi_FI.js
+++ b/settings/l10n/fi_FI.js
@@ -114,6 +114,7 @@ OC.L10N.register(
"Locale not working" : "Maa-asetus ei toimi",
"System locale can not be set to a one which supports UTF-8." : "Järjestelmän maa-asetusta ei voi asettaa UTF-8:aa tukevaksi.",
"This means that there might be problems with certain characters in file names." : "Tämä tarkoittaa, että tiettyjen merkkien kanssa tiedostojen nimissä saattaa olla ongelmia.",
+ "We strongly suggest installing the required packages on your system to support one of the following locales: %s." : "Suosittelemme asentamaan vaaditut paketit järjestelmään, jotta järjestelmässä on tuki yhdelle seuraavista maa-asetuksista: %s.",
"URL generation in notification emails" : "Verkko-osoitteiden luominen sähköposti-ilmoituksissa",
"No problems found" : "Ongelmia ei löytynyt",
"Please double check the <a href='%s'>installation guides</a>." : "Lue tarkasti <a href='%s'>asennusohjeet</a>.",
diff --git a/settings/l10n/fi_FI.json b/settings/l10n/fi_FI.json
index fea5b3b00ae..4fc99b5fdf3 100644
--- a/settings/l10n/fi_FI.json
+++ b/settings/l10n/fi_FI.json
@@ -112,6 +112,7 @@
"Locale not working" : "Maa-asetus ei toimi",
"System locale can not be set to a one which supports UTF-8." : "Järjestelmän maa-asetusta ei voi asettaa UTF-8:aa tukevaksi.",
"This means that there might be problems with certain characters in file names." : "Tämä tarkoittaa, että tiettyjen merkkien kanssa tiedostojen nimissä saattaa olla ongelmia.",
+ "We strongly suggest installing the required packages on your system to support one of the following locales: %s." : "Suosittelemme asentamaan vaaditut paketit järjestelmään, jotta järjestelmässä on tuki yhdelle seuraavista maa-asetuksista: %s.",
"URL generation in notification emails" : "Verkko-osoitteiden luominen sähköposti-ilmoituksissa",
"No problems found" : "Ongelmia ei löytynyt",
"Please double check the <a href='%s'>installation guides</a>." : "Lue tarkasti <a href='%s'>asennusohjeet</a>.",
diff --git a/settings/l10n/fr.js b/settings/l10n/fr.js
index 5a99912aeed..816b9e88565 100644
--- a/settings/l10n/fr.js
+++ b/settings/l10n/fr.js
@@ -117,6 +117,7 @@ OC.L10N.register(
"Locale not working" : "Localisation non fonctionnelle",
"System locale can not be set to a one which supports UTF-8." : "Les paramètres régionaux ne peuvent pas être configurés avec prise en charge d'UTF-8.",
"This means that there might be problems with certain characters in file names." : "Cela signifie qu'il pourrait y avoir des problèmes avec certains caractères dans les noms de fichier.",
+ "We strongly suggest installing the required packages on your system to support one of the following locales: %s." : "Nous vous recommandons d'installer sur votre système les paquets requis à la prise en charge de l'un des paramètres régionaux suivants : %s",
"URL generation in notification emails" : "Génération d'URL dans les mails de notification",
"If your installation is not installed in the root of the domain and uses system cron, there can be issues with the URL generation. To avoid these problems, please set the \"overwritewebroot\" option in your config.php file to the webroot path of your installation (Suggested: \"%s\")" : "Si votre installation n'a pas été effectuée à la racine du domaine et qu'elle utilise le cron du système, il peut y avoir des problèmes avec la génération d'URL. Pour les éviter, veuillez configurer l'option \"overwritewebroot\" de votre fichier config.php avec le chemin de la racine de votre installation (suggéré : \"%s\")",
"Connectivity Checks" : "Vérification de la connectivité",
diff --git a/settings/l10n/fr.json b/settings/l10n/fr.json
index 433816d2316..1bc80fc4d01 100644
--- a/settings/l10n/fr.json
+++ b/settings/l10n/fr.json
@@ -115,6 +115,7 @@
"Locale not working" : "Localisation non fonctionnelle",
"System locale can not be set to a one which supports UTF-8." : "Les paramètres régionaux ne peuvent pas être configurés avec prise en charge d'UTF-8.",
"This means that there might be problems with certain characters in file names." : "Cela signifie qu'il pourrait y avoir des problèmes avec certains caractères dans les noms de fichier.",
+ "We strongly suggest installing the required packages on your system to support one of the following locales: %s." : "Nous vous recommandons d'installer sur votre système les paquets requis à la prise en charge de l'un des paramètres régionaux suivants : %s",
"URL generation in notification emails" : "Génération d'URL dans les mails de notification",
"If your installation is not installed in the root of the domain and uses system cron, there can be issues with the URL generation. To avoid these problems, please set the \"overwritewebroot\" option in your config.php file to the webroot path of your installation (Suggested: \"%s\")" : "Si votre installation n'a pas été effectuée à la racine du domaine et qu'elle utilise le cron du système, il peut y avoir des problèmes avec la génération d'URL. Pour les éviter, veuillez configurer l'option \"overwritewebroot\" de votre fichier config.php avec le chemin de la racine de votre installation (suggéré : \"%s\")",
"Connectivity Checks" : "Vérification de la connectivité",
diff --git a/settings/l10n/it.js b/settings/l10n/it.js
index 91d79356a1e..2748c43298d 100644
--- a/settings/l10n/it.js
+++ b/settings/l10n/it.js
@@ -117,6 +117,7 @@ OC.L10N.register(
"Locale not working" : "Locale non funzionante",
"System locale can not be set to a one which supports UTF-8." : "La localizzazione di sistema non può essere impostata a una che supporta UTF-8.",
"This means that there might be problems with certain characters in file names." : "Ciò significa che potrebbero esserci problemi con alcuni caratteri nei nomi dei file.",
+ "We strongly suggest installing the required packages on your system to support one of the following locales: %s." : "Consigliamo vivamente di installare i pacchetti richiesti sul tuo sistema per supportare una delle localizzazioni seguenti: %s.",
"URL generation in notification emails" : "Generazione di URL nelle email di notifica",
"If your installation is not installed in the root of the domain and uses system cron, there can be issues with the URL generation. To avoid these problems, please set the \"overwritewebroot\" option in your config.php file to the webroot path of your installation (Suggested: \"%s\")" : "Se la tua installazione non si trova nella radice del dominio e utilizza il cron di sistema, potrebbero esserci problemi con la generazione degli URL. Per evitare questi problemi, imposta l'opzione \"overwritewebroot\" nel file config.php al percorso della radice del sito della tua installazione (Suggerito: \"%s\")",
"Connectivity Checks" : "Controlli di connettività",
diff --git a/settings/l10n/it.json b/settings/l10n/it.json
index d34110e6162..f8e94b7288e 100644
--- a/settings/l10n/it.json
+++ b/settings/l10n/it.json
@@ -115,6 +115,7 @@
"Locale not working" : "Locale non funzionante",
"System locale can not be set to a one which supports UTF-8." : "La localizzazione di sistema non può essere impostata a una che supporta UTF-8.",
"This means that there might be problems with certain characters in file names." : "Ciò significa che potrebbero esserci problemi con alcuni caratteri nei nomi dei file.",
+ "We strongly suggest installing the required packages on your system to support one of the following locales: %s." : "Consigliamo vivamente di installare i pacchetti richiesti sul tuo sistema per supportare una delle localizzazioni seguenti: %s.",
"URL generation in notification emails" : "Generazione di URL nelle email di notifica",
"If your installation is not installed in the root of the domain and uses system cron, there can be issues with the URL generation. To avoid these problems, please set the \"overwritewebroot\" option in your config.php file to the webroot path of your installation (Suggested: \"%s\")" : "Se la tua installazione non si trova nella radice del dominio e utilizza il cron di sistema, potrebbero esserci problemi con la generazione degli URL. Per evitare questi problemi, imposta l'opzione \"overwritewebroot\" nel file config.php al percorso della radice del sito della tua installazione (Suggerito: \"%s\")",
"Connectivity Checks" : "Controlli di connettività",
diff --git a/settings/l10n/nl.js b/settings/l10n/nl.js
index 21bd2f1ec7a..8e38125bb43 100644
--- a/settings/l10n/nl.js
+++ b/settings/l10n/nl.js
@@ -117,6 +117,7 @@ OC.L10N.register(
"Locale not working" : "Taalbestand werkt niet",
"System locale can not be set to a one which supports UTF-8." : "De systeemtaal kan niet worden ingesteld op een taal die UTF-8 ondersteunt.",
"This means that there might be problems with certain characters in file names." : "Dat betekent dat er problemen kunnen optreden met bepaalde tekens in bestandsnamen.",
+ "We strongly suggest installing the required packages on your system to support one of the following locales: %s." : "We adviseren met klem om de noodzakelijke pakketten op uw systeem te installeren om een van de volgende talen te ondersteunen: %s.",
"URL generation in notification emails" : "URL genereren in notificatie e-mails",
"If your installation is not installed in the root of the domain and uses system cron, there can be issues with the URL generation. To avoid these problems, please set the \"overwritewebroot\" option in your config.php file to the webroot path of your installation (Suggested: \"%s\")" : "Als uw installatie niet in de hoofddirectory van het domein staat, maar wel cron gebruikt, dan kunnen er problemen ontstaan bij het genereren van URL's. Om deze problemen te voorkomen zou u de \"overwritewebroot\" optie in config.php moeten instellen op het webroot pad van uw ownCloud (aanbevolen: \"%s\") ",
"Connectivity Checks" : "Verbindingscontroles",
diff --git a/settings/l10n/nl.json b/settings/l10n/nl.json
index 75870735391..8d5ef3d25e3 100644
--- a/settings/l10n/nl.json
+++ b/settings/l10n/nl.json
@@ -115,6 +115,7 @@
"Locale not working" : "Taalbestand werkt niet",
"System locale can not be set to a one which supports UTF-8." : "De systeemtaal kan niet worden ingesteld op een taal die UTF-8 ondersteunt.",
"This means that there might be problems with certain characters in file names." : "Dat betekent dat er problemen kunnen optreden met bepaalde tekens in bestandsnamen.",
+ "We strongly suggest installing the required packages on your system to support one of the following locales: %s." : "We adviseren met klem om de noodzakelijke pakketten op uw systeem te installeren om een van de volgende talen te ondersteunen: %s.",
"URL generation in notification emails" : "URL genereren in notificatie e-mails",
"If your installation is not installed in the root of the domain and uses system cron, there can be issues with the URL generation. To avoid these problems, please set the \"overwritewebroot\" option in your config.php file to the webroot path of your installation (Suggested: \"%s\")" : "Als uw installatie niet in de hoofddirectory van het domein staat, maar wel cron gebruikt, dan kunnen er problemen ontstaan bij het genereren van URL's. Om deze problemen te voorkomen zou u de \"overwritewebroot\" optie in config.php moeten instellen op het webroot pad van uw ownCloud (aanbevolen: \"%s\") ",
"Connectivity Checks" : "Verbindingscontroles",
diff --git a/settings/l10n/pt_BR.js b/settings/l10n/pt_BR.js
index 81be17f00cb..1d280fa1439 100644
--- a/settings/l10n/pt_BR.js
+++ b/settings/l10n/pt_BR.js
@@ -117,6 +117,7 @@ OC.L10N.register(
"Locale not working" : "Localização não funcionando",
"System locale can not be set to a one which supports UTF-8." : "Localidade do sistema não pode ser definido como um que suporta UTF-8.",
"This means that there might be problems with certain characters in file names." : "Isso significa que pode haver problemas com certos caracteres nos nomes de arquivo.",
+ "We strongly suggest installing the required packages on your system to support one of the following locales: %s." : "Nós sugerimos a instalação dos pacotes necessários em seu sistema para suportar um dos seguintes locais: %s.",
"URL generation in notification emails" : "Geração de URL em e-mails de notificação",
"If your installation is not installed in the root of the domain and uses system cron, there can be issues with the URL generation. To avoid these problems, please set the \"overwritewebroot\" option in your config.php file to the webroot path of your installation (Suggested: \"%s\")" : "Se a sua instalação não estiver instalada na raiz do domínio e usa cron do sistema, pode haver problemas com a geração de URL. Para evitar esses problemas, por favor, defina a opção \"overwritewebroot\" em seu arquivo config.php para o caminho webroot de sua instalação (Sugestão: \"%s\")",
"Connectivity Checks" : "Verificações de Conectividade",
diff --git a/settings/l10n/pt_BR.json b/settings/l10n/pt_BR.json
index 440cb24b158..3746bb162dc 100644
--- a/settings/l10n/pt_BR.json
+++ b/settings/l10n/pt_BR.json
@@ -115,6 +115,7 @@
"Locale not working" : "Localização não funcionando",
"System locale can not be set to a one which supports UTF-8." : "Localidade do sistema não pode ser definido como um que suporta UTF-8.",
"This means that there might be problems with certain characters in file names." : "Isso significa que pode haver problemas com certos caracteres nos nomes de arquivo.",
+ "We strongly suggest installing the required packages on your system to support one of the following locales: %s." : "Nós sugerimos a instalação dos pacotes necessários em seu sistema para suportar um dos seguintes locais: %s.",
"URL generation in notification emails" : "Geração de URL em e-mails de notificação",
"If your installation is not installed in the root of the domain and uses system cron, there can be issues with the URL generation. To avoid these problems, please set the \"overwritewebroot\" option in your config.php file to the webroot path of your installation (Suggested: \"%s\")" : "Se a sua instalação não estiver instalada na raiz do domínio e usa cron do sistema, pode haver problemas com a geração de URL. Para evitar esses problemas, por favor, defina a opção \"overwritewebroot\" em seu arquivo config.php para o caminho webroot de sua instalação (Sugestão: \"%s\")",
"Connectivity Checks" : "Verificações de Conectividade",
diff --git a/settings/l10n/ru.js b/settings/l10n/ru.js
index 0ea525bf955..1ad8c854126 100644
--- a/settings/l10n/ru.js
+++ b/settings/l10n/ru.js
@@ -117,6 +117,7 @@ OC.L10N.register(
"Locale not working" : "Локализация не работает",
"System locale can not be set to a one which supports UTF-8." : "Невозможно установить системную локаль, поддерживающую UTF-8",
"This means that there might be problems with certain characters in file names." : "Это значит, что могут быть проблемы с некоторыми символами в именах файлов.",
+ "We strongly suggest installing the required packages on your system to support one of the following locales: %s." : "Мы рекомендуем установить требуемые пакеты для вашей системы для поддержки одного из следующих языков: %s.",
"URL generation in notification emails" : "Генерирование URL в уведомляющих электронных письмах",
"If your installation is not installed in the root of the domain and uses system cron, there can be issues with the URL generation. To avoid these problems, please set the \"overwritewebroot\" option in your config.php file to the webroot path of your installation (Suggested: \"%s\")" : "Если ваша копия ownCloud установлена не в корне домена и использует планировщик cron системы, возможны проблемы с правильной генерацией URL. Чтобы избежать этого, установите опцию verwritewebroot файла config.php равной пути папки установки. (Вероятно, это \"%s\".)",
"Connectivity Checks" : "Проверка соединения",
@@ -221,6 +222,7 @@ OC.L10N.register(
"Create" : "Создать",
"Admin Recovery Password" : "Восстановление пароля администратора",
"Enter the recovery password in order to recover the users files during password change" : "Введите пароль для того, чтобы восстановить файлы пользователей при смене пароля",
+ "Search Users" : "Искать пользователей",
"Add Group" : "Добавить группу",
"Group" : "Группа",
"Everyone" : "Все",
diff --git a/settings/l10n/ru.json b/settings/l10n/ru.json
index 0c9ae6e5b27..c1703281413 100644
--- a/settings/l10n/ru.json
+++ b/settings/l10n/ru.json
@@ -115,6 +115,7 @@
"Locale not working" : "Локализация не работает",
"System locale can not be set to a one which supports UTF-8." : "Невозможно установить системную локаль, поддерживающую UTF-8",
"This means that there might be problems with certain characters in file names." : "Это значит, что могут быть проблемы с некоторыми символами в именах файлов.",
+ "We strongly suggest installing the required packages on your system to support one of the following locales: %s." : "Мы рекомендуем установить требуемые пакеты для вашей системы для поддержки одного из следующих языков: %s.",
"URL generation in notification emails" : "Генерирование URL в уведомляющих электронных письмах",
"If your installation is not installed in the root of the domain and uses system cron, there can be issues with the URL generation. To avoid these problems, please set the \"overwritewebroot\" option in your config.php file to the webroot path of your installation (Suggested: \"%s\")" : "Если ваша копия ownCloud установлена не в корне домена и использует планировщик cron системы, возможны проблемы с правильной генерацией URL. Чтобы избежать этого, установите опцию verwritewebroot файла config.php равной пути папки установки. (Вероятно, это \"%s\".)",
"Connectivity Checks" : "Проверка соединения",
@@ -219,6 +220,7 @@
"Create" : "Создать",
"Admin Recovery Password" : "Восстановление пароля администратора",
"Enter the recovery password in order to recover the users files during password change" : "Введите пароль для того, чтобы восстановить файлы пользователей при смене пароля",
+ "Search Users" : "Искать пользователей",
"Add Group" : "Добавить группу",
"Group" : "Группа",
"Everyone" : "Все",
diff --git a/settings/l10n/sl.js b/settings/l10n/sl.js
index 74f41f79bc3..4e1ebd512ed 100644
--- a/settings/l10n/sl.js
+++ b/settings/l10n/sl.js
@@ -113,6 +113,7 @@ OC.L10N.register(
"Locale not working" : "Jezikovne prilagoditve ne delujejo.",
"System locale can not be set to a one which supports UTF-8." : "Sistemskih jezikovnih nastavitev ni mogoče nastaviti na možnost, ki podpira nabor UTF-8.",
"This means that there might be problems with certain characters in file names." : "To pomeni, da se lahko pojavijo napake pri nekaterih znakih v imenih datotek.",
+ "URL generation in notification emails" : "Ustvarjanje naslova URL v elektronskih sporočilih",
"Connectivity Checks" : "Preverjanje povezav",
"No problems found" : "Ni zaznanih težav",
"Please double check the <a href='%s'>installation guides</a>." : "Preverite <a href='%s'>navodila namestitve</a>.",
@@ -211,6 +212,7 @@ OC.L10N.register(
"Create" : "Ustvari",
"Admin Recovery Password" : "Obnovitev skrbniškega gesla",
"Enter the recovery password in order to recover the users files during password change" : "Vnesite geslo, ki omogoča obnovitev uporabniških datotek med spreminjanjem gesla",
+ "Search Users" : "Poišči med uporabniki",
"Add Group" : "Dodaj skupino",
"Group" : "Skupina",
"Everyone" : "Vsi",
diff --git a/settings/l10n/sl.json b/settings/l10n/sl.json
index 0a539fcde4f..417ef5f6a1f 100644
--- a/settings/l10n/sl.json
+++ b/settings/l10n/sl.json
@@ -111,6 +111,7 @@
"Locale not working" : "Jezikovne prilagoditve ne delujejo.",
"System locale can not be set to a one which supports UTF-8." : "Sistemskih jezikovnih nastavitev ni mogoče nastaviti na možnost, ki podpira nabor UTF-8.",
"This means that there might be problems with certain characters in file names." : "To pomeni, da se lahko pojavijo napake pri nekaterih znakih v imenih datotek.",
+ "URL generation in notification emails" : "Ustvarjanje naslova URL v elektronskih sporočilih",
"Connectivity Checks" : "Preverjanje povezav",
"No problems found" : "Ni zaznanih težav",
"Please double check the <a href='%s'>installation guides</a>." : "Preverite <a href='%s'>navodila namestitve</a>.",
@@ -209,6 +210,7 @@
"Create" : "Ustvari",
"Admin Recovery Password" : "Obnovitev skrbniškega gesla",
"Enter the recovery password in order to recover the users files during password change" : "Vnesite geslo, ki omogoča obnovitev uporabniških datotek med spreminjanjem gesla",
+ "Search Users" : "Poišči med uporabniki",
"Add Group" : "Dodaj skupino",
"Group" : "Skupina",
"Everyone" : "Vsi",
diff --git a/settings/l10n/sq.js b/settings/l10n/sq.js
index ec4d9667170..fbb926feeb7 100644
--- a/settings/l10n/sq.js
+++ b/settings/l10n/sq.js
@@ -1,17 +1,29 @@
OC.L10N.register(
"settings",
{
+ "Security & Setup Warnings" : "Paralajmërimet e Sigurisë dhe Konfigurimit",
"Cron" : "Cron",
"Sharing" : "Ndarje",
"Security" : "Siguria",
+ "Email Server" : "Serveri Email",
"Log" : "Historik aktiviteti",
"Authentication error" : "Gabim autentifikimi",
+ "Your full name has been changed." : "Emri juaj i plotë ka ndryshuar.",
+ "Unable to change full name" : "Nuk mund të ndryshohet emri i plotë",
"Group already exists" : "Grupi ekziston",
"Unable to add group" : "E pamundur të shtohet grupi",
+ "Files decrypted successfully" : "Skedarët janë dëshifruar me sukses",
+ "Couldn't decrypt your files, please check your owncloud.log or ask your administrator" : "Nuk mund të dëshifrohen skedarët tuaj, ju lutem kontrolloni owncloud.log ose pyesni administratorin tuaj.",
+ "Couldn't decrypt your files, check your password and try again" : "Nuk mund të dëshifrohen skedarët tuaj, ju lutem kontrolloni fjalëkalimin tuaj dhe provoni përsëri.",
+ "Encryption keys deleted permanently" : "Çelësat e shifrimit u fshinë përfundimisht",
+ "Couldn't permanently delete your encryption keys, please check your owncloud.log or ask your administrator" : "Nuk mund të fshihen përfundimisht çelësat tuaj të shifrimit, ju lutem kontrolloni owncloud.log ose pyesni administratorin tuaj.",
+ "Couldn't remove app." : "Nuk mund të hiqet aplikacioni.",
"Email saved" : "Email u ruajt",
"Invalid email" : "Email jo i vlefshëm",
"Unable to delete group" : "E pamundur të fshihet grupi",
"Unable to delete user" : "E pamundur të fshihet përdoruesi",
+ "Backups restored successfully" : "Kopjet rezervë u restauruan me sukses",
+ "Couldn't restore your encryption keys, please check your owncloud.log or ask your administrator" : "Nuk mund të restaurohen çelësat tuaj të shifrimit, ju lutem kontrolloni owncloud.log ose pyesni administratorin tuaj.",
"Language changed" : "Gjuha u ndryshua",
"Invalid request" : "Kërkesë e pavlefshme",
"Admins can't remove themself from the admin group" : "Administratorët nuk mund të heqin vehten prej grupit admin",
@@ -19,8 +31,16 @@ OC.L10N.register(
"Unable to remove user from group %s" : "E pamundur të hiqet përdoruesi nga grupi %s",
"Couldn't update app." : "E pamundur të përditësohet app.",
"Wrong password" : "Fjalëkalim i gabuar",
+ "No user supplied" : "Nuk është dhënë asnjë përdorues",
+ "Please provide an admin recovery password, otherwise all user data will be lost" : "Ju lutem jepni një fjalëkalim restaurimi administrativ, në të kundërt të gjitha të dhënat do humbasin",
+ "Wrong admin recovery password. Please check the password and try again." : "Fjalëkalim i gabuar restaurimi administrativ. Ju lutem kontrolloni fjalëkalimin dhe provoni përsëri.",
+ "Back-end doesn't support password change, but the users encryption key was successfully updated." : "Paneli i kontrollit nuk mbështet ndryshimin e fjalëkalimit, por çelësi i shifrimit të përdoruesit u modifikua me sukses.",
"Unable to change password" : "Fjalëkalimi nuk mund të ndryshohet",
+ "Enabled" : "Aktivizuar",
+ "Not enabled" : "Jo aktive",
+ "Recommended" : "E rekomanduar",
"Saved" : "U ruajt",
+ "test email settings" : "parametra test për email",
"Email sent" : "Email-i u dërgua",
"Sending..." : "Duke dërguar",
"All" : "Të gjitha",
@@ -31,6 +51,11 @@ OC.L10N.register(
"Error while updating app" : "Gabim gjatë përditësimit të app",
"Updated" : "I përditësuar",
"Select a profile picture" : "Zgjidh një foto profili",
+ "Very weak password" : "Fjalëkalim shumë i dobët",
+ "Weak password" : "Fjalëkalim i dobët",
+ "So-so password" : "Fjalëkalim i pranueshëm",
+ "Good password" : "Fjalëkalim i mirë",
+ "Strong password" : "Fjalëkalim shumë i mirë",
"Delete" : "Fshi",
"Groups" : "Grupet",
"deleted {groupName}" : "u fshi {groupName}",
diff --git a/settings/l10n/sq.json b/settings/l10n/sq.json
index 4c8a590d48c..2fa9c2f6d17 100644
--- a/settings/l10n/sq.json
+++ b/settings/l10n/sq.json
@@ -1,15 +1,27 @@
{ "translations": {
+ "Security & Setup Warnings" : "Paralajmërimet e Sigurisë dhe Konfigurimit",
"Cron" : "Cron",
"Sharing" : "Ndarje",
"Security" : "Siguria",
+ "Email Server" : "Serveri Email",
"Log" : "Historik aktiviteti",
"Authentication error" : "Gabim autentifikimi",
+ "Your full name has been changed." : "Emri juaj i plotë ka ndryshuar.",
+ "Unable to change full name" : "Nuk mund të ndryshohet emri i plotë",
"Group already exists" : "Grupi ekziston",
"Unable to add group" : "E pamundur të shtohet grupi",
+ "Files decrypted successfully" : "Skedarët janë dëshifruar me sukses",
+ "Couldn't decrypt your files, please check your owncloud.log or ask your administrator" : "Nuk mund të dëshifrohen skedarët tuaj, ju lutem kontrolloni owncloud.log ose pyesni administratorin tuaj.",
+ "Couldn't decrypt your files, check your password and try again" : "Nuk mund të dëshifrohen skedarët tuaj, ju lutem kontrolloni fjalëkalimin tuaj dhe provoni përsëri.",
+ "Encryption keys deleted permanently" : "Çelësat e shifrimit u fshinë përfundimisht",
+ "Couldn't permanently delete your encryption keys, please check your owncloud.log or ask your administrator" : "Nuk mund të fshihen përfundimisht çelësat tuaj të shifrimit, ju lutem kontrolloni owncloud.log ose pyesni administratorin tuaj.",
+ "Couldn't remove app." : "Nuk mund të hiqet aplikacioni.",
"Email saved" : "Email u ruajt",
"Invalid email" : "Email jo i vlefshëm",
"Unable to delete group" : "E pamundur të fshihet grupi",
"Unable to delete user" : "E pamundur të fshihet përdoruesi",
+ "Backups restored successfully" : "Kopjet rezervë u restauruan me sukses",
+ "Couldn't restore your encryption keys, please check your owncloud.log or ask your administrator" : "Nuk mund të restaurohen çelësat tuaj të shifrimit, ju lutem kontrolloni owncloud.log ose pyesni administratorin tuaj.",
"Language changed" : "Gjuha u ndryshua",
"Invalid request" : "Kërkesë e pavlefshme",
"Admins can't remove themself from the admin group" : "Administratorët nuk mund të heqin vehten prej grupit admin",
@@ -17,8 +29,16 @@
"Unable to remove user from group %s" : "E pamundur të hiqet përdoruesi nga grupi %s",
"Couldn't update app." : "E pamundur të përditësohet app.",
"Wrong password" : "Fjalëkalim i gabuar",
+ "No user supplied" : "Nuk është dhënë asnjë përdorues",
+ "Please provide an admin recovery password, otherwise all user data will be lost" : "Ju lutem jepni një fjalëkalim restaurimi administrativ, në të kundërt të gjitha të dhënat do humbasin",
+ "Wrong admin recovery password. Please check the password and try again." : "Fjalëkalim i gabuar restaurimi administrativ. Ju lutem kontrolloni fjalëkalimin dhe provoni përsëri.",
+ "Back-end doesn't support password change, but the users encryption key was successfully updated." : "Paneli i kontrollit nuk mbështet ndryshimin e fjalëkalimit, por çelësi i shifrimit të përdoruesit u modifikua me sukses.",
"Unable to change password" : "Fjalëkalimi nuk mund të ndryshohet",
+ "Enabled" : "Aktivizuar",
+ "Not enabled" : "Jo aktive",
+ "Recommended" : "E rekomanduar",
"Saved" : "U ruajt",
+ "test email settings" : "parametra test për email",
"Email sent" : "Email-i u dërgua",
"Sending..." : "Duke dërguar",
"All" : "Të gjitha",
@@ -29,6 +49,11 @@
"Error while updating app" : "Gabim gjatë përditësimit të app",
"Updated" : "I përditësuar",
"Select a profile picture" : "Zgjidh një foto profili",
+ "Very weak password" : "Fjalëkalim shumë i dobët",
+ "Weak password" : "Fjalëkalim i dobët",
+ "So-so password" : "Fjalëkalim i pranueshëm",
+ "Good password" : "Fjalëkalim i mirë",
+ "Strong password" : "Fjalëkalim shumë i mirë",
"Delete" : "Fshi",
"Groups" : "Grupet",
"deleted {groupName}" : "u fshi {groupName}",
diff --git a/settings/l10n/tr.js b/settings/l10n/tr.js
index 273874bdfe3..e97674bf0fc 100644
--- a/settings/l10n/tr.js
+++ b/settings/l10n/tr.js
@@ -117,6 +117,7 @@ OC.L10N.register(
"Locale not working" : "Yerel çalışmıyor",
"System locale can not be set to a one which supports UTF-8." : "Sistem yereli, UTF-8 destekleyenlerden biri olarak ayarlanamadı.",
"This means that there might be problems with certain characters in file names." : "Bu, dosya adlarında belirli karakterlerde problem olabileceği anlamına gelir.",
+ "We strongly suggest installing the required packages on your system to support one of the following locales: %s." : "Şu dillerden birini desteklemesi için sisteminize gerekli paketleri kurmanızı şiddetle tavsiye ederiz: %s.",
"URL generation in notification emails" : "Bildirim e-postalarında URL oluşturulması",
"If your installation is not installed in the root of the domain and uses system cron, there can be issues with the URL generation. To avoid these problems, please set the \"overwritewebroot\" option in your config.php file to the webroot path of your installation (Suggested: \"%s\")" : "Eğer kurulumunuz alan adının köküne yapılmamışsa ve sistem cron'u kullanıyorsa, URL oluşturma ile ilgili sorunlar olabilir. Bu sorunların önüne geçmek için, kurulumunuzun web kök yolundaki config.php dosyasında \"overwritewebroot\" seçeneğini ayarlayın (Önerilen: \"%s\")",
"Connectivity Checks" : "Bağlantı Kontrolleri",
@@ -137,7 +138,7 @@ OC.L10N.register(
"days" : "gün sonra dolsun",
"Enforce expiration date" : "Son kullanma tarihini zorla",
"Allow resharing" : "Yeniden paylaşıma izin ver",
- "Restrict users to only share with users in their groups" : "Kullanıcıların sadece kendi gruplarındaki kullanıcılarla paylaşmasına sınırla",
+ "Restrict users to only share with users in their groups" : "Kullanıcıların, dosyaları sadece kendi gruplarındaki kullanıcılarla paylaşmasına izin ver",
"Allow users to send mail notification for shared files" : "Paylaşılmış dosyalar için kullanıcıların posta bildirimi göndermesine izin ver",
"Exclude groups from sharing" : "Grupları paylaşma eyleminden hariç tut",
"These groups will still be able to receive shares, but not to initiate them." : "Bu gruplar hala paylaşımları alabilecek, ancak başlatamayacaktır.",
diff --git a/settings/l10n/tr.json b/settings/l10n/tr.json
index 9aec853988f..f1c869101a9 100644
--- a/settings/l10n/tr.json
+++ b/settings/l10n/tr.json
@@ -115,6 +115,7 @@
"Locale not working" : "Yerel çalışmıyor",
"System locale can not be set to a one which supports UTF-8." : "Sistem yereli, UTF-8 destekleyenlerden biri olarak ayarlanamadı.",
"This means that there might be problems with certain characters in file names." : "Bu, dosya adlarında belirli karakterlerde problem olabileceği anlamına gelir.",
+ "We strongly suggest installing the required packages on your system to support one of the following locales: %s." : "Şu dillerden birini desteklemesi için sisteminize gerekli paketleri kurmanızı şiddetle tavsiye ederiz: %s.",
"URL generation in notification emails" : "Bildirim e-postalarında URL oluşturulması",
"If your installation is not installed in the root of the domain and uses system cron, there can be issues with the URL generation. To avoid these problems, please set the \"overwritewebroot\" option in your config.php file to the webroot path of your installation (Suggested: \"%s\")" : "Eğer kurulumunuz alan adının köküne yapılmamışsa ve sistem cron'u kullanıyorsa, URL oluşturma ile ilgili sorunlar olabilir. Bu sorunların önüne geçmek için, kurulumunuzun web kök yolundaki config.php dosyasında \"overwritewebroot\" seçeneğini ayarlayın (Önerilen: \"%s\")",
"Connectivity Checks" : "Bağlantı Kontrolleri",
@@ -135,7 +136,7 @@
"days" : "gün sonra dolsun",
"Enforce expiration date" : "Son kullanma tarihini zorla",
"Allow resharing" : "Yeniden paylaşıma izin ver",
- "Restrict users to only share with users in their groups" : "Kullanıcıların sadece kendi gruplarındaki kullanıcılarla paylaşmasına sınırla",
+ "Restrict users to only share with users in their groups" : "Kullanıcıların, dosyaları sadece kendi gruplarındaki kullanıcılarla paylaşmasına izin ver",
"Allow users to send mail notification for shared files" : "Paylaşılmış dosyalar için kullanıcıların posta bildirimi göndermesine izin ver",
"Exclude groups from sharing" : "Grupları paylaşma eyleminden hariç tut",
"These groups will still be able to receive shares, but not to initiate them." : "Bu gruplar hala paylaşımları alabilecek, ancak başlatamayacaktır.",
diff --git a/tests/data/app/expected-info.json b/tests/data/app/expected-info.json
new file mode 100644
index 00000000000..c67d6d657d2
--- /dev/null
+++ b/tests/data/app/expected-info.json
@@ -0,0 +1,19 @@
+{
+ "info": [],
+ "remote": [],
+ "public": [],
+ "id": "files_encryption",
+ "name": "Server-side Encryption",
+ "description": "\n\tThis application encrypts all files accessed by ownCloud at rest, wherever they are stored. As an example, with this application enabled, external cloud based Amazon S3 storage will be encrypted, protecting this data on storage outside of the control of the Admin. When this application is enabled for the first time, all files are encrypted as users log in and are prompted for their password. The recommended recovery key option enables recovery of files in case the key is lost. \n\tNote that this app encrypts all files that are touched by ownCloud, so external storage providers and applications such as SharePoint will see new files encrypted when they are accessed. Encryption is based on AES 128 or 256 bit keys. More information is available in the Encryption documentation \n\t",
+ "licence": "AGPL",
+ "author": "Sam Tuke, Bjoern Schiessle, Florin Peter",
+ "requiremin": "4",
+ "shipped": "true",
+ "documentation": {
+ "user": "https://docs.example.com/server/go.php?to=user-encryption",
+ "admin": "https://docs.example.com/server/go.php?to=admin-encryption"
+ },
+ "rememberlogin": "false",
+ "types": ["filesystem"],
+ "ocsid": "166047"
+}
diff --git a/tests/data/app/invalid-info.xml b/tests/data/app/invalid-info.xml
new file mode 100644
index 00000000000..3947f5420c2
--- /dev/null
+++ b/tests/data/app/invalid-info.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<info
+ <id>files_encryption</id>
+ <name>Server-side Encryption</name>
+ <description>
+ This application encrypts all files accessed by ownCloud at rest, wherever they are stored. As an example, with this application enabled, external cloud based Amazon S3 storage will be encrypted, protecting this data on storage outside of the control of the Admin. When this application is enabled for the first time, all files are encrypted as users log in and are prompted for their password. The recommended recovery key option enables recovery of files in case the key is lost.
+ Note that this app encrypts all files that are touched by ownCloud, so external storage providers and applications such as SharePoint will see new files encrypted when they are accessed. Encryption is based on AES 128 or 256 bit keys. More information is available in the Encryption documentation
+ </description>
+ <licence>AGPL</licence>
+ <author>Sam Tuke, Bjoern Schiessle, Florin Peter</author>
+ <requiremin>4</requiremin>
+ <shipped>true</shipped>
+ <documentation>
+ <user>user-encryption</user>
+ <admin>admin-encryption</admin>
+ </documentation>
+ <rememberlogin>false</rememberlogin>
+ <types>
+ <filesystem/>
+ </types>
+ <ocsid>166047</ocsid>
+</info>
diff --git a/tests/data/app/valid-info.xml b/tests/data/app/valid-info.xml
new file mode 100644
index 00000000000..6fcef693bed
--- /dev/null
+++ b/tests/data/app/valid-info.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<info>
+ <id>files_encryption</id>
+ <name>Server-side Encryption</name>
+ <description>
+ This application encrypts all files accessed by ownCloud at rest, wherever they are stored. As an example, with this application enabled, external cloud based Amazon S3 storage will be encrypted, protecting this data on storage outside of the control of the Admin. When this application is enabled for the first time, all files are encrypted as users log in and are prompted for their password. The recommended recovery key option enables recovery of files in case the key is lost.
+ Note that this app encrypts all files that are touched by ownCloud, so external storage providers and applications such as SharePoint will see new files encrypted when they are accessed. Encryption is based on AES 128 or 256 bit keys. More information is available in the Encryption documentation
+ </description>
+ <licence>AGPL</licence>
+ <author>Sam Tuke, Bjoern Schiessle, Florin Peter</author>
+ <requiremin>4</requiremin>
+ <shipped>true</shipped>
+ <documentation>
+ <user>user-encryption</user>
+ <admin>admin-encryption</admin>
+ </documentation>
+ <rememberlogin>false</rememberlogin>
+ <types>
+ <filesystem/>
+ </types>
+ <ocsid>166047</ocsid>
+</info>
diff --git a/tests/lib/app/infoparser.php b/tests/lib/app/infoparser.php
new file mode 100644
index 00000000000..277e1582e45
--- /dev/null
+++ b/tests/lib/app/infoparser.php
@@ -0,0 +1,53 @@
+<?php
+
+/**
+ * @author Thomas Müller
+ * @copyright 2014 Thomas Müller deepdiver@owncloud.com
+ * later.
+ * See the COPYING-README file.
+ */
+
+namespace Test\App;
+
+use OC;
+
+class InfoParser extends \PHPUnit_Framework_TestCase {
+
+ /**
+ * @var \OC\App\InfoParser
+ */
+ private $parser;
+
+ public function setUp() {
+ $config = $this->getMockBuilder('\OC\AllConfig')
+ ->disableOriginalConstructor()->getMock();
+ $httpHelper = $this->getMockBuilder('\OC\HTTPHelper')
+ ->setConstructorArgs(array($config))
+ ->setMethods(array('getHeaders'))
+ ->getMock();
+ $urlGenerator = $this->getMockBuilder('\OCP\IURLGenerator')
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ //linkToDocs
+ $urlGenerator->expects($this->any())
+ ->method('linkToDocs')
+ ->will($this->returnCallback(function ($url) {
+ return "https://docs.example.com/server/go.php?to=$url";
+ }));
+
+ $this->parser = new \OC\App\InfoParser($httpHelper, $urlGenerator);
+ }
+
+ public function testParsingValidXml() {
+ $expectedData = json_decode(file_get_contents(OC::$SERVERROOT.'/tests/data/app/expected-info.json'), true);
+ $data = $this->parser->parse(OC::$SERVERROOT.'/tests/data/app/valid-info.xml');
+
+ $this->assertEquals($expectedData, $data);
+ }
+
+ public function testParsingInvalidXml() {
+ $data = $this->parser->parse(OC::$SERVERROOT.'/tests/data/app/invalid-info.xml');
+ $this->assertNull($data);
+ }
+}
diff --git a/tests/lib/appframework/routing/RoutingTest.php b/tests/lib/appframework/routing/RoutingTest.php
index 276307680af..4ee3ed58807 100644
--- a/tests/lib/appframework/routing/RoutingTest.php
+++ b/tests/lib/appframework/routing/RoutingTest.php
@@ -54,6 +54,15 @@ class RoutingTest extends \Test\TestCase
$this->assertSimpleRoute($routes, 'folders.open', 'DELETE', '/folders/{folderId}/open', 'FoldersController', 'open', array(), array('param' => 'foobar'));
}
+ public function testSimpleRouteWithPostfix()
+ {
+ $routes = array('routes' => array(
+ array('name' => 'folders#open', 'url' => '/folders/{folderId}/open', 'verb' => 'delete', 'postfix' => '_something')
+ ));
+
+ $this->assertSimpleRoute($routes, 'folders.open', 'DELETE', '/folders/{folderId}/open', 'FoldersController', 'open', array(), array(), '_something');
+ }
+
/**
* @expectedException \UnexpectedValueException
@@ -104,8 +113,12 @@ class RoutingTest extends \Test\TestCase
* @param string $controllerName
* @param string $actionName
*/
- private function assertSimpleRoute($routes, $name, $verb, $url, $controllerName, $actionName, array $requirements=array(), array $defaults=array())
+ private function assertSimpleRoute($routes, $name, $verb, $url, $controllerName, $actionName, array $requirements=array(), array $defaults=array(), $postfix='')
{
+ if ($postfix) {
+ $name .= $postfix;
+ }
+
// route mocks
$route = $this->mockRoute($verb, $controllerName, $actionName, $requirements, $defaults);
diff --git a/tests/lib/connector/sabre/file.php b/tests/lib/connector/sabre/file.php
index cfc6e29ae74..b4fdd91f512 100644
--- a/tests/lib/connector/sabre/file.php
+++ b/tests/lib/connector/sabre/file.php
@@ -23,7 +23,7 @@ class Test_OC_Connector_Sabre_File extends \Test\TestCase {
->will($this->returnValue('/test.txt'));
$info = new \OC\Files\FileInfo('/test.txt', null, null, array(
- 'permissions'=>\OCP\PERMISSION_ALL
+ 'permissions'=>\OCP\Constants::PERMISSION_ALL
));
$file = new OC_Connector_Sabre_File($view, $info);
@@ -58,7 +58,7 @@ class Test_OC_Connector_Sabre_File extends \Test\TestCase {
$_SERVER['REQUEST_METHOD'] = 'PUT';
$info = new \OC\Files\FileInfo('/test.txt', null, null, array(
- 'permissions' => \OCP\PERMISSION_ALL
+ 'permissions' => \OCP\Constants::PERMISSION_ALL
));
$file = new OC_Connector_Sabre_File($view, $info);
@@ -82,7 +82,7 @@ class Test_OC_Connector_Sabre_File extends \Test\TestCase {
->will($this->returnValue('/super*star.txt'));
$info = new \OC\Files\FileInfo('/super*star.txt', null, null, array(
- 'permissions' => \OCP\PERMISSION_ALL
+ 'permissions' => \OCP\Constants::PERMISSION_ALL
));
$file = new OC_Connector_Sabre_File($view, $info);
@@ -103,7 +103,7 @@ class Test_OC_Connector_Sabre_File extends \Test\TestCase {
->will($this->returnValue('/super*star.txt'));
$info = new \OC\Files\FileInfo('/super*star.txt', null, null, array(
- 'permissions' => \OCP\PERMISSION_ALL
+ 'permissions' => \OCP\Constants::PERMISSION_ALL
));
$file = new OC_Connector_Sabre_File($view, $info);
$file->setName('/super*star.txt');
@@ -135,7 +135,7 @@ class Test_OC_Connector_Sabre_File extends \Test\TestCase {
$_SERVER['REQUEST_METHOD'] = 'PUT';
$info = new \OC\Files\FileInfo('/test.txt', null, null, array(
- 'permissions' => \OCP\PERMISSION_ALL
+ 'permissions' => \OCP\Constants::PERMISSION_ALL
));
$file = new OC_Connector_Sabre_File($view, $info);
@@ -157,7 +157,7 @@ class Test_OC_Connector_Sabre_File extends \Test\TestCase {
->will($this->returnValue(true));
$info = new \OC\Files\FileInfo('/test.txt', null, null, array(
- 'permissions' => \OCP\PERMISSION_ALL
+ 'permissions' => \OCP\Constants::PERMISSION_ALL
));
$file = new OC_Connector_Sabre_File($view, $info);
@@ -198,7 +198,7 @@ class Test_OC_Connector_Sabre_File extends \Test\TestCase {
->will($this->returnValue(false));
$info = new \OC\Files\FileInfo('/test.txt', null, null, array(
- 'permissions' => \OCP\PERMISSION_ALL
+ 'permissions' => \OCP\Constants::PERMISSION_ALL
));
$file = new OC_Connector_Sabre_File($view, $info);
diff --git a/tests/lib/connector/sabre/node.php b/tests/lib/connector/sabre/node.php
index 9a2bf41bd19..1e927deed44 100644
--- a/tests/lib/connector/sabre/node.php
+++ b/tests/lib/connector/sabre/node.php
@@ -15,15 +15,15 @@ use OC\Files\View;
class Node extends \Test\TestCase {
public function davPermissionsProvider() {
return array(
- array(\OCP\PERMISSION_ALL, 'file', false, false, 'RDNVW'),
- array(\OCP\PERMISSION_ALL, 'dir', false, false, 'RDNVCK'),
- array(\OCP\PERMISSION_ALL, 'file', true, false, 'SRDNVW'),
- array(\OCP\PERMISSION_ALL, 'file', true, true, 'SRMDNVW'),
- array(\OCP\PERMISSION_ALL - \OCP\PERMISSION_SHARE, 'file', true, false, 'SDNVW'),
- array(\OCP\PERMISSION_ALL - \OCP\PERMISSION_UPDATE, 'file', false, false, 'RDNV'),
- array(\OCP\PERMISSION_ALL - \OCP\PERMISSION_DELETE, 'file', false, false, 'RW'),
- array(\OCP\PERMISSION_ALL - \OCP\PERMISSION_CREATE, 'file', false, false, 'RDNVW'),
- array(\OCP\PERMISSION_ALL - \OCP\PERMISSION_CREATE, 'dir', false, false, 'RDNV'),
+ array(\OCP\Constants::PERMISSION_ALL, 'file', false, false, 'RDNVW'),
+ array(\OCP\Constants::PERMISSION_ALL, 'dir', false, false, 'RDNVCK'),
+ array(\OCP\Constants::PERMISSION_ALL, 'file', true, false, 'SRDNVW'),
+ array(\OCP\Constants::PERMISSION_ALL, 'file', true, true, 'SRMDNVW'),
+ array(\OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_SHARE, 'file', true, false, 'SDNVW'),
+ array(\OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_UPDATE, 'file', false, false, 'RDNV'),
+ array(\OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_DELETE, 'file', false, false, 'RW'),
+ array(\OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_CREATE, 'file', false, false, 'RDNVW'),
+ array(\OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_CREATE, 'dir', false, false, 'RDNV'),
);
}
diff --git a/tests/lib/db/mdb2schemareader.php b/tests/lib/db/mdb2schemareader.php
index b2ff55e1632..7939c782e80 100644
--- a/tests/lib/db/mdb2schemareader.php
+++ b/tests/lib/db/mdb2schemareader.php
@@ -21,11 +21,11 @@ class MDB2SchemaReader extends \Test\TestCase {
* @return \OC\Config
*/
protected function getConfig() {
- $config = $this->getMockBuilder('\OC\Config')
+ $config = $this->getMockBuilder('\OCP\IConfig')
->disableOriginalConstructor()
->getMock();
$config->expects($this->any())
- ->method('getValue')
+ ->method('getSystemValue')
->will($this->returnValueMap(array(
array('dbname', 'owncloud', 'testDB'),
array('dbtableprefix', 'oc_', 'test_')
diff --git a/tests/lib/files/node/file.php b/tests/lib/files/node/file.php
index 34ec7dee213..1ae312ab5a8 100644
--- a/tests/lib/files/node/file.php
+++ b/tests/lib/files/node/file.php
@@ -39,7 +39,7 @@ class File extends \Test\TestCase {
$view->expects($this->once())
->method('getFileInfo')
->with('/bar/foo')
- ->will($this->returnValue(array('permissions' => \OCP\PERMISSION_ALL)));
+ ->will($this->returnValue(array('permissions' => \OCP\Constants::PERMISSION_ALL)));
$view->expects($this->once())
->method('unlink')
@@ -89,7 +89,7 @@ class File extends \Test\TestCase {
$view->expects($this->any())
->method('getFileInfo')
->with('/bar/foo')
- ->will($this->returnValue(array('permissions' => \OCP\PERMISSION_ALL, 'fileid' => 1)));
+ ->will($this->returnValue(array('permissions' => \OCP\Constants::PERMISSION_ALL, 'fileid' => 1)));
$view->expects($this->once())
->method('unlink')
@@ -124,7 +124,7 @@ class File extends \Test\TestCase {
$view->expects($this->once())
->method('getFileInfo')
->with('/bar/foo')
- ->will($this->returnValue(array('permissions' => \OCP\PERMISSION_READ)));
+ ->will($this->returnValue(array('permissions' => \OCP\Constants::PERMISSION_READ)));
$node = new \OC\Files\Node\File($root, $view, '/bar/foo');
$node->delete();
@@ -156,7 +156,7 @@ class File extends \Test\TestCase {
$view->expects($this->once())
->method('getFileInfo')
->with('/bar/foo')
- ->will($this->returnValue(array('permissions' => \OCP\PERMISSION_READ)));
+ ->will($this->returnValue(array('permissions' => \OCP\Constants::PERMISSION_READ)));
$node = new \OC\Files\Node\File($root, $view, '/bar/foo');
$this->assertEquals('bar', $node->getContent());
@@ -201,7 +201,7 @@ class File extends \Test\TestCase {
$view->expects($this->once())
->method('getFileInfo')
->with('/bar/foo')
- ->will($this->returnValue(array('permissions' => \OCP\PERMISSION_ALL)));
+ ->will($this->returnValue(array('permissions' => \OCP\Constants::PERMISSION_ALL)));
$view->expects($this->once())
->method('file_put_contents')
@@ -226,7 +226,7 @@ class File extends \Test\TestCase {
$view->expects($this->once())
->method('getFileInfo')
->with('/bar/foo')
- ->will($this->returnValue(array('permissions' => \OCP\PERMISSION_READ)));
+ ->will($this->returnValue(array('permissions' => \OCP\Constants::PERMISSION_READ)));
$node = new \OC\Files\Node\File($root, $view, '/bar/foo');
$node->putContent('bar');
@@ -279,7 +279,7 @@ class File extends \Test\TestCase {
$view->expects($this->once())
->method('getFileInfo')
->with('/bar/foo')
- ->will($this->returnValue(array('permissions' => \OCP\PERMISSION_ALL)));
+ ->will($this->returnValue(array('permissions' => \OCP\Constants::PERMISSION_ALL)));
$node = new \OC\Files\Node\File($root, $view, '/bar/foo');
$fh = $node->fopen('r');
@@ -316,7 +316,7 @@ class File extends \Test\TestCase {
$view->expects($this->once())
->method('getFileInfo')
->with('/bar/foo')
- ->will($this->returnValue(array('permissions' => \OCP\PERMISSION_ALL)));
+ ->will($this->returnValue(array('permissions' => \OCP\Constants::PERMISSION_ALL)));
$node = new \OC\Files\Node\File($root, $view, '/bar/foo');
$fh = $node->fopen('w');
@@ -375,7 +375,7 @@ class File extends \Test\TestCase {
$view->expects($this->once())
->method('getFileInfo')
->with('/bar/foo')
- ->will($this->returnValue(array('permissions' => \OCP\PERMISSION_UPDATE)));
+ ->will($this->returnValue(array('permissions' => \OCP\Constants::PERMISSION_UPDATE)));
$node = new \OC\Files\Node\File($root, $view, '/bar/foo');
$node->fopen('w');
@@ -402,7 +402,7 @@ class File extends \Test\TestCase {
$view->expects($this->once())
->method('getFileInfo')
->with('/bar/foo')
- ->will($this->returnValue(array('permissions' => \OCP\PERMISSION_READ)));
+ ->will($this->returnValue(array('permissions' => \OCP\Constants::PERMISSION_READ)));
$node = new \OC\Files\Node\File($root, $view, '/bar/foo');
$node->fopen('w');
@@ -425,7 +425,7 @@ class File extends \Test\TestCase {
$view->expects($this->any())
->method('getFileInfo')
- ->will($this->returnValue(array('permissions' => \OCP\PERMISSION_ALL, 'fileid' => 3)));
+ ->will($this->returnValue(array('permissions' => \OCP\Constants::PERMISSION_ALL, 'fileid' => 3)));
$node = new \OC\Files\Node\File($root, $view, '/bar/foo');
$parentNode = new \OC\Files\Node\Folder($root, $view, '/bar');
@@ -469,7 +469,7 @@ class File extends \Test\TestCase {
$view->expects($this->any())
->method('getFileInfo')
- ->will($this->returnValue(array('permissions' => \OCP\PERMISSION_READ, 'fileid' => 3)));
+ ->will($this->returnValue(array('permissions' => \OCP\Constants::PERMISSION_READ, 'fileid' => 3)));
$node = new \OC\Files\Node\File($root, $view, '/bar/foo');
$parentNode = new \OC\Files\Node\Folder($root, $view, '/bar');
@@ -556,7 +556,7 @@ class File extends \Test\TestCase {
$view->expects($this->any())
->method('getFileInfo')
- ->will($this->returnValue(array('permissions' => \OCP\PERMISSION_ALL, 'fileid' => 1)));
+ ->will($this->returnValue(array('permissions' => \OCP\Constants::PERMISSION_ALL, 'fileid' => 1)));
$node = new \OC\Files\Node\File($root, $view, '/bar/foo');
$parentNode = new \OC\Files\Node\Folder($root, $view, '/bar');
@@ -587,7 +587,7 @@ class File extends \Test\TestCase {
$view->expects($this->any())
->method('getFileInfo')
- ->will($this->returnValue(array('permissions' => \OCP\PERMISSION_READ)));
+ ->will($this->returnValue(array('permissions' => \OCP\Constants::PERMISSION_READ)));
$view->expects($this->never())
->method('rename');
diff --git a/tests/lib/files/node/folder.php b/tests/lib/files/node/folder.php
index e348e452f6f..91aa3b82db2 100644
--- a/tests/lib/files/node/folder.php
+++ b/tests/lib/files/node/folder.php
@@ -39,7 +39,7 @@ class Folder extends \Test\TestCase {
$view->expects($this->any())
->method('getFileInfo')
- ->will($this->returnValue(array('permissions' => \OCP\PERMISSION_ALL)));
+ ->will($this->returnValue(array('permissions' => \OCP\Constants::PERMISSION_ALL)));
$view->expects($this->once())
->method('rmdir')
@@ -87,7 +87,7 @@ class Folder extends \Test\TestCase {
$view->expects($this->any())
->method('getFileInfo')
- ->will($this->returnValue(array('permissions' => \OCP\PERMISSION_ALL, 'fileid' => 1)));
+ ->will($this->returnValue(array('permissions' => \OCP\Constants::PERMISSION_ALL, 'fileid' => 1)));
$view->expects($this->once())
->method('rmdir')
@@ -121,7 +121,7 @@ class Folder extends \Test\TestCase {
$view->expects($this->once())
->method('getFileInfo')
->with('/bar/foo')
- ->will($this->returnValue(array('permissions' => \OCP\PERMISSION_READ)));
+ ->will($this->returnValue(array('permissions' => \OCP\Constants::PERMISSION_READ)));
$node = new \OC\Files\Node\Folder($root, $view, '/bar/foo');
$node->delete();
@@ -255,7 +255,7 @@ class Folder extends \Test\TestCase {
$view->expects($this->once())
->method('getFileInfo')
->with('/bar/foo')
- ->will($this->returnValue(array('permissions' => \OCP\PERMISSION_ALL)));
+ ->will($this->returnValue(array('permissions' => \OCP\Constants::PERMISSION_ALL)));
$view->expects($this->once())
->method('mkdir')
@@ -285,7 +285,7 @@ class Folder extends \Test\TestCase {
$view->expects($this->once())
->method('getFileInfo')
->with('/bar/foo')
- ->will($this->returnValue(array('permissions' => \OCP\PERMISSION_READ)));
+ ->will($this->returnValue(array('permissions' => \OCP\Constants::PERMISSION_READ)));
$node = new \OC\Files\Node\Folder($root, $view, '/bar/foo');
$node->newFolder('asd');
@@ -305,7 +305,7 @@ class Folder extends \Test\TestCase {
$view->expects($this->once())
->method('getFileInfo')
->with('/bar/foo')
- ->will($this->returnValue(array('permissions' => \OCP\PERMISSION_ALL)));
+ ->will($this->returnValue(array('permissions' => \OCP\Constants::PERMISSION_ALL)));
$view->expects($this->once())
->method('touch')
@@ -335,7 +335,7 @@ class Folder extends \Test\TestCase {
$view->expects($this->once())
->method('getFileInfo')
->with('/bar/foo')
- ->will($this->returnValue(array('permissions' => \OCP\PERMISSION_READ)));
+ ->will($this->returnValue(array('permissions' => \OCP\Constants::PERMISSION_READ)));
$node = new \OC\Files\Node\Folder($root, $view, '/bar/foo');
$node->newFile('asd');
diff --git a/tests/lib/files/node/node.php b/tests/lib/files/node/node.php
index 80e3ac6f80a..8820be5b0b2 100644
--- a/tests/lib/files/node/node.php
+++ b/tests/lib/files/node/node.php
@@ -246,7 +246,7 @@ class Node extends \Test\TestCase {
$view->expects($this->once())
->method('getFileInfo')
->with('/bar/foo')
- ->will($this->returnValue(array('permissions' => \OCP\PERMISSION_ALL)));
+ ->will($this->returnValue(array('permissions' => \OCP\Constants::PERMISSION_ALL)));
$node = new \OC\Files\Node\Node($root, $view, '/bar/foo');
$node->touch(100);
@@ -299,7 +299,7 @@ class Node extends \Test\TestCase {
$view->expects($this->any())
->method('getFileInfo')
->with('/bar/foo')
- ->will($this->returnValue(array('permissions' => \OCP\PERMISSION_ALL)));
+ ->will($this->returnValue(array('permissions' => \OCP\Constants::PERMISSION_ALL)));
$node = new \OC\Files\Node\Node($root, $view, '/bar/foo');
$node->touch(100);
@@ -323,7 +323,7 @@ class Node extends \Test\TestCase {
$view->expects($this->any())
->method('getFileInfo')
->with('/bar/foo')
- ->will($this->returnValue(array('permissions' => \OCP\PERMISSION_READ)));
+ ->will($this->returnValue(array('permissions' => \OCP\Constants::PERMISSION_READ)));
$node = new \OC\Files\Node\Node($root, $view, '/bar/foo');
$node->touch(100);
diff --git a/tests/lib/httphelper.php b/tests/lib/httphelper.php
index 34dee35fe02..eb58508f158 100644
--- a/tests/lib/httphelper.php
+++ b/tests/lib/httphelper.php
@@ -24,7 +24,7 @@ class TestHTTPHelper extends \Test\TestCase {
->getMock();
}
- public function testIsHTTPProvider() {
+ public function isHttpTestData() {
return array(
array('http://wwww.owncloud.org/enterprise/', true),
array('https://wwww.owncloud.org/enterprise/', true),
@@ -81,7 +81,7 @@ class TestHTTPHelper extends \Test\TestCase {
}
/**
- * @dataProvider testIsHTTPProvider
+ * @dataProvider isHttpTestData
*/
public function testIsHTTP($url, $expected) {
$this->assertSame($expected, $this->httpHelperMock->isHTTPURL($url));
diff --git a/tests/lib/migrate.php b/tests/lib/migrate.php
deleted file mode 100644
index 9c1e980c445..00000000000
--- a/tests/lib/migrate.php
+++ /dev/null
@@ -1,98 +0,0 @@
-<?php
-/**
- * Copyright (c) 2014 Tom Needham <tom@owncloud.com>
- * This file is licensed under the Affero General Public License version 3 or
- * later.
- * See the COPYING-README file.
- */
-
-class Test_Migrate extends \Test\TestCase {
-
- public $users;
- public $tmpfiles = array();
-
- /** @var \OC\Files\Storage\Storage */
- private $originalStorage;
-
- protected function setUp() {
- parent::setUp();
-
- $this->originalStorage = \OC\Files\Filesystem::getStorage('/');
- }
-
- protected function tearDown() {
- $u = new OC_User();
- foreach($this->users as $user) {
- $u->deleteUser($user);
- }
- foreach($this->tmpfiles as $file) {
- \OC_Helper::rmdirr($file);
- }
-
- \OC\Files\Filesystem::mount($this->originalStorage, array(), '/');
- parent::tearDown();
- }
-
- /**
- * Generates a test user and sets up their file system
- * @return string the test users id
- */
- public function generateUser() {
- $username = $this->getUniqueID();
- \OC_User::createUser($username, 'password');
- \OC_Util::tearDownFS();
- \OC_User::setUserId('');
- \OC\Files\Filesystem::tearDown();
- \OC_Util::setupFS($username);
- $this->users[] = $username;
- return $username;
- }
-
- /**
- * validates an export for a user
- * checks for existence of export_info.json and file folder
- * @param string $exportedUser the user that was exported
- * @param string $path the path to the .zip export
- * @param string $exportedBy
- */
- public function validateUserExport($exportedBy, $exportedUser, $path) {
- $this->assertTrue(file_exists($path));
- // Extract
- $extract = get_temp_dir() . '/oc_import_' . uniqid();
- //mkdir($extract);
- $this->tmpfiles[] = $extract;
- $zip = new ZipArchive;
- $zip->open($path);
- $zip->extractTo($extract);
- $zip->close();
- $this->assertTrue(file_exists($extract.'/export_info.json'));
- $exportInfo = file_get_contents($extract.'/export_info.json');
- $exportInfo = json_decode($exportInfo);
- $this->assertNotNull($exportInfo);
- $this->assertEquals($exportedUser, $exportInfo->exporteduser);
- $this->assertEquals($exportedBy, $exportInfo->exportedby);
- $this->assertTrue(file_exists($extract.'/'.$exportedUser.'/files'));
- }
-
- public function testUserSelfExport() {
- // Create a user
- $user = $this->generateUser();
- \OC_User::setUserId($user);
- $export = \OC_Migrate::export($user);
- // Check it succeeded and exists
- $this->assertTrue(json_decode($export)->success);
- // Validate the export
- $this->validateUserExport($user, $user, json_decode($export)->data);
- }
-
- public function testUserOtherExport() {
- $user = $this->generateUser();
- $user2 = $this->generateUser();
- \OC_User::setUserId($user2);
- $export = \OC_Migrate::export($user);
- // Check it succeeded and exists
- $this->assertTrue(json_decode($export)->success);
- // Validate the export
- $this->validateUserExport($user2, $user, json_decode($export)->data);
- }
-}
diff --git a/tests/lib/share/share.php b/tests/lib/share/share.php
index 7ae458a797d..1f95502919d 100644
--- a/tests/lib/share/share.php
+++ b/tests/lib/share/share.php
@@ -89,7 +89,7 @@ class Test_Share extends \Test\TestCase {
public function testShareInvalidShareType() {
$message = 'Share type foobar is not valid for test.txt';
try {
- OCP\Share::shareItem('test', 'test.txt', 'foobar', $this->user2, OCP\PERMISSION_READ);
+ OCP\Share::shareItem('test', 'test.txt', 'foobar', $this->user2, \OCP\Constants::PERMISSION_READ);
} catch (Exception $exception) {
$this->assertEquals($message, $exception->getMessage());
}
@@ -98,7 +98,7 @@ class Test_Share extends \Test\TestCase {
public function testInvalidItemType() {
$message = 'Sharing backend for foobar not found';
try {
- OCP\Share::shareItem('foobar', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user2, OCP\PERMISSION_READ);
+ OCP\Share::shareItem('foobar', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user2, \OCP\Constants::PERMISSION_READ);
$this->fail('Exception was expected: '.$message);
} catch (Exception $exception) {
$this->assertEquals($message, $exception->getMessage());
@@ -134,7 +134,7 @@ class Test_Share extends \Test\TestCase {
$this->assertEquals($message, $exception->getMessage());
}
try {
- OCP\Share::setPermissions('foobar', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user2, OCP\PERMISSION_UPDATE);
+ OCP\Share::setPermissions('foobar', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user2, \OCP\Constants::PERMISSION_UPDATE);
$this->fail('Exception was expected: '.$message);
} catch (Exception $exception) {
$this->assertEquals($message, $exception->getMessage());
@@ -144,7 +144,7 @@ class Test_Share extends \Test\TestCase {
protected function shareUserOneTestFileWithUserTwo() {
OC_User::setUserId($this->user1);
$this->assertTrue(
- OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user2, OCP\PERMISSION_READ),
+ OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user2, \OCP\Constants::PERMISSION_READ),
'Failed asserting that user 1 successfully shared text.txt with user 2.'
);
$this->assertContains(
@@ -163,7 +163,7 @@ class Test_Share extends \Test\TestCase {
protected function shareUserTestFileAsLink() {
OC_User::setUserId($this->user1);
- $result = OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_LINK, null, OCP\PERMISSION_READ);
+ $result = OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_LINK, null, \OCP\Constants::PERMISSION_READ);
$this->assertTrue(is_string($result));
}
@@ -174,7 +174,7 @@ class Test_Share extends \Test\TestCase {
protected function shareUserTestFileWithUser($sharer, $receiver) {
OC_User::setUserId($sharer);
$this->assertTrue(
- OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $receiver, OCP\PERMISSION_READ | OCP\PERMISSION_SHARE),
+ OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $receiver, \OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_SHARE),
'Failed asserting that ' . $sharer . ' successfully shared text.txt with ' . $receiver . '.'
);
$this->assertContains(
@@ -195,21 +195,21 @@ class Test_Share extends \Test\TestCase {
// Invalid shares
$message = 'Sharing test.txt failed, because the user '.$this->user1.' is the item owner';
try {
- OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user1, OCP\PERMISSION_READ);
+ OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user1, \OCP\Constants::PERMISSION_READ);
$this->fail('Exception was expected: '.$message);
} catch (Exception $exception) {
$this->assertEquals($message, $exception->getMessage());
}
$message = 'Sharing test.txt failed, because the user foobar does not exist';
try {
- OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, 'foobar', OCP\PERMISSION_READ);
+ OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, 'foobar', \OCP\Constants::PERMISSION_READ);
$this->fail('Exception was expected: '.$message);
} catch (Exception $exception) {
$this->assertEquals($message, $exception->getMessage());
}
$message = 'Sharing foobar failed, because the sharing backend for test could not find its source';
try {
- OCP\Share::shareItem('test', 'foobar', OCP\Share::SHARE_TYPE_USER, $this->user2, OCP\PERMISSION_READ);
+ OCP\Share::shareItem('test', 'foobar', OCP\Share::SHARE_TYPE_USER, $this->user2, \OCP\Constants::PERMISSION_READ);
$this->fail('Exception was expected: '.$message);
} catch (Exception $exception) {
$this->assertEquals($message, $exception->getMessage());
@@ -222,7 +222,7 @@ class Test_Share extends \Test\TestCase {
OC_User::setUserId($this->user1);
$message = 'Sharing test.txt failed, because this item is already shared with '.$this->user2;
try {
- OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user2, OCP\PERMISSION_READ);
+ OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user2, \OCP\Constants::PERMISSION_READ);
$this->fail('Exception was expected: '.$message);
} catch (Exception $exception) {
$this->assertEquals($message, $exception->getMessage());
@@ -232,7 +232,7 @@ class Test_Share extends \Test\TestCase {
OC_User::setUserId($this->user2);
$message = 'Sharing test.txt failed, because the user '.$this->user1.' is the original sharer';
try {
- OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user1, OCP\PERMISSION_READ);
+ OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user1, \OCP\Constants::PERMISSION_READ);
$this->fail('Exception was expected: '.$message);
} catch (Exception $exception) {
$this->assertEquals($message, $exception->getMessage());
@@ -243,11 +243,11 @@ class Test_Share extends \Test\TestCase {
$this->assertTrue(OCP\Share::unshare('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user2));
// Attempt reshare without share permission
- $this->assertTrue(OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user2, OCP\PERMISSION_READ));
+ $this->assertTrue(OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user2, \OCP\Constants::PERMISSION_READ));
OC_User::setUserId($this->user2);
$message = 'Sharing test.txt failed, because resharing is not allowed';
try {
- OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user3, OCP\PERMISSION_READ);
+ OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user3, \OCP\Constants::PERMISSION_READ);
$this->fail('Exception was expected: '.$message);
} catch (Exception $exception) {
$this->assertEquals($message, $exception->getMessage());
@@ -255,30 +255,30 @@ class Test_Share extends \Test\TestCase {
// Owner grants share and update permission
OC_User::setUserId($this->user1);
- $this->assertTrue(OCP\Share::setPermissions('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user2, OCP\PERMISSION_READ | OCP\PERMISSION_UPDATE | OCP\PERMISSION_SHARE));
+ $this->assertTrue(OCP\Share::setPermissions('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user2, \OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_UPDATE | \OCP\Constants::PERMISSION_SHARE));
// Attempt reshare with escalated permissions
OC_User::setUserId($this->user2);
$message = 'Sharing test.txt failed, because the permissions exceed permissions granted to '.$this->user2;
try {
- OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user3, OCP\PERMISSION_READ | OCP\PERMISSION_DELETE);
+ OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user3, \OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_DELETE);
$this->fail('Exception was expected: '.$message);
} catch (Exception $exception) {
$this->assertEquals($message, $exception->getMessage());
}
// Valid reshare
- $this->assertTrue(OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user3, OCP\PERMISSION_READ | OCP\PERMISSION_UPDATE));
+ $this->assertTrue(OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user3, \OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_UPDATE));
$this->assertEquals(array('test.txt'), OCP\Share::getItemShared('test', 'test.txt', Test_Share_Backend::FORMAT_SOURCE));
OC_User::setUserId($this->user3);
$this->assertEquals(array('test.txt'), OCP\Share::getItemSharedWith('test', 'test.txt', Test_Share_Backend::FORMAT_SOURCE));
- $this->assertEquals(array(OCP\PERMISSION_READ | OCP\PERMISSION_UPDATE), OCP\Share::getItemSharedWith('test', 'test.txt', Test_Share_Backend::FORMAT_PERMISSIONS));
+ $this->assertEquals(array(\OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_UPDATE), OCP\Share::getItemSharedWith('test', 'test.txt', Test_Share_Backend::FORMAT_PERMISSIONS));
// Attempt to escalate permissions
OC_User::setUserId($this->user2);
$message = 'Setting permissions for test.txt failed, because the permissions exceed permissions granted to '.$this->user2;
try {
- OCP\Share::setPermissions('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user3, OCP\PERMISSION_READ | OCP\PERMISSION_DELETE);
+ OCP\Share::setPermissions('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user3, \OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_DELETE);
$this->fail('Exception was expected: '.$message);
} catch (Exception $exception) {
$this->assertEquals($message, $exception->getMessage());
@@ -286,25 +286,25 @@ class Test_Share extends \Test\TestCase {
// Remove update permission
OC_User::setUserId($this->user1);
- $this->assertTrue(OCP\Share::setPermissions('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user2, OCP\PERMISSION_READ | OCP\PERMISSION_SHARE));
+ $this->assertTrue(OCP\Share::setPermissions('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user2, \OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_SHARE));
OC_User::setUserId($this->user2);
- $this->assertEquals(array(OCP\PERMISSION_READ | OCP\PERMISSION_SHARE), OCP\Share::getItemSharedWith('test', 'test.txt', Test_Share_Backend::FORMAT_PERMISSIONS));
+ $this->assertEquals(array(\OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_SHARE), OCP\Share::getItemSharedWith('test', 'test.txt', Test_Share_Backend::FORMAT_PERMISSIONS));
OC_User::setUserId($this->user3);
- $this->assertEquals(array(OCP\PERMISSION_READ), OCP\Share::getItemSharedWith('test', 'test.txt', Test_Share_Backend::FORMAT_PERMISSIONS));
+ $this->assertEquals(array(\OCP\Constants::PERMISSION_READ), OCP\Share::getItemSharedWith('test', 'test.txt', Test_Share_Backend::FORMAT_PERMISSIONS));
// Remove share permission
OC_User::setUserId($this->user1);
- $this->assertTrue(OCP\Share::setPermissions('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user2, OCP\PERMISSION_READ));
+ $this->assertTrue(OCP\Share::setPermissions('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user2, \OCP\Constants::PERMISSION_READ));
OC_User::setUserId($this->user2);
- $this->assertEquals(array(OCP\PERMISSION_READ), OCP\Share::getItemSharedWith('test', 'test.txt', Test_Share_Backend::FORMAT_PERMISSIONS));
+ $this->assertEquals(array(\OCP\Constants::PERMISSION_READ), OCP\Share::getItemSharedWith('test', 'test.txt', Test_Share_Backend::FORMAT_PERMISSIONS));
OC_User::setUserId($this->user3);
$this->assertSame(array(), OCP\Share::getItemSharedWith('test', 'test.txt'));
// Reshare again, and then have owner unshare
OC_User::setUserId($this->user1);
- $this->assertTrue(OCP\Share::setPermissions('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user2, OCP\PERMISSION_READ | OCP\PERMISSION_SHARE));
+ $this->assertTrue(OCP\Share::setPermissions('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user2, \OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_SHARE));
OC_User::setUserId($this->user2);
- $this->assertTrue(OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user3, OCP\PERMISSION_READ));
+ $this->assertTrue(OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user3, \OCP\Constants::PERMISSION_READ));
OC_User::setUserId($this->user1);
$this->assertTrue(OCP\Share::unshare('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user2));
OC_User::setUserId($this->user2);
@@ -314,9 +314,9 @@ class Test_Share extends \Test\TestCase {
// Attempt target conflict
OC_User::setUserId($this->user1);
- $this->assertTrue(OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user2, OCP\PERMISSION_READ));
+ $this->assertTrue(OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user2, \OCP\Constants::PERMISSION_READ));
OC_User::setUserId($this->user3);
- $this->assertTrue(OCP\Share::shareItem('test', 'share.txt', OCP\Share::SHARE_TYPE_USER, $this->user2, OCP\PERMISSION_READ));
+ $this->assertTrue(OCP\Share::shareItem('test', 'share.txt', OCP\Share::SHARE_TYPE_USER, $this->user2, \OCP\Constants::PERMISSION_READ));
OC_User::setUserId($this->user2);
$to_test = OCP\Share::getItemsSharedWith('test', Test_Share_Backend::FORMAT_TARGET);
@@ -333,9 +333,9 @@ class Test_Share extends \Test\TestCase {
$this->assertEquals(array(), OCP\Share::getItemsSharedWith('test', Test_Share_Backend::FORMAT_TARGET));
OC_User::setUserId($this->user1);
- $this->assertTrue(OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user2, OCP\PERMISSION_READ));
+ $this->assertTrue(OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user2, \OCP\Constants::PERMISSION_READ));
OC_User::setUserId($this->user3);
- $this->assertTrue(OCP\Share::shareItem('test', 'share.txt', OCP\Share::SHARE_TYPE_USER, $this->user2, OCP\PERMISSION_READ));
+ $this->assertTrue(OCP\Share::shareItem('test', 'share.txt', OCP\Share::SHARE_TYPE_USER, $this->user2, \OCP\Constants::PERMISSION_READ));
OC_User::setUserId($this->user2);
$to_test = OCP\Share::getItemsSharedWith('test', Test_Share_Backend::FORMAT_TARGET);
@@ -412,7 +412,7 @@ class Test_Share extends \Test\TestCase {
OC_User::setUserId($this->user1);
$this->assertTrue(
- OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user4, OCP\PERMISSION_ALL),
+ OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user4, \OCP\Constants::PERMISSION_ALL),
'Failed asserting that user 1 successfully shared text.txt with user 4.'
);
$this->assertContains(
@@ -429,7 +429,7 @@ class Test_Share extends \Test\TestCase {
$share = OCP\Share::getItemSharedWith('test', 'test.txt');
- $this->assertSame(\OCP\PERMISSION_ALL & ~OCP\PERMISSION_SHARE, $share['permissions'],
+ $this->assertSame(\OCP\Constants::PERMISSION_ALL & ~\OCP\Constants::PERMISSION_SHARE, $share['permissions'],
'Failed asserting that user 4 is excluded from re-sharing');
\OC_Appconfig::deleteKey('core', 'shareapi_exclude_groups_list');
@@ -440,7 +440,7 @@ class Test_Share extends \Test\TestCase {
protected function shareUserOneTestFileWithGroupOne() {
OC_User::setUserId($this->user1);
$this->assertTrue(
- OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_GROUP, $this->group1, OCP\PERMISSION_READ),
+ OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_GROUP, $this->group1, \OCP\Constants::PERMISSION_READ),
'Failed asserting that user 1 successfully shared text.txt with group 1.'
);
$this->assertContains(
@@ -468,7 +468,7 @@ class Test_Share extends \Test\TestCase {
// Invalid shares
$message = 'Sharing test.txt failed, because the group foobar does not exist';
try {
- OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_GROUP, 'foobar', OCP\PERMISSION_READ);
+ OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_GROUP, 'foobar', \OCP\Constants::PERMISSION_READ);
$this->fail('Exception was expected: '.$message);
} catch (Exception $exception) {
$this->assertEquals($message, $exception->getMessage());
@@ -477,7 +477,7 @@ class Test_Share extends \Test\TestCase {
OC_Appconfig::setValue('core', 'shareapi_only_share_with_group_members', 'yes');
$message = 'Sharing test.txt failed, because '.$this->user1.' is not a member of the group '.$this->group2;
try {
- OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_GROUP, $this->group2, OCP\PERMISSION_READ);
+ OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_GROUP, $this->group2, \OCP\Constants::PERMISSION_READ);
$this->fail('Exception was expected: '.$message);
} catch (Exception $exception) {
$this->assertEquals($message, $exception->getMessage());
@@ -491,7 +491,7 @@ class Test_Share extends \Test\TestCase {
OC_User::setUserId($this->user1);
$message = 'Sharing test.txt failed, because this item is already shared with '.$this->group1;
try {
- OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_GROUP, $this->group1, OCP\PERMISSION_READ);
+ OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_GROUP, $this->group1, \OCP\Constants::PERMISSION_READ);
$this->fail('Exception was expected: '.$message);
} catch (Exception $exception) {
$this->assertEquals($message, $exception->getMessage());
@@ -501,7 +501,7 @@ class Test_Share extends \Test\TestCase {
OC_User::setUserId($this->user2);
$message = 'Sharing test.txt failed, because the user '.$this->user1.' is the original sharer';
try {
- OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user1, OCP\PERMISSION_READ);
+ OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user1, \OCP\Constants::PERMISSION_READ);
$this->fail('Exception was expected: '.$message);
} catch (Exception $exception) {
$this->assertEquals($message, $exception->getMessage());
@@ -510,7 +510,7 @@ class Test_Share extends \Test\TestCase {
// Attempt to share back to group
$message = 'Sharing test.txt failed, because this item is already shared with '.$this->group1;
try {
- OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_GROUP, $this->group1, OCP\PERMISSION_READ);
+ OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_GROUP, $this->group1, \OCP\Constants::PERMISSION_READ);
$this->fail('Exception was expected: '.$message);
} catch (Exception $exception) {
$this->assertEquals($message, $exception->getMessage());
@@ -519,7 +519,7 @@ class Test_Share extends \Test\TestCase {
// Attempt to share back to member of group
$message ='Sharing test.txt failed, because this item is already shared with '.$this->user3;
try {
- OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user3, OCP\PERMISSION_READ);
+ OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user3, \OCP\Constants::PERMISSION_READ);
$this->fail('Exception was expected: '.$message);
} catch (Exception $exception) {
$this->assertEquals($message, $exception->getMessage());
@@ -530,18 +530,18 @@ class Test_Share extends \Test\TestCase {
$this->assertTrue(OCP\Share::unshare('test', 'test.txt', OCP\Share::SHARE_TYPE_GROUP, $this->group1));
// Valid share with same person - user then group
- $this->assertTrue(OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user2, OCP\PERMISSION_READ | OCP\PERMISSION_DELETE | OCP\PERMISSION_SHARE));
- $this->assertTrue(OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_GROUP, $this->group1, OCP\PERMISSION_READ | OCP\PERMISSION_UPDATE));
+ $this->assertTrue(OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user2, \OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_DELETE | \OCP\Constants::PERMISSION_SHARE));
+ $this->assertTrue(OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_GROUP, $this->group1, \OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_UPDATE));
OC_User::setUserId($this->user2);
$this->assertEquals(array('test.txt'), OCP\Share::getItemsSharedWith('test', Test_Share_Backend::FORMAT_TARGET));
- $this->assertEquals(array(OCP\PERMISSION_READ | OCP\PERMISSION_UPDATE | OCP\PERMISSION_DELETE | OCP\PERMISSION_SHARE), OCP\Share::getItemSharedWith('test', 'test.txt', Test_Share_Backend::FORMAT_PERMISSIONS));
+ $this->assertEquals(array(\OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_UPDATE | \OCP\Constants::PERMISSION_DELETE | \OCP\Constants::PERMISSION_SHARE), OCP\Share::getItemSharedWith('test', 'test.txt', Test_Share_Backend::FORMAT_PERMISSIONS));
OC_User::setUserId($this->user3);
$this->assertEquals(array('test.txt'), OCP\Share::getItemsSharedWith('test', Test_Share_Backend::FORMAT_TARGET));
- $this->assertEquals(array(OCP\PERMISSION_READ | OCP\PERMISSION_UPDATE), OCP\Share::getItemSharedWith('test', 'test.txt', Test_Share_Backend::FORMAT_PERMISSIONS));
+ $this->assertEquals(array(\OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_UPDATE), OCP\Share::getItemSharedWith('test', 'test.txt', Test_Share_Backend::FORMAT_PERMISSIONS));
// Valid reshare
OC_User::setUserId($this->user2);
- $this->assertTrue(OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user4, OCP\PERMISSION_READ));
+ $this->assertTrue(OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user4, \OCP\Constants::PERMISSION_READ));
OC_User::setUserId($this->user4);
$this->assertEquals(array('test.txt'), OCP\Share::getItemsSharedWith('test', Test_Share_Backend::FORMAT_TARGET));
@@ -549,26 +549,26 @@ class Test_Share extends \Test\TestCase {
OC_User::setUserId($this->user1);
$this->assertTrue(OCP\Share::unshare('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user2));
OC_User::setUserId($this->user2);
- $this->assertEquals(array(OCP\PERMISSION_READ | OCP\PERMISSION_UPDATE), OCP\Share::getItemSharedWith('test', 'test.txt', Test_Share_Backend::FORMAT_PERMISSIONS));
+ $this->assertEquals(array(\OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_UPDATE), OCP\Share::getItemSharedWith('test', 'test.txt', Test_Share_Backend::FORMAT_PERMISSIONS));
OC_User::setUserId($this->user4);
$this->assertEquals(array('test.txt'), OCP\Share::getItemsSharedWith('test', Test_Share_Backend::FORMAT_TARGET));
// Valid share with same person - group then user
OC_User::setUserId($this->user1);
- $this->assertTrue(OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user2, OCP\PERMISSION_READ | OCP\PERMISSION_DELETE));
+ $this->assertTrue(OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user2, \OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_DELETE));
OC_User::setUserId($this->user2);
$this->assertEquals(array('test.txt'), OCP\Share::getItemsSharedWith('test', Test_Share_Backend::FORMAT_TARGET));
- $this->assertEquals(array(OCP\PERMISSION_READ | OCP\PERMISSION_UPDATE | OCP\PERMISSION_DELETE), OCP\Share::getItemSharedWith('test', 'test.txt', Test_Share_Backend::FORMAT_PERMISSIONS));
+ $this->assertEquals(array(\OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_UPDATE | \OCP\Constants::PERMISSION_DELETE), OCP\Share::getItemSharedWith('test', 'test.txt', Test_Share_Backend::FORMAT_PERMISSIONS));
// Unshare from group only
OC_User::setUserId($this->user1);
$this->assertTrue(OCP\Share::unshare('test', 'test.txt', OCP\Share::SHARE_TYPE_GROUP, $this->group1));
OC_User::setUserId($this->user2);
- $this->assertEquals(array(OCP\PERMISSION_READ | OCP\PERMISSION_DELETE), OCP\Share::getItemSharedWith('test', 'test.txt', Test_Share_Backend::FORMAT_PERMISSIONS));
+ $this->assertEquals(array(\OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_DELETE), OCP\Share::getItemSharedWith('test', 'test.txt', Test_Share_Backend::FORMAT_PERMISSIONS));
// Attempt user specific target conflict
OC_User::setUserId($this->user3);
- $this->assertTrue(OCP\Share::shareItem('test', 'share.txt', OCP\Share::SHARE_TYPE_GROUP, $this->group1, OCP\PERMISSION_READ | OCP\PERMISSION_SHARE));
+ $this->assertTrue(OCP\Share::shareItem('test', 'share.txt', OCP\Share::SHARE_TYPE_GROUP, $this->group1, \OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_SHARE));
OC_User::setUserId($this->user2);
$to_test = OCP\Share::getItemsSharedWith('test', Test_Share_Backend::FORMAT_TARGET);
$this->assertEquals(2, count($to_test));
@@ -576,7 +576,7 @@ class Test_Share extends \Test\TestCase {
$this->assertTrue(in_array('test1.txt', $to_test));
// Valid reshare
- $this->assertTrue(OCP\Share::shareItem('test', 'share.txt', OCP\Share::SHARE_TYPE_USER, $this->user4, OCP\PERMISSION_READ | OCP\PERMISSION_SHARE));
+ $this->assertTrue(OCP\Share::shareItem('test', 'share.txt', OCP\Share::SHARE_TYPE_USER, $this->user4, \OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_SHARE));
OC_User::setUserId($this->user4);
$this->assertEquals(array('test1.txt'), OCP\Share::getItemsSharedWith('test', Test_Share_Backend::FORMAT_TARGET));
@@ -628,7 +628,7 @@ class Test_Share extends \Test\TestCase {
$this->assertTrue(OCP\Share::unshareAll('test', 'test.txt'));
$this->assertTrue(
- OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_GROUP, $this->groupAndUser, OCP\PERMISSION_READ),
+ OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_GROUP, $this->groupAndUser, \OCP\Constants::PERMISSION_READ),
'Failed asserting that user 1 successfully shared text.txt with group 1.'
);
@@ -658,9 +658,53 @@ class Test_Share extends \Test\TestCase {
return $row;
}
+ public function testGetItemSharedWithUser() {
+ OC_User::setUserId($this->user1);
+
+ //add dummy values to the share table
+ $query = \OC_DB::prepare('INSERT INTO `*PREFIX*share` ('
+ .' `item_type`, `item_source`, `item_target`, `share_type`,'
+ .' `share_with`, `uid_owner`) VALUES (?,?,?,?,?,?)');
+ $args = array('test', 99, 'target1', OCP\Share::SHARE_TYPE_USER, $this->user2, $this->user1);
+ $query->execute($args);
+ $args = array('test', 99, 'target2', OCP\Share::SHARE_TYPE_USER, $this->user4, $this->user1);
+ $query->execute($args);
+ $args = array('test', 99, 'target3', OCP\Share::SHARE_TYPE_USER, $this->user3, $this->user2);
+ $query->execute($args);
+ $args = array('test', 99, 'target4', OCP\Share::SHARE_TYPE_USER, $this->user3, $this->user4);
+ $query->execute($args);
+
+
+ $result1 = \OCP\Share::getItemSharedWithUser('test', 99, $this->user2, $this->user1);
+ $this->assertSame(1, count($result1));
+ $this->verifyResult($result1, array('target1'));
+
+ $result2 = \OCP\Share::getItemSharedWithUser('test', 99, null, $this->user1);
+ $this->assertSame(2, count($result2));
+ $this->verifyResult($result2, array('target1', 'target2'));
+
+ $result3 = \OCP\Share::getItemSharedWithUser('test', 99, $this->user3);
+ $this->assertSame(2, count($result3));
+ $this->verifyResult($result3, array('target3', 'target4'));
+
+ $result4 = \OCP\Share::getItemSharedWithUser('test', 99, null, null);
+ $this->assertSame(4, count($result4));
+ $this->verifyResult($result4, array('target1', 'target2', 'target3', 'target4'));
+ }
+
+ public function verifyResult($result, $expected) {
+ foreach ($result as $r) {
+ if (in_array($r['item_target'], $expected)) {
+ $key = array_search($r['item_target'], $expected);
+ unset($expected[$key]);
+ }
+ }
+ $this->assertEmpty($expected, 'did not found all expected values');
+ }
+
public function testShareItemWithLink() {
OC_User::setUserId($this->user1);
- $token = OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_LINK, null, OCP\PERMISSION_READ);
+ $token = OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_LINK, null, \OCP\Constants::PERMISSION_READ);
$this->assertInternalType(
'string',
$token,
@@ -706,7 +750,7 @@ class Test_Share extends \Test\TestCase {
\OC_Appconfig::setValue('core', 'shareapi_default_expire_date', 'yes');
\OC_Appconfig::setValue('core', 'shareapi_expire_after_n_days', '2');
- $token = OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_LINK, null, OCP\PERMISSION_READ);
+ $token = OCP\Share::shareItem('test', 'test.txt', OCP\Share::SHARE_TYPE_LINK, null, \OCP\Constants::PERMISSION_READ);
$this->assertInternalType(
'string',
$token,
@@ -832,20 +876,20 @@ class Test_Share extends \Test\TestCase {
// one array with one share
array(
array( // input
- array('item_source' => 1, 'permissions' => \OCP\PERMISSION_ALL, 'item_target' => 't1')),
+ array('item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_ALL, 'item_target' => 't1')),
array( // expected result
- array('item_source' => 1, 'permissions' => \OCP\PERMISSION_ALL, 'item_target' => 't1'))),
+ array('item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_ALL, 'item_target' => 't1'))),
// two shares both point to the same source
array(
array( // input
- array('item_source' => 1, 'permissions' => \OCP\PERMISSION_READ, 'item_target' => 't1'),
- array('item_source' => 1, 'permissions' => \OCP\PERMISSION_UPDATE, 'item_target' => 't1'),
+ array('item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_READ, 'item_target' => 't1'),
+ array('item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_UPDATE, 'item_target' => 't1'),
),
array( // expected result
- array('item_source' => 1, 'permissions' => \OCP\PERMISSION_READ | \OCP\PERMISSION_UPDATE, 'item_target' => 't1',
+ array('item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_UPDATE, 'item_target' => 't1',
'grouped' => array(
- array('item_source' => 1, 'permissions' => \OCP\PERMISSION_READ, 'item_target' => 't1'),
- array('item_source' => 1, 'permissions' => \OCP\PERMISSION_UPDATE, 'item_target' => 't1'),
+ array('item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_READ, 'item_target' => 't1'),
+ array('item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_UPDATE, 'item_target' => 't1'),
)
),
)
@@ -853,29 +897,29 @@ class Test_Share extends \Test\TestCase {
// two shares both point to the same source but with different targets
array(
array( // input
- array('item_source' => 1, 'permissions' => \OCP\PERMISSION_READ, 'item_target' => 't1'),
- array('item_source' => 1, 'permissions' => \OCP\PERMISSION_UPDATE, 'item_target' => 't2'),
+ array('item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_READ, 'item_target' => 't1'),
+ array('item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_UPDATE, 'item_target' => 't2'),
),
array( // expected result
- array('item_source' => 1, 'permissions' => \OCP\PERMISSION_READ, 'item_target' => 't1'),
- array('item_source' => 1, 'permissions' => \OCP\PERMISSION_UPDATE, 'item_target' => 't2'),
+ array('item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_READ, 'item_target' => 't1'),
+ array('item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_UPDATE, 'item_target' => 't2'),
)
),
// three shares two point to the same source
array(
array( // input
- array('item_source' => 1, 'permissions' => \OCP\PERMISSION_READ, 'item_target' => 't1'),
- array('item_source' => 2, 'permissions' => \OCP\PERMISSION_CREATE, 'item_target' => 't2'),
- array('item_source' => 1, 'permissions' => \OCP\PERMISSION_UPDATE, 'item_target' => 't1'),
+ array('item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_READ, 'item_target' => 't1'),
+ array('item_source' => 2, 'permissions' => \OCP\Constants::PERMISSION_CREATE, 'item_target' => 't2'),
+ array('item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_UPDATE, 'item_target' => 't1'),
),
array( // expected result
- array('item_source' => 1, 'permissions' => \OCP\PERMISSION_READ | \OCP\PERMISSION_UPDATE, 'item_target' => 't1',
+ array('item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_UPDATE, 'item_target' => 't1',
'grouped' => array(
- array('item_source' => 1, 'permissions' => \OCP\PERMISSION_READ, 'item_target' => 't1'),
- array('item_source' => 1, 'permissions' => \OCP\PERMISSION_UPDATE, 'item_target' => 't1'),
+ array('item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_READ, 'item_target' => 't1'),
+ array('item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_UPDATE, 'item_target' => 't1'),
)
),
- array('item_source' => 2, 'permissions' => \OCP\PERMISSION_CREATE, 'item_target' => 't2'),
+ array('item_source' => 2, 'permissions' => \OCP\Constants::PERMISSION_CREATE, 'item_target' => 't2'),
)
),
);
diff --git a/tests/lib/tags.php b/tests/lib/tags.php
index ab714bde3df..3f0c52d19ea 100644
--- a/tests/lib/tags.php
+++ b/tests/lib/tags.php
@@ -214,7 +214,7 @@ class Test_Tags extends \Test\TestCase {
$this->assertFalse($other_tagger->hasTag($test_tag));
OC_User::setUserId($this->user);
- OCP\Share::shareItem('test', 1, OCP\Share::SHARE_TYPE_USER, $other_user, OCP\PERMISSION_READ);
+ OCP\Share::shareItem('test', 1, OCP\Share::SHARE_TYPE_USER, $other_user, \OCP\Constants::PERMISSION_READ);
OC_User::setUserId($other_user);
$other_tagger = $other_tagMgr->load('test', array(), true); // Update tags, load shared ones.
diff --git a/tests/lib/tempmanager.php b/tests/lib/tempmanager.php
index 05311e820a7..c030eef2c9e 100644
--- a/tests/lib/tempmanager.php
+++ b/tests/lib/tempmanager.php
@@ -27,7 +27,7 @@ class TempManager extends \Test\TestCase {
protected function setUp() {
parent::setUp();
- $this->baseDir = get_temp_dir() . '/oc_tmp_test';
+ $this->baseDir = get_temp_dir() . $this->getUniqueID('/oc_tmp_test');
if (!is_dir($this->baseDir)) {
mkdir($this->baseDir);
}
@@ -39,7 +39,7 @@ class TempManager extends \Test\TestCase {
}
/**
- * @param \Psr\Log\LoggerInterface $logger
+ * @param \OCP\ILogger $logger
* @return \OC\TempManager
*/
protected function getManager($logger = null) {
diff --git a/tests/lib/testcase.php b/tests/lib/testcase.php
index 315cd6858ed..e6f5ca71dac 100644
--- a/tests/lib/testcase.php
+++ b/tests/lib/testcase.php
@@ -23,21 +23,127 @@
namespace Test;
abstract class TestCase extends \PHPUnit_Framework_TestCase {
+ /**
+ * Returns a unique identifier as uniqid() is not reliable sometimes
+ *
+ * @param string $prefix
+ * @param int $length
+ * @return string
+ */
protected function getUniqueID($prefix = '', $length = 13) {
- // Do not use dots and slashes as we use the value for file names
return $prefix . \OC::$server->getSecureRandom()->getLowStrengthGenerator()->generate(
$length,
+ // Do not use dots and slashes as we use the value for file names
'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
);
}
public static function tearDownAfterClass() {
+ $dataDir = \OC::$server->getConfig()->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data-autotest');
+
+ self::tearDownAfterClassCleanFileMapper($dataDir);
+ self::tearDownAfterClassCleanStorages();
+ self::tearDownAfterClassCleanFileCache();
+ self::tearDownAfterClassCleanStrayDataFiles($dataDir);
+ self::tearDownAfterClassCleanStrayHooks();
+ self::tearDownAfterClassCleanProxies();
+
+ parent::tearDownAfterClass();
+ }
+
+ /**
+ * Remove all entries from the files map table
+ * @param string $dataDir
+ */
+ static protected function tearDownAfterClassCleanFileMapper($dataDir) {
if (\OC_Util::runningOnWindows()) {
- $rootDirectory = \OC::$server->getConfig()->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data-autotest');
- $mapper = new \OC\Files\Mapper($rootDirectory);
- $mapper->removePath($rootDirectory, true, true);
+ $mapper = new \OC\Files\Mapper($dataDir);
+ $mapper->removePath($dataDir, true, true);
}
+ }
- parent::tearDownAfterClass();
+ /**
+ * Remove all entries from the storages table
+ * @throws \DatabaseException
+ */
+ static protected function tearDownAfterClassCleanStorages() {
+ $sql = 'DELETE FROM `*PREFIX*storages`';
+ $query = \OC_DB::prepare($sql);
+ $query->execute();
+ }
+
+ /**
+ * Remove all entries from the filecache table
+ * @throws \DatabaseException
+ */
+ static protected function tearDownAfterClassCleanFileCache() {
+ $sql = 'DELETE FROM `*PREFIX*filecache`';
+ $query = \OC_DB::prepare($sql);
+ $query->execute();
+ }
+
+ /**
+ * Remove all unused files from the data dir
+ *
+ * @param string $dataDir
+ */
+ static protected function tearDownAfterClassCleanStrayDataFiles($dataDir) {
+ $knownEntries = array(
+ 'owncloud.log' => true,
+ 'owncloud.db' => true,
+ '.ocdata' => true,
+ '..' => true,
+ '.' => true,
+ );
+
+ if ($dh = opendir($dataDir)) {
+ while (($file = readdir($dh)) !== false) {
+ if (!isset($knownEntries[$file])) {
+ self::tearDownAfterClassCleanStrayDataUnlinkDir($dataDir . '/' . $file);
+ }
+ }
+ closedir($dh);
+ }
+ }
+
+ /**
+ * Recursive delete files and folders from a given directory
+ *
+ * @param string $dir
+ */
+ static protected function tearDownAfterClassCleanStrayDataUnlinkDir($dir) {
+ if ($dh = @opendir($dir)) {
+ while (($file = readdir($dh)) !== false) {
+ if ($file === '..' || $file === '.') {
+ continue;
+ }
+ $path = $dir . '/' . $file;
+ if (is_dir($path)) {
+ self::tearDownAfterClassCleanStrayDataUnlinkDir($path);
+ }
+ else {
+ @unlink($path);
+ }
+ }
+ closedir($dh);
+ }
+ @rmdir($dir);
+ }
+
+ /**
+ * Clean up the list of hooks
+ */
+ static protected function tearDownAfterClassCleanStrayHooks() {
+ \OC_Hook::clear();
+ }
+
+ /**
+ * Clean up the list of file proxies
+ *
+ * Also reenables file proxies, in case a test disabled them
+ */
+ static protected function tearDownAfterClassCleanProxies() {
+ \OC_FileProxy::$enabled = true;
+ \OC_FileProxy::clearProxies();
}
}
diff --git a/tests/lib/updater.php b/tests/lib/updater.php
index cc82450cfb6..155dccf78a7 100644
--- a/tests/lib/updater.php
+++ b/tests/lib/updater.php
@@ -10,7 +10,7 @@ namespace OC;
class UpdaterTest extends \Test\TestCase {
- public function testVersionCompatbility() {
+ public function versionCompatibilityTestData() {
return array(
array('1.0.0.0', '2.2.0', true),
array('1.1.1.1', '2.0.0', true),
@@ -24,7 +24,7 @@ class UpdaterTest extends \Test\TestCase {
}
/**
- * @dataProvider testVersionCompatbility
+ * @dataProvider versionCompatibilityTestData
*/
function testIsUpgradePossible($oldVersion, $newVersion, $result) {
$updater = new Updater();
diff --git a/tests/phpunit-autotest.xml b/tests/phpunit-autotest.xml
index 282f5477c30..9fba824bc7d 100644
--- a/tests/phpunit-autotest.xml
+++ b/tests/phpunit-autotest.xml
@@ -39,11 +39,6 @@
</filter>
<listeners>
<listener class="StartSessionListener" file="startsessionlistener.php" />
- <listener class="TestCleanupListener" file="testcleanuplistener.php">
- <arguments>
- <string>detail</string>
- </arguments>
- </listener>
</listeners>
</phpunit>
diff --git a/tests/preseed-config.php b/tests/preseed-config.php
index 3fd5b3cb7fc..3f41573bf29 100644
--- a/tests/preseed-config.php
+++ b/tests/preseed-config.php
@@ -1,22 +1,21 @@
<?php
$CONFIG = array (
- "appstoreenabled" => false,
- 'apps_paths' =>
- array (
- 0 =>
- array (
- 'path' => OC::$SERVERROOT.'/apps',
- 'url' => '/apps',
- 'writable' => true,
- ),
- 1 =>
- array (
- 'path' => OC::$SERVERROOT.'/apps2',
- 'url' => '/apps2',
- 'writable' => false,
- )
- ),
-
+ "appstoreenabled" => false,
+ 'apps_paths' =>
+ array (
+ 0 =>
+ array (
+ 'path' => OC::$SERVERROOT.'/apps',
+ 'url' => '/apps',
+ 'writable' => true,
+ ),
+ 1 =>
+ array (
+ 'path' => OC::$SERVERROOT.'/apps2',
+ 'url' => '/apps2',
+ 'writable' => false,
+ )
+ ),
);
if(substr(strtolower(PHP_OS), 0, 3) == "win") {
diff --git a/tests/testcleanuplistener.php b/tests/testcleanuplistener.php
deleted file mode 100644
index 7b442bbd4f7..00000000000
--- a/tests/testcleanuplistener.php
+++ /dev/null
@@ -1,176 +0,0 @@
-<?php
-/**
- * Copyright (c) 2013 Vincent Petry <pvince81@owncloud.com>
- * This file is licensed under the Affero General Public License version 3 or
- * later.
- * See the COPYING-README file.
- */
-
-/**
- * Detects tests that didn't clean up properly, show a warning, then clean up after them.
- */
-class TestCleanupListener implements PHPUnit_Framework_TestListener {
- private $verbosity;
-
- public function __construct($verbosity = 'verbose') {
- $this->verbosity = $verbosity;
- }
-
- public function addError(PHPUnit_Framework_Test $test, Exception $e, $time) {
- }
-
- public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time) {
- }
-
- public function addIncompleteTest(PHPUnit_Framework_Test $test, Exception $e, $time) {
- }
-
- public function addRiskyTest(PHPUnit_Framework_Test $test, Exception $e, $time) {
- }
-
- public function addSkippedTest(PHPUnit_Framework_Test $test, Exception $e, $time) {
- }
-
- public function startTest(PHPUnit_Framework_Test $test) {
- }
-
- public function endTest(PHPUnit_Framework_Test $test, $time) {
- }
-
- public function startTestSuite(PHPUnit_Framework_TestSuite $suite) {
- }
-
- public function endTestSuite(PHPUnit_Framework_TestSuite $suite) {
- // don't clean up the test environment if a data provider finished
- if (!($suite instanceof PHPUnit_Framework_TestSuite_DataProvider)) {
- if ($this->cleanStorages() && $this->isShowSuiteWarning()) {
- printf("TestSuite '%s': Did not clean up storages\n", $suite->getName());
- }
- if ($this->cleanFileCache() && $this->isShowSuiteWarning()) {
- printf("TestSuite '%s': Did not clean up file cache\n", $suite->getName());
- }
- if ($this->cleanStrayDataFiles() && $this->isShowSuiteWarning()) {
- printf("TestSuite '%s': Did not clean up data dir\n", $suite->getName());
- }
- if ($this->cleanStrayHooks() && $this->isShowSuiteWarning()) {
- printf("TestSuite '%s': Did not clean up hooks\n", $suite->getName());
- }
- if ($this->cleanProxies() && $this->isShowSuiteWarning()) {
- printf("TestSuite '%s': Did not clean up proxies\n", $suite->getName());
- }
- }
- }
-
- private function isShowSuiteWarning() {
- return $this->verbosity === 'suite' || $this->verbosity === 'detail';
- }
-
- private function isShowDetail() {
- return $this->verbosity === 'detail';
- }
-
- /**
- * @param string $dir
- */
- private function unlinkDir($dir) {
- if ($dh = @opendir($dir)) {
- while (($file = readdir($dh)) !== false) {
- if ($file === '..' || $file === '.') {
- continue;
- }
- $path = $dir . '/' . $file;
- if (is_dir($path)) {
- $this->unlinkDir($path);
- }
- else {
- @unlink($path);
- }
- }
- closedir($dh);
- }
- @rmdir($dir);
- }
-
- private function cleanStrayDataFiles() {
- $knownEntries = array(
- 'owncloud.log' => true,
- 'owncloud.db' => true,
- '.ocdata' => true,
- '..' => true,
- '.' => true
- );
- $datadir = \OC_Config::getValue('datadirectory', \OC::$SERVERROOT . '/data');
- $entries = array();
- if ($dh = opendir($datadir)) {
- while (($file = readdir($dh)) !== false) {
- if (!isset($knownEntries[$file])) {
- $entries[] = $file;
- }
- }
- closedir($dh);
- }
-
- if (count($entries) > 0) {
- foreach ($entries as $entry) {
- $this->unlinkDir($datadir . '/' . $entry);
- if ($this->isShowDetail()) {
- printf("Stray datadir entry: %s\n", $entry);
- }
- }
- return true;
- }
-
- return false;
- }
-
- private function cleanStorages() {
- $sql = 'DELETE FROM `*PREFIX*storages`';
- $query = \OC_DB::prepare( $sql );
- $result = $query->execute();
- if ($result > 0) {
- return true;
- }
- return false;
- }
-
- private function cleanFileCache() {
- $sql = 'DELETE FROM `*PREFIX*filecache`';
- $query = \OC_DB::prepare( $sql );
- $result = $query->execute();
- if ($result > 0) {
- return true;
- }
- return false;
- }
-
- private function cleanStrayHooks() {
- $hasHooks = false;
- $hooks = OC_Hook::getHooks();
- if (!$hooks || sizeof($hooks) === 0) {
- return false;
- }
-
- foreach ($hooks as $signalClass => $signals) {
- if (sizeof($signals)) {
- foreach ($signals as $signalName => $handlers ) {
- if (sizeof($handlers) > 0) {
- $hasHooks = true;
- OC_Hook::clear($signalClass, $signalName);
- if ($this->isShowDetail()) {
- printf("Stray hook: \"%s\" \"%s\"\n", $signalClass, $signalName);
- }
- }
- }
- }
- }
- return $hasHooks;
- }
-
- private function cleanProxies() {
- $proxies = OC_FileProxy::getProxies();
- OC_FileProxy::clearProxies();
- // reenable in case some test failed to reenable them
- OC_FileProxy::$enabled = true;
- return count($proxies) > 0;
- }
-}