diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/l10n/da.php | 1 | ||||
-rw-r--r-- | lib/l10n/de.php | 3 | ||||
-rw-r--r-- | lib/l10n/de_DE.php | 3 | ||||
-rw-r--r-- | lib/l10n/en_GB.php | 3 | ||||
-rw-r--r-- | lib/l10n/es.php | 3 | ||||
-rw-r--r-- | lib/l10n/fi_FI.php | 3 | ||||
-rw-r--r-- | lib/l10n/fr.php | 3 | ||||
-rw-r--r-- | lib/l10n/gl.php | 3 | ||||
-rw-r--r-- | lib/l10n/it.php | 3 | ||||
-rw-r--r-- | lib/l10n/nl.php | 3 | ||||
-rw-r--r-- | lib/l10n/pt_BR.php | 3 | ||||
-rw-r--r-- | lib/l10n/tr.php | 3 | ||||
-rw-r--r-- | lib/private/files/storage/temporary.php | 4 | ||||
-rw-r--r-- | lib/private/files/view.php | 20 | ||||
-rw-r--r-- | lib/private/legacy/preferences.php | 8 | ||||
-rw-r--r-- | lib/private/preferences.php | 40 |
16 files changed, 69 insertions, 37 deletions
diff --git a/lib/l10n/da.php b/lib/l10n/da.php index 2550b60da29..7b0968ddacd 100644 --- a/lib/l10n/da.php +++ b/lib/l10n/da.php @@ -51,6 +51,7 @@ $TRANSLATIONS = array( "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Din webserver er endnu ikke sat op til at tillade fil synkronisering fordi WebDAV grænsefladen virker ødelagt.", "Please double check the <a href='%s'>installation guides</a>." => "Dobbelttjek venligst <a href='%s'>installations vejledningerne</a>.", "%s shared »%s« with you" => "%s delte »%s« med sig", +"You are not allowed to share %s" => "Du har ikke tilladelse til at dele %s", "Could not find category \"%s\"" => "Kunne ikke finde kategorien \"%s\"", "seconds ago" => "sekunder siden", "_%n minute ago_::_%n minutes ago_" => array("%n minut siden","%n minutter siden"), diff --git a/lib/l10n/de.php b/lib/l10n/de.php index a62d6b2aa75..717f2d4a202 100644 --- a/lib/l10n/de.php +++ b/lib/l10n/de.php @@ -88,6 +88,7 @@ $TRANSLATIONS = array( "Only the following characters are allowed in a username: \"a-z\", \"A-Z\", \"0-9\", and \"_.@-\"" => "Folgende Zeichen sind im Benutzernamen erlaubt: \"a-z\", \"A-Z\", \"0-9\" und \"_.@-\"", "A valid username must be provided" => "Es muss ein gültiger Benutzername angegeben werden", "A valid password must be provided" => "Es muss ein gültiges Passwort angegeben werden", -"The username is already being used" => "Dieser Benutzername existiert bereits" +"The username is already being used" => "Dieser Benutzername existiert bereits", +"Could not obtain lock type %d on \"%s\"." => "Sperrtyp %d auf \"%s\" konnte nicht ermittelt werden." ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/de_DE.php b/lib/l10n/de_DE.php index da3280ce05c..43aa537f278 100644 --- a/lib/l10n/de_DE.php +++ b/lib/l10n/de_DE.php @@ -88,6 +88,7 @@ $TRANSLATIONS = array( "Only the following characters are allowed in a username: \"a-z\", \"A-Z\", \"0-9\", and \"_.@-\"" => "Folgende Zeichen sind im Benutzernamen erlaubt: \"a-z\", \"A-Z\", \"0-9\" und \"_.@-\"", "A valid username must be provided" => "Es muss ein gültiger Benutzername angegeben werden", "A valid password must be provided" => "Es muss ein gültiges Passwort angegeben werden", -"The username is already being used" => "Der Benutzername existiert bereits" +"The username is already being used" => "Der Benutzername existiert bereits", +"Could not obtain lock type %d on \"%s\"." => "Sperrtyp %d auf \"%s\" konnte nicht ermittelt werden." ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/en_GB.php b/lib/l10n/en_GB.php index 0d0be27fe62..f5b5e419ffc 100644 --- a/lib/l10n/en_GB.php +++ b/lib/l10n/en_GB.php @@ -88,6 +88,7 @@ $TRANSLATIONS = array( "Only the following characters are allowed in a username: \"a-z\", \"A-Z\", \"0-9\", and \"_.@-\"" => "Only the following characters are allowed in a username: \"a-z\", \"A-Z\", \"0-9\", and \"_.@-\"", "A valid username must be provided" => "A valid username must be provided", "A valid password must be provided" => "A valid password must be provided", -"The username is already being used" => "The username is already being used" +"The username is already being used" => "The username is already being used", +"Could not obtain lock type %d on \"%s\"." => "Could not obtain lock type %d on \"%s\"." ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/es.php b/lib/l10n/es.php index 9e30f78f9d6..bbeaa2ed860 100644 --- a/lib/l10n/es.php +++ b/lib/l10n/es.php @@ -88,6 +88,7 @@ $TRANSLATIONS = array( "Only the following characters are allowed in a username: \"a-z\", \"A-Z\", \"0-9\", and \"_.@-\"" => "Solo los siguientes caracteres están permitidos en un nombre de usuario: \"a-z\", \"A-Z\", \"0-9\", and \"_.@-\"", "A valid username must be provided" => "Se debe proporcionar un nombre de usuario válido", "A valid password must be provided" => "Se debe proporcionar una contraseña válida", -"The username is already being used" => "El nombre de usuario ya está en uso" +"The username is already being used" => "El nombre de usuario ya está en uso", +"Could not obtain lock type %d on \"%s\"." => "No se pudo realizar el bloqueo %d en \"%s\"." ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/fi_FI.php b/lib/l10n/fi_FI.php index 15f6d8563d6..98abf68fc7b 100644 --- a/lib/l10n/fi_FI.php +++ b/lib/l10n/fi_FI.php @@ -75,6 +75,7 @@ $TRANSLATIONS = array( "Only the following characters are allowed in a username: \"a-z\", \"A-Z\", \"0-9\", and \"_.@-\"" => "Vain seuraavat merkit ovat sallittuja käyttäjätunnuksessa: \"a-z\", \"A-Z\", \"0-9\" ja \"_.@-\"", "A valid username must be provided" => "Anna kelvollinen käyttäjätunnus", "A valid password must be provided" => "Anna kelvollinen salasana", -"The username is already being used" => "Käyttäjätunnus on jo käytössä" +"The username is already being used" => "Käyttäjätunnus on jo käytössä", +"Could not obtain lock type %d on \"%s\"." => "Lukitustapaa %d ei saatu kohteelle \"%s\"." ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/fr.php b/lib/l10n/fr.php index 1f05c1cff89..77ced81db86 100644 --- a/lib/l10n/fr.php +++ b/lib/l10n/fr.php @@ -88,6 +88,7 @@ $TRANSLATIONS = array( "Only the following characters are allowed in a username: \"a-z\", \"A-Z\", \"0-9\", and \"_.@-\"" => "Seuls les caractères suivants sont autorisés dans un nom d'utilisateur : \"a-z\", \"A-Z\", \"0-9\", et \"_.@-\"", "A valid username must be provided" => "Un nom d'utilisateur valide doit être saisi", "A valid password must be provided" => "Un mot de passe valide doit être saisi", -"The username is already being used" => "Le nom d'utilisateur est déjà utilisé" +"The username is already being used" => "Le nom d'utilisateur est déjà utilisé", +"Could not obtain lock type %d on \"%s\"." => "Impossible d'obtenir le verrouillage de type %d sur \"%s\"." ); $PLURAL_FORMS = "nplurals=2; plural=(n > 1);"; diff --git a/lib/l10n/gl.php b/lib/l10n/gl.php index 3a04e167ce7..46ab6a9edf9 100644 --- a/lib/l10n/gl.php +++ b/lib/l10n/gl.php @@ -88,6 +88,7 @@ $TRANSLATIONS = array( "Only the following characters are allowed in a username: \"a-z\", \"A-Z\", \"0-9\", and \"_.@-\"" => "Só se permiten os seguintes caracteres no nome de usuario: «a-z», «A-Z», «0-9», e «_.@-»", "A valid username must be provided" => "Debe fornecer un nome de usuario", "A valid password must be provided" => "Debe fornecer un contrasinal", -"The username is already being used" => "Este nome de usuario xa está a ser usado" +"The username is already being used" => "Este nome de usuario xa está a ser usado", +"Could not obtain lock type %d on \"%s\"." => "Non foi posíbel obter un bloqueo do tipo %d en «%s»." ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/it.php b/lib/l10n/it.php index c7948cab3e9..06210bcb3cc 100644 --- a/lib/l10n/it.php +++ b/lib/l10n/it.php @@ -88,6 +88,7 @@ $TRANSLATIONS = array( "Only the following characters are allowed in a username: \"a-z\", \"A-Z\", \"0-9\", and \"_.@-\"" => "Solo i seguenti caratteri sono ammessi in un nome utente: \"a-z\", \"A-Z\", \"0-9\", e \"_.@-\"", "A valid username must be provided" => "Deve essere fornito un nome utente valido", "A valid password must be provided" => "Deve essere fornita una password valida", -"The username is already being used" => "Il nome utente è già utilizzato" +"The username is already being used" => "Il nome utente è già utilizzato", +"Could not obtain lock type %d on \"%s\"." => "Impossibile ottenere il blocco di tipo %d su \"%s\"." ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/nl.php b/lib/l10n/nl.php index 53b7ccea792..e41d71822a1 100644 --- a/lib/l10n/nl.php +++ b/lib/l10n/nl.php @@ -88,6 +88,7 @@ $TRANSLATIONS = array( "Only the following characters are allowed in a username: \"a-z\", \"A-Z\", \"0-9\", and \"_.@-\"" => "Alleen de volgende tekens zijn toegestaan in een gebruikersnaam: \"a-z\", \"A-Z\", \"0-9\", and \"_.@-\"", "A valid username must be provided" => "Er moet een geldige gebruikersnaam worden opgegeven", "A valid password must be provided" => "Er moet een geldig wachtwoord worden opgegeven", -"The username is already being used" => "De gebruikersnaam bestaat al" +"The username is already being used" => "De gebruikersnaam bestaat al", +"Could not obtain lock type %d on \"%s\"." => "Kon geen lock type %d krijgen op \"%s\"." ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/pt_BR.php b/lib/l10n/pt_BR.php index a112b5b5cc0..df4fbaec324 100644 --- a/lib/l10n/pt_BR.php +++ b/lib/l10n/pt_BR.php @@ -88,6 +88,7 @@ $TRANSLATIONS = array( "Only the following characters are allowed in a username: \"a-z\", \"A-Z\", \"0-9\", and \"_.@-\"" => "Somente os seguintes caracteres são permitidos no nome do usuário: \"a-z\", \"A-Z\", \"0-9\", e \"_.@-\"", "A valid username must be provided" => "Forneça um nome de usuário válido", "A valid password must be provided" => "Forneça uma senha válida", -"The username is already being used" => "Este nome de usuário já está sendo usado" +"The username is already being used" => "Este nome de usuário já está sendo usado", +"Could not obtain lock type %d on \"%s\"." => "Não foi possível obter tipo de bloqueio %d em \"%s\"." ); $PLURAL_FORMS = "nplurals=2; plural=(n > 1);"; diff --git a/lib/l10n/tr.php b/lib/l10n/tr.php index 81ff6dd8a2c..4a845826461 100644 --- a/lib/l10n/tr.php +++ b/lib/l10n/tr.php @@ -88,6 +88,7 @@ $TRANSLATIONS = array( "Only the following characters are allowed in a username: \"a-z\", \"A-Z\", \"0-9\", and \"_.@-\"" => "Kullanıcı adında sadece bu karakterlere izin verilmektedir: \"a-z\", \"A-Z\", \"0-9\", ve \"_.@-\"", "A valid username must be provided" => "Geçerli bir kullanıcı adı mutlaka sağlanmalı", "A valid password must be provided" => "Geçerli bir parola mutlaka sağlanmalı", -"The username is already being used" => "Bu kullanıcı adı zaten kullanımda" +"The username is already being used" => "Bu kullanıcı adı zaten kullanımda", +"Could not obtain lock type %d on \"%s\"." => "\"%s\" üzerinde %d kilit türü edinilemedi." ); $PLURAL_FORMS = "nplurals=2; plural=(n > 1);"; diff --git a/lib/private/files/storage/temporary.php b/lib/private/files/storage/temporary.php index d84dbda2e39..7547640f175 100644 --- a/lib/private/files/storage/temporary.php +++ b/lib/private/files/storage/temporary.php @@ -24,4 +24,8 @@ class Temporary extends Local{ parent::__destruct(); $this->cleanUp(); } + + public function getDataDir() { + return $this->datadir; + } } diff --git a/lib/private/files/view.php b/lib/private/files/view.php index 09b100d7cfd..1dc6c405bcf 100644 --- a/lib/private/files/view.php +++ b/lib/private/files/view.php @@ -359,7 +359,8 @@ class View { $absolutePath = Filesystem::normalizePath($this->getAbsolutePath($path)); list($storage, $internalPath) = Filesystem::resolvePath($absolutePath . $postFix); if (!($storage instanceof \OC\Files\Storage\Shared) && - (!$internalPath || $internalPath === '' || $internalPath === '/')) { + (!$internalPath || $internalPath === '' || $internalPath === '/') + ) { // do not allow deleting the storage's root / the mount point // because for some storages it might delete the whole contents // but isn't supposed to work that way @@ -678,6 +679,7 @@ class View { /** * abstraction layer for basic filesystem functions: wrapper for \OC\Files\Storage\Storage + * * @param string $operation * @param string $path * @param array $hooks (optional) @@ -1125,7 +1127,7 @@ class View { * Note that the resulting path is not guarantied to be unique for the id, multiple paths can point to the same file * * @param int $id - * @return string + * @return string|null */ public function getPath($id) { $manager = Filesystem::getMountManager(); @@ -1138,12 +1140,14 @@ class View { /** * @var \OC\Files\Mount\Mount $mount */ - $cache = $mount->getStorage()->getCache(); - $internalPath = $cache->getPathById($id); - if (is_string($internalPath)) { - $fullPath = $mount->getMountPoint() . $internalPath; - if (!is_null($path = $this->getRelativePath($fullPath))) { - return $path; + if ($mount->getStorage()) { + $cache = $mount->getStorage()->getCache(); + $internalPath = $cache->getPathById($id); + if (is_string($internalPath)) { + $fullPath = $mount->getMountPoint() . $internalPath; + if (!is_null($path = $this->getRelativePath($fullPath))) { + return $path; + } } } } diff --git a/lib/private/legacy/preferences.php b/lib/private/legacy/preferences.php index 71d0b749f43..060274085fe 100644 --- a/lib/private/legacy/preferences.php +++ b/lib/private/legacy/preferences.php @@ -84,14 +84,14 @@ class OC_Preferences{ * @param string $app app * @param string $key key * @param string $value value - * @return bool + * @param string $preCondition only set value if the key had a specific value before + * @return bool true if value was set, otherwise false * * Adds a value to the preferences. If the key did not exist before, it * will be added automagically. */ - public static function setValue( $user, $app, $key, $value ) { - self::$object->setValue( $user, $app, $key, $value ); - return true; + public static function setValue( $user, $app, $key, $value, $preCondition = null ) { + return self::$object->setValue( $user, $app, $key, $value, $preCondition ); } /** diff --git a/lib/private/preferences.php b/lib/private/preferences.php index 0dc5b26810a..d1db25bbf09 100644 --- a/lib/private/preferences.php +++ b/lib/private/preferences.php @@ -165,44 +165,56 @@ class Preferences { * @param string $app app * @param string $key key * @param string $value value + * @param string $preCondition only set value if the key had a specific value before + * @return bool true if value was set, otherwise false * * Adds a value to the preferences. If the key did not exist before, it * will be added automagically. */ - public function setValue($user, $app, $key, $value) { + public function setValue($user, $app, $key, $value, $preCondition = null) { // Check if the key does exist $query = 'SELECT COUNT(*) FROM `*PREFIX*preferences`' . ' WHERE `userid` = ? AND `appid` = ? AND `configkey` = ?'; $count = $this->conn->fetchColumn($query, array($user, $app, $key)); $exists = $count > 0; - if (!$exists) { + $affectedRows = 0; + + if (!$exists && $preCondition === null) { $data = array( 'userid' => $user, 'appid' => $app, 'configkey' => $key, 'configvalue' => $value, ); - $this->conn->insert('*PREFIX*preferences', $data); - } else { - $data = array( - 'configvalue' => $value, - ); - $where = array( - 'userid' => $user, - 'appid' => $app, - 'configkey' => $key, - ); - $this->conn->update('*PREFIX*preferences', $data, $where); + $affectedRows = $this->conn->insert('*PREFIX*preferences', $data); + } elseif ($exists) { + $data = array($value, $user, $app, $key); + $sql = "UPDATE `*PREFIX*preferences` SET `configvalue` = ?" + . " WHERE `userid` = ? AND `appid` = ? AND `configkey` = ?"; + + if ($preCondition !== null) { + if (\OC_Config::getValue( 'dbtype', 'sqlite' ) === 'oci') { + //oracle hack: need to explicitly cast CLOB to CHAR for comparison + $sql .= " AND to_char(`configvalue`) = ?"; + } else { + $sql .= " AND `configvalue` = ?"; + } + $data[] = $preCondition; + } + $affectedRows = $this->conn->executeUpdate($sql, $data); } // only add to the cache if we already loaded data for the user - if (isset($this->cache[$user])) { + if ($affectedRows > 0 && isset($this->cache[$user])) { if (!isset($this->cache[$user][$app])) { $this->cache[$user][$app] = array(); } $this->cache[$user][$app][$key] = $value; } + + return ($affectedRows > 0) ? true : false; + } /** |