diff options
author | Robin Appelman <icewind@owncloud.com> | 2013-10-29 00:26:35 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2013-10-29 00:26:35 +0100 |
commit | e273c14540ed9bbf65d68e0847447466315268f8 (patch) | |
tree | 97b32780a84b820604314b3fc3cc283f1b9118a2 /lib/private/files/cache | |
parent | f1e6e80eb1be9a6ef4e96e1e6c4a3e838bbd69db (diff) | |
download | nextcloud-server-e273c14540ed9bbf65d68e0847447466315268f8.tar.gz nextcloud-server-e273c14540ed9bbf65d68e0847447466315268f8.zip |
use the new home storage backend when no existing local storage backend exists for the user's home
Diffstat (limited to 'lib/private/files/cache')
-rw-r--r-- | lib/private/files/cache/storage.php | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/private/files/cache/storage.php b/lib/private/files/cache/storage.php index 8a9e47ca36d..5657cf06e12 100644 --- a/lib/private/files/cache/storage.php +++ b/lib/private/files/cache/storage.php @@ -48,7 +48,7 @@ class Storage { } public static function getStorageId($numericId) { - + $sql = 'SELECT `id` FROM `*PREFIX*storages` WHERE `numeric_id` = ?'; $result = \OC_DB::executeAudited($sql, array($numericId)); if ($row = $result->fetchRow()) { @@ -57,4 +57,17 @@ class Storage { return null; } } + + public static function exists($storageId) { + if (strlen($storageId) > 64) { + $storageId = md5($storageId); + } + $sql = 'SELECT `numeric_id` FROM `*PREFIX*storages` WHERE `id` = ?'; + $result = \OC_DB::executeAudited($sql, array($storageId)); + if ($row = $result->fetchRow()) { + return true; + } else { + return false; + } + } } |