summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2013-11-26 19:15:53 +0100
committerBjoern Schiessle <schiessle@owncloud.com>2013-11-26 19:15:53 +0100
commit7240d349da32af187b1920d8cf1cf67d81d268a1 (patch)
tree27e42cfe58e7de000ee4c0899a3c3afc8537079e /apps
parentc7e1fe50c23771995bebf218c18deaf12ba628ca (diff)
parent1fef97f6a535cd79d0aea600634ec54c5f87bcea (diff)
downloadnextcloud-server-7240d349da32af187b1920d8cf1cf67d81d268a1.tar.gz
nextcloud-server-7240d349da32af187b1920d8cf1cf67d81d268a1.zip
Merge branch 'master' into encryption_initial_enc_indicator
Diffstat (limited to 'apps')
-rw-r--r--apps/files/l10n/cs_CZ.php1
-rw-r--r--apps/files/l10n/fr.php1
-rw-r--r--apps/files/l10n/sv.php2
-rw-r--r--apps/files_encryption/l10n/cs_CZ.php1
-rw-r--r--apps/files_encryption/l10n/sv.php1
-rw-r--r--apps/files_external/3rdparty/smb4php/smb.php16
-rwxr-xr-xapps/files_external/lib/dropbox.php56
-rw-r--r--apps/files_external/lib/sftp.php3
-rw-r--r--apps/files_external/lib/streamwrapper.php3
-rw-r--r--apps/files_external/tests/dropbox.php16
-rw-r--r--apps/files_external/tests/smb.php5
-rw-r--r--apps/files_sharing/l10n/cs_CZ.php3
-rw-r--r--apps/files_versions/lib/versions.php23
-rw-r--r--apps/user_ldap/l10n/cs_CZ.php10
-rw-r--r--apps/user_ldap/l10n/sv.php4
15 files changed, 118 insertions, 27 deletions
diff --git a/apps/files/l10n/cs_CZ.php b/apps/files/l10n/cs_CZ.php
index 4c7f3d6d0d0..14adf372bad 100644
--- a/apps/files/l10n/cs_CZ.php
+++ b/apps/files/l10n/cs_CZ.php
@@ -43,6 +43,7 @@ $TRANSLATIONS = array(
"Could not rename file" => "Nepodařilo se přejmenovat soubor",
"replaced {new_name} with {old_name}" => "nahrazeno {new_name} s {old_name}",
"undo" => "vrátit zpět",
+"Error deleting file." => "Chyba při mazání souboru.",
"_%n folder_::_%n folders_" => array("%n složka","%n složky","%n složek"),
"_%n file_::_%n files_" => array("%n soubor","%n soubory","%n souborů"),
"{dirs} and {files}" => "{dirs} a {files}",
diff --git a/apps/files/l10n/fr.php b/apps/files/l10n/fr.php
index 74f9599ade2..3a902485032 100644
--- a/apps/files/l10n/fr.php
+++ b/apps/files/l10n/fr.php
@@ -43,6 +43,7 @@ $TRANSLATIONS = array(
"Could not rename file" => "Impossible de renommer le fichier",
"replaced {new_name} with {old_name}" => "{new_name} a été remplacé par {old_name}",
"undo" => "annuler",
+"Error deleting file." => "Erreur pendant la suppression du fichier.",
"_%n folder_::_%n folders_" => array("%n dossier","%n dossiers"),
"_%n file_::_%n files_" => array("%n fichier","%n fichiers"),
"{dirs} and {files}" => "{dirs} et {files}",
diff --git a/apps/files/l10n/sv.php b/apps/files/l10n/sv.php
index cbbabae5956..7beb2b7c16d 100644
--- a/apps/files/l10n/sv.php
+++ b/apps/files/l10n/sv.php
@@ -43,6 +43,7 @@ $TRANSLATIONS = array(
"Could not rename file" => "Kan ej byta filnamn",
"replaced {new_name} with {old_name}" => "ersatt {new_name} med {old_name}",
"undo" => "ångra",
+"Error deleting file." => "Kunde inte ta bort filen.",
"_%n folder_::_%n folders_" => array("%n mapp","%n mappar"),
"_%n file_::_%n files_" => array("%n fil","%n filer"),
"{dirs} and {files}" => "{dirs} och {files}",
@@ -60,6 +61,7 @@ $TRANSLATIONS = array(
"Name" => "Namn",
"Size" => "Storlek",
"Modified" => "Ändrad",
+"Invalid folder name. Usage of 'Shared' is reserved." => "Ogiltigt mappnamn. Användande av 'Shared' är reserverat av ownCloud",
"%s could not be renamed" => "%s kunde inte namnändras",
"Upload" => "Ladda upp",
"File handling" => "Filhantering",
diff --git a/apps/files_encryption/l10n/cs_CZ.php b/apps/files_encryption/l10n/cs_CZ.php
index 8464ad2bb4a..a49530d94d9 100644
--- a/apps/files_encryption/l10n/cs_CZ.php
+++ b/apps/files_encryption/l10n/cs_CZ.php
@@ -9,6 +9,7 @@ $TRANSLATIONS = array(
"Private key password successfully updated." => "Heslo soukromého klíče úspěšně aktualizováno.",
"Could not update the private key password. Maybe the old password was not correct." => "Nelze aktualizovat heslo soukromého klíče. Možná nebylo staré heslo správně.",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." => "Aplikace pro šifrování není inicializována! Je možné, že aplikace byla znovu aktivována během vašeho přihlášení. Zkuste se prosím odhlásit a znovu přihlásit pro provedení inicializace šifrovací aplikace.",
+"Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "Váš soukromý klíč není platný! Pravděpodobně bylo heslo změněno vně systému %s (např. ve vašem firemním adresáři). Heslo vašeho soukromého klíče můžete změnit ve svém osobním nastavení pro obnovení přístupu k vašim zašifrovaným souborům.",
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "Tento soubor se nepodařilo dešifrovat, pravděpodobně je sdílený. Požádejte prosím majitele souboru, aby jej s vámi znovu sdílel.",
"Unknown error please check your system settings or contact your administrator" => "Neznámá chyba, zkontrolujte vaše systémová nastavení nebo kontaktujte vašeho správce",
"Missing requirements." => "Nesplněné závislosti.",
diff --git a/apps/files_encryption/l10n/sv.php b/apps/files_encryption/l10n/sv.php
index 87f7aabc7ad..1e509ea08e7 100644
--- a/apps/files_encryption/l10n/sv.php
+++ b/apps/files_encryption/l10n/sv.php
@@ -9,6 +9,7 @@ $TRANSLATIONS = array(
"Private key password successfully updated." => "Den privata nyckelns lösenord uppdaterades utan problem.",
"Could not update the private key password. Maybe the old password was not correct." => "Kunde inte uppdatera lösenordet för den privata nyckeln. Kanske var det gamla lösenordet fel.",
"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." => "Krypteringsprogrammet kunde inte initieras! Möjligen blev krypteringsprogrammet återaktiverad under din session. Försök med att logga ut och in igen för att initiera krypteringsprogrammet.",
+"Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "Din privata lösenordsnyckel är inte giltig! Troligen har ditt lösenord ändrats utanför %s (t.ex. i företagets katalogtjänst). Du kan uppdatera den privata lösenordsnyckeln under dina personliga inställningar för att återfå tillgång till dina filer.",
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "Kan ej dekryptera denna fil, förmodligen är det en delad fil. Be ägaren av filen att dela den med dig.",
"Unknown error please check your system settings or contact your administrator" => "Oväntat fel, kolla dina system inställningar eller kontakta din administratör",
"Missing requirements." => "Krav som saknas",
diff --git a/apps/files_external/3rdparty/smb4php/smb.php b/apps/files_external/3rdparty/smb4php/smb.php
index 9650f809041..87638271f0e 100644
--- a/apps/files_external/3rdparty/smb4php/smb.php
+++ b/apps/files_external/3rdparty/smb4php/smb.php
@@ -302,6 +302,7 @@ class smb {
}
function rename ($url_from, $url_to) {
+ $replace = false;
list ($from, $to) = array (smb::parse_url($url_from), smb::parse_url($url_to));
if ($from['host'] <> $to['host'] ||
$from['share'] <> $to['share'] ||
@@ -314,7 +315,20 @@ class smb {
trigger_error('rename(): error in URL', E_USER_ERROR);
}
smb::clearstatcache ($url_from);
- $result = smb::execute ('rename "'.$from['path'].'" "'.$to['path'].'"', $to);
+ $cmd = '';
+ // check if target file exists
+ if (smb::url_stat($url_to)) {
+ // delete target file first
+ $cmd = 'del "' . $to['path'] . '"; ';
+ $replace = true;
+ }
+ $cmd .= 'rename "' . $from['path'] . '" "' . $to['path'] . '"';
+ $result = smb::execute($cmd, $to);
+ if ($replace) {
+ // clear again, else the cache will return the info
+ // from the old file
+ smb::clearstatcache ($url_to);
+ }
return $result !== false;
}
diff --git a/apps/files_external/lib/dropbox.php b/apps/files_external/lib/dropbox.php
index 5f603b7fe43..f7d8d98cf03 100755
--- a/apps/files_external/lib/dropbox.php
+++ b/apps/files_external/lib/dropbox.php
@@ -50,6 +50,22 @@ class Dropbox extends \OC\Files\Storage\Common {
}
}
+ private function deleteMetaData($path) {
+ $path = $this->root.$path;
+ if (isset($this->metaData[$path])) {
+ unset($this->metaData[$path]);
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * @brief Returns the path's metadata
+ * @param $path path for which to return the metadata
+ * @param $list if true, also return the directory's contents
+ * @return directory contents if $list is true, file metadata if $list is
+ * false, null if the file doesn't exist or "false" if the operation failed
+ */
private function getMetaData($path, $list = false) {
$path = $this->root.$path;
if ( ! $list && isset($this->metaData[$path])) {
@@ -62,24 +78,35 @@ class Dropbox extends \OC\Files\Storage\Common {
\OCP\Util::writeLog('files_external', $exception->getMessage(), \OCP\Util::ERROR);
return false;
}
+ $contents = array();
if ($response && isset($response['contents'])) {
- $contents = $response['contents'];
// Cache folder's contents
- foreach ($contents as $file) {
- $this->metaData[$path.'/'.basename($file['path'])] = $file;
+ foreach ($response['contents'] as $file) {
+ if (!isset($file['is_deleted']) || !$file['is_deleted']) {
+ $this->metaData[$path.'/'.basename($file['path'])] = $file;
+ $contents[] = $file;
+ }
}
unset($response['contents']);
+ }
+ if (!isset($response['is_deleted']) || !$response['is_deleted']) {
$this->metaData[$path] = $response;
}
- $this->metaData[$path] = $response;
// Return contents of folder only
return $contents;
} else {
try {
$response = $this->dropbox->getMetaData($path, 'false');
- $this->metaData[$path] = $response;
- return $response;
+ if (!isset($response['is_deleted']) || !$response['is_deleted']) {
+ $this->metaData[$path] = $response;
+ return $response;
+ }
+ return null;
} catch (\Exception $exception) {
+ if ($exception instanceof \Dropbox_Exception_NotFound) {
+ // don't log, might be a file_exist check
+ return false;
+ }
\OCP\Util::writeLog('files_external', $exception->getMessage(), \OCP\Util::ERROR);
return false;
}
@@ -108,7 +135,7 @@ class Dropbox extends \OC\Files\Storage\Common {
public function opendir($path) {
$contents = $this->getMetaData($path, true);
- if ($contents) {
+ if ($contents !== false) {
$files = array();
foreach ($contents as $file) {
$files[] = basename($file['path']);
@@ -157,9 +184,9 @@ class Dropbox extends \OC\Files\Storage\Common {
}
public function unlink($path) {
- $path = $this->root.$path;
try {
- $this->dropbox->delete($path);
+ $this->dropbox->delete($this->root.$path);
+ $this->deleteMetaData($path);
return true;
} catch (\Exception $exception) {
\OCP\Util::writeLog('files_external', $exception->getMessage(), \OCP\Util::ERROR);
@@ -168,10 +195,14 @@ class Dropbox extends \OC\Files\Storage\Common {
}
public function rename($path1, $path2) {
- $path1 = $this->root.$path1;
- $path2 = $this->root.$path2;
try {
- $this->dropbox->move($path1, $path2);
+ // overwrite if target file exists and is not a directory
+ $destMetaData = $this->getMetaData($path2);
+ if (isset($destMetaData) && $destMetaData !== false && !$destMetaData['is_dir']) {
+ $this->unlink($path2);
+ }
+ $this->dropbox->move($this->root.$path1, $this->root.$path2);
+ $this->deleteMetaData($path1);
return true;
} catch (\Exception $exception) {
\OCP\Util::writeLog('files_external', $exception->getMessage(), \OCP\Util::ERROR);
@@ -274,6 +305,7 @@ class Dropbox extends \OC\Files\Storage\Common {
} else {
$this->file_put_contents($path, '');
}
+ return true;
}
}
diff --git a/apps/files_external/lib/sftp.php b/apps/files_external/lib/sftp.php
index bcc4c5eafd5..95e0cefa398 100644
--- a/apps/files_external/lib/sftp.php
+++ b/apps/files_external/lib/sftp.php
@@ -285,6 +285,9 @@ class SFTP extends \OC\Files\Storage\Common {
public function rename($source, $target) {
try {
+ if (!$this->is_dir($target) && $this->file_exists($target)) {
+ $this->unlink($target);
+ }
return $this->client->rename(
$this->absPath($source),
$this->absPath($target)
diff --git a/apps/files_external/lib/streamwrapper.php b/apps/files_external/lib/streamwrapper.php
index 23c5f91a2f3..7a1991d4f04 100644
--- a/apps/files_external/lib/streamwrapper.php
+++ b/apps/files_external/lib/streamwrapper.php
@@ -38,7 +38,7 @@ abstract class StreamWrapper extends Common {
}
public function filetype($path) {
- return filetype($this->constructUrl($path));
+ return @filetype($this->constructUrl($path));
}
public function file_exists($path) {
@@ -68,6 +68,7 @@ abstract class StreamWrapper extends Common {
}
} else {
$this->file_put_contents($path, '');
+ return true;
}
}
diff --git a/apps/files_external/tests/dropbox.php b/apps/files_external/tests/dropbox.php
index e4e598b06b0..4b052282019 100644
--- a/apps/files_external/tests/dropbox.php
+++ b/apps/files_external/tests/dropbox.php
@@ -21,6 +21,22 @@ class Dropbox extends Storage {
$this->instance = new \OC\Files\Storage\Dropbox($this->config['dropbox']);
}
+ public function directoryProvider() {
+ // doesn't support leading/trailing spaces
+ return array(array('folder'));
+ }
+
+ public function testDropboxTouchReturnValue() {
+ $this->assertFalse($this->instance->file_exists('foo'));
+
+ // true because succeeded
+ $this->assertTrue($this->instance->touch('foo'));
+ $this->assertTrue($this->instance->file_exists('foo'));
+
+ // false because not supported
+ $this->assertFalse($this->instance->touch('foo'));
+ }
+
public function tearDown() {
if ($this->instance) {
$this->instance->unlink('/');
diff --git a/apps/files_external/tests/smb.php b/apps/files_external/tests/smb.php
index 0291f293fa6..199e35af676 100644
--- a/apps/files_external/tests/smb.php
+++ b/apps/files_external/tests/smb.php
@@ -29,6 +29,11 @@ class SMB extends Storage {
}
}
+ public function directoryProvider() {
+ // doesn't support leading/trailing spaces
+ return array(array('folder'));
+ }
+
public function testRenameWithSpaces() {
$this->instance->mkdir('with spaces');
$result = $this->instance->rename('with spaces', 'foo bar');
diff --git a/apps/files_sharing/l10n/cs_CZ.php b/apps/files_sharing/l10n/cs_CZ.php
index 192c4a79572..adf099a6d94 100644
--- a/apps/files_sharing/l10n/cs_CZ.php
+++ b/apps/files_sharing/l10n/cs_CZ.php
@@ -14,6 +14,7 @@ $TRANSLATIONS = array(
"Download" => "Stáhnout",
"Upload" => "Odeslat",
"Cancel upload" => "Zrušit odesílání",
-"No preview available for" => "Náhled není dostupný pro"
+"No preview available for" => "Náhled není dostupný pro",
+"Direct link" => "Přímý odkaz"
);
$PLURAL_FORMS = "nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;";
diff --git a/apps/files_versions/lib/versions.php b/apps/files_versions/lib/versions.php
index 661e98b09d5..b03e1d4e93a 100644
--- a/apps/files_versions/lib/versions.php
+++ b/apps/files_versions/lib/versions.php
@@ -318,22 +318,21 @@ class Storage {
* @return size of vesions
*/
private static function calculateSize($uid) {
- if( \OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true' ) {
- $versions_fileview = new \OC\Files\View('/'.$uid.'/files_versions');
- $versionsRoot = $versions_fileview->getLocalFolder('');
-
- $iterator = new \RecursiveIteratorIterator(
- new \RecursiveDirectoryIterator($versionsRoot),
- \RecursiveIteratorIterator::CHILD_FIRST
- );
+ if (\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED) == 'true') {
+ $view = new \OC\Files\View('/' . $uid . '/files_versions');
$size = 0;
- foreach ($iterator as $path) {
- if ( preg_match('/^.+\.v(\d+)$/', $path, $match) ) {
- $relpath = substr($path, strlen($versionsRoot)-1);
- $size += $versions_fileview->filesize($relpath);
+ $dirContent = $view->getDirectoryContent('/');
+
+ while (!empty($dirContent)) {
+ $path = reset($dirContent);
+ if ($path['type'] === 'dir') {
+ $dirContent = array_merge($dirContent, $view->getDirectoryContent(substr($path['path'], strlen('files_versions'))));
+ } else {
+ $size += $view->filesize(substr($path['path'], strlen('files_versions')));
}
+ unset($dirContent[key($dirContent)]);
}
return $size;
diff --git a/apps/user_ldap/l10n/cs_CZ.php b/apps/user_ldap/l10n/cs_CZ.php
index 306889781c4..b429e41281b 100644
--- a/apps/user_ldap/l10n/cs_CZ.php
+++ b/apps/user_ldap/l10n/cs_CZ.php
@@ -16,6 +16,9 @@ $TRANSLATIONS = array(
"mappings cleared" => "mapování zrušeno",
"Success" => "Úspěch",
"Error" => "Chyba",
+"Configuration OK" => "Konfigurace v pořádku",
+"Configuration incorrect" => "Nesprávná konfigurace",
+"Configuration incomplete" => "Nekompletní konfigurace",
"Select groups" => "Vyberte skupiny",
"Select object classes" => "Výběr objektových tříd",
"Select attributes" => "Výběr atributů",
@@ -26,12 +29,18 @@ $TRANSLATIONS = array(
"_%s group found_::_%s groups found_" => array("nalezena %s skupina","nalezeny %s skupiny","nalezeno %s skupin"),
"_%s user found_::_%s users found_" => array("nalezen %s uživatel","nalezeni %s uživatelé","nalezeno %s uživatelů"),
"Invalid Host" => "Neplatný hostitel",
+"Could not find the desired feature" => "Nelze nalézt požadovanou vlastnost",
"Save" => "Uložit",
"Test Configuration" => "Vyzkoušet nastavení",
"Help" => "Nápověda",
+"Limit the access to %s to groups meeting this criteria:" => "Omezit přístup k %s uživatelům splňujícím tyto podmínky:",
"only those object classes:" => "pouze tyto objektové třídy:",
"only from those groups:" => "pouze z těchto skupin:",
+"Edit raw filter instead" => "Edituj filtr přímo",
+"Raw LDAP filter" => "Původní filtr LDAP",
+"The filter specifies which LDAP groups shall have access to the %s instance." => "Filtr určuje, kteří uživatelé LDAP mají mít přístup k %s instanci.",
"groups found" => "nalezené skupiny",
+"What attribute shall be used as login name:" => "Který atribut má být použit jako přihlašovací jméno:",
"LDAP Username:" => "LDAP uživatelské jméno",
"LDAP Email Address:" => "LDAP e-mailová adresa:",
"Other Attributes:" => "Další atributy",
@@ -46,6 +55,7 @@ $TRANSLATIONS = array(
"One Base DN per line" => "Jedna základní DN na řádku",
"You can specify Base DN for users and groups in the Advanced tab" => "V rozšířeném nastavení můžete určit základní DN pro uživatele a skupiny",
"Limit the access to %s to users meeting this criteria:" => "Omezit přístup k %s uživatelům splňujícím tyto podmínky:",
+"The filter specifies which LDAP users shall have access to the %s instance." => "Filtr určuje, kteří uživatelé LDAP mají mít přístup k %s instanci.",
"users found" => "nalezení uživatelé",
"Back" => "Zpět",
"Continue" => "Pokračovat",
diff --git a/apps/user_ldap/l10n/sv.php b/apps/user_ldap/l10n/sv.php
index 2a1a6e46e03..922985e76f0 100644
--- a/apps/user_ldap/l10n/sv.php
+++ b/apps/user_ldap/l10n/sv.php
@@ -4,6 +4,7 @@ $TRANSLATIONS = array(
"Failed to delete the server configuration" => "Misslyckades med att radera serverinställningen",
"The configuration is valid and the connection could be established!" => "Inställningen är giltig och anslutningen kunde upprättas!",
"The configuration is valid, but the Bind failed. Please check the server settings and credentials." => "Konfigurationen är riktig, men Bind felade. Var vänlig och kontrollera serverinställningar och logininformation.",
+"The configuration is invalid. Please have a look at the logs for further details." => "Inställningen är ogiltig. Vänligen se ownCloud-loggen för fler detaljer.",
"No action specified" => "Ingen åtgärd har angetts",
"No configuration specified" => "Ingen konfiguration har angetts",
"No data specified" => "Ingen data har angetts",
@@ -15,6 +16,9 @@ $TRANSLATIONS = array(
"mappings cleared" => "mappningar rensade",
"Success" => "Lyckat",
"Error" => "Fel",
+"Configuration OK" => "Konfigurationen är OK",
+"Configuration incorrect" => "Felaktig konfiguration",
+"Configuration incomplete" => "Konfigurationen är ej komplett",
"Select groups" => "Välj grupper",
"Select object classes" => "Välj Objekt-klasser",
"Select attributes" => "Välj attribut",