aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/base.php4
-rw-r--r--lib/l10n/fr.php1
-rw-r--r--lib/private/db/adapter.php11
-rw-r--r--lib/private/db/adaptersqlite.php14
-rw-r--r--lib/private/files/objectstore/objectstorestorage.php38
-rw-r--r--lib/private/share/mailnotifications.php2
6 files changed, 29 insertions, 41 deletions
diff --git a/lib/base.php b/lib/base.php
index fb445124011..5d52db68cb7 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -554,7 +554,9 @@ class OC {
OC_Group::useBackend(new OC_Group_Database());
//setup extra user backends
- OC_User::setupBackends();
+ if (!self::checkUpgrade(false)) {
+ OC_User::setupBackends();
+ }
self::registerCacheHooks();
self::registerFilesystemHooks();
diff --git a/lib/l10n/fr.php b/lib/l10n/fr.php
index ae49d583336..3f1fe6a9925 100644
--- a/lib/l10n/fr.php
+++ b/lib/l10n/fr.php
@@ -97,6 +97,7 @@ $TRANSLATIONS = array(
"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 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/private/db/adapter.php b/lib/private/db/adapter.php
index 975b9432286..6742ccdbb45 100644
--- a/lib/private/db/adapter.php
+++ b/lib/private/db/adapter.php
@@ -51,13 +51,18 @@ class Adapter {
. str_repeat('?,', count($input)-1).'? ' // Is there a prettier alternative?
. 'FROM `' . $table . '` WHERE ';
+ $inserts = array_values($input);
foreach($input as $key => $value) {
- $query .= '`' . $key . '` = ? AND ';
+ $query .= '`' . $key . '`';
+ if (is_null($value)) {
+ $query .= ' IS NULL AND ';
+ } else {
+ $inserts[] = $value;
+ $query .= ' = ? AND ';
+ }
}
$query = substr($query, 0, strlen($query) - 5);
$query .= ' HAVING COUNT(*) = 0';
- $inserts = array_values($input);
- $inserts = array_merge($inserts, $inserts);
try {
return $this->conn->executeUpdate($query, $inserts);
diff --git a/lib/private/db/adaptersqlite.php b/lib/private/db/adaptersqlite.php
index fa6d308ae32..5b9c5a437da 100644
--- a/lib/private/db/adaptersqlite.php
+++ b/lib/private/db/adaptersqlite.php
@@ -21,13 +21,21 @@ class AdapterSqlite extends Adapter {
// NOTE: For SQLite we have to use this clumsy approach
// otherwise all fieldnames used must have a unique key.
$query = 'SELECT COUNT(*) FROM `' . $table . '` WHERE ';
- foreach($input as $key => $value) {
- $query .= '`' . $key . '` = ? AND ';
+ $inserts = array();
+ foreach ($input as $key => $value) {
+ $query .= '`' . $key . '`';
+ if (is_null($value)) {
+ $query .= ' IS NULL AND ';
+ } else {
+ $inserts[] = $value;
+ $query .= ' = ? AND ';
+ }
}
$query = substr($query, 0, strlen($query) - 5);
+
try {
$stmt = $this->conn->prepare($query);
- $result = $stmt->execute(array_values($input));
+ $result = $stmt->execute($inserts);
} catch(\Doctrine\DBAL\DBALException $e) {
$entry = 'DB Error: "'.$e->getMessage() . '"<br />';
$entry .= 'Offending command was: ' . $query . '<br />';
diff --git a/lib/private/files/objectstore/objectstorestorage.php b/lib/private/files/objectstore/objectstorestorage.php
index 0292d777064..241864bcccd 100644
--- a/lib/private/files/objectstore/objectstorestorage.php
+++ b/lib/private/files/objectstore/objectstorestorage.php
@@ -82,7 +82,7 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common {
$parentExists = true;
// we are done when the root folder was meant to be created
- if ($dirName === $path) {
+ if ($dirName === $path) {
return true;
}
}
@@ -290,38 +290,10 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common {
public function rename($source, $target) {
$source = $this->normalizePath($source);
$target = $this->normalizePath($target);
- $stat1 = $this->stat($source);
- if (isset($stat1['mimetype']) && $stat1['mimetype'] === 'httpd/unix-directory') {
- $this->remove($target);
- $dir = $this->opendir($source);
- $this->mkdir($target);
- while ($file = readdir($dir)) {
- if (!Filesystem::isIgnoredDir($file)) {
- if (!$this->rename($source . '/' . $file, $target . '/' . $file)) {
- return false;
- }
- }
- }
- closedir($dir);
- $this->remove($source);
- return true;
- } else {
- if (is_array($stat1)) {
- $parent = $this->stat(dirname($target));
- if (is_array($parent)) {
- $this->remove($target);
- $stat1['parent'] = $parent['fileid'];
- $stat1['path'] = $target;
- $stat1['path_hash'] = md5($target);
- $stat1['name'] = \OC_Util::basename($target);
- $stat1['mtime'] = time();
- $stat1['etag'] = $this->getETag($target);
- $this->getCache()->update($stat1['fileid'], $stat1);
- return true;
- }
- }
- }
- return false;
+ $this->remove($target);
+ $this->getCache()->move($source, $target);
+ $this->touch(dirname($target));
+ return true;
}
public function getMimeType($path) {
diff --git a/lib/private/share/mailnotifications.php b/lib/private/share/mailnotifications.php
index 4a92503bdd3..2f704fb2b3c 100644
--- a/lib/private/share/mailnotifications.php
+++ b/lib/private/share/mailnotifications.php
@@ -52,7 +52,7 @@ class MailNotifications {
* @param string $sender user id (if nothing is set we use the currently logged-in user)
*/
public function __construct($sender = null) {
- $this->l = \OC::$server->getL10N('core');
+ $this->l = \OC::$server->getL10N('lib');
$this->senderId = $sender;