aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/files_encryption/ajax/changeRecoveryPassword.php2
-rw-r--r--apps/files_encryption/ajax/getMigrationStatus.php2
-rw-r--r--apps/files_encryption/ajax/userrecovery.php2
-rw-r--r--apps/files_encryption/appinfo/app.php2
-rw-r--r--apps/files_encryption/hooks/hooks.php20
-rwxr-xr-xapps/files_encryption/lib/helper.php4
-rwxr-xr-xapps/files_encryption/lib/keymanager.php44
-rw-r--r--apps/files_encryption/lib/proxy.php10
-rw-r--r--apps/files_encryption/lib/session.php2
-rw-r--r--apps/files_encryption/lib/stream.php2
-rw-r--r--apps/files_encryption/lib/util.php8
-rw-r--r--apps/files_encryption/settings-personal.php2
-rwxr-xr-xapps/files_encryption/tests/crypt.php8
-rw-r--r--apps/files_encryption/tests/hooks.php8
-rw-r--r--apps/files_encryption/tests/keymanager.php6
-rw-r--r--apps/files_encryption/tests/proxy.php6
-rwxr-xr-xapps/files_encryption/tests/share.php8
-rw-r--r--apps/files_encryption/tests/stream.php4
-rwxr-xr-xapps/files_encryption/tests/trashbin.php4
-rwxr-xr-xapps/files_encryption/tests/util.php12
-rwxr-xr-xapps/files_encryption/tests/webdav.php4
-rw-r--r--apps/files_sharing/tests/base.php4
-rw-r--r--apps/files_sharing/tests/cache.php2
-rw-r--r--apps/files_trashbin/lib/trashbin.php6
-rw-r--r--lib/private/files/view.php2
-rw-r--r--lib/private/legacy/filesystemview.php9
-rw-r--r--settings/ajax/decryptall.php2
-rw-r--r--settings/changepassword/controller.php2
28 files changed, 89 insertions, 98 deletions
diff --git a/apps/files_encryption/ajax/changeRecoveryPassword.php b/apps/files_encryption/ajax/changeRecoveryPassword.php
index 945f054ea84..f020e52607d 100644
--- a/apps/files_encryption/ajax/changeRecoveryPassword.php
+++ b/apps/files_encryption/ajax/changeRecoveryPassword.php
@@ -23,7 +23,7 @@ $oldPassword = $_POST['oldPassword'];
$newPassword = $_POST['newPassword'];
$view = new \OC\Files\View('/');
-$util = new \OCA\Encryption\Util(new \OC_FilesystemView('/'), \OCP\User::getUser());
+$util = new \OCA\Encryption\Util(new \OC\Files\View('/'), \OCP\User::getUser());
$proxyStatus = \OC_FileProxy::$enabled;
\OC_FileProxy::$enabled = false;
diff --git a/apps/files_encryption/ajax/getMigrationStatus.php b/apps/files_encryption/ajax/getMigrationStatus.php
index 7c9e0dcc51c..a8828401934 100644
--- a/apps/files_encryption/ajax/getMigrationStatus.php
+++ b/apps/files_encryption/ajax/getMigrationStatus.php
@@ -18,7 +18,7 @@ $migrationStatus = Util::MIGRATION_COMPLETED;
if ($loginname !== '' && $password !== '') {
$username = \OCP\User::checkPassword($loginname, $password);
if ($username) {
- $util = new Util(new \OC_FilesystemView('/'), $username);
+ $util = new Util(new \OC\Files\View('/'), $username);
$migrationStatus = $util->getMigrationStatus();
}
}
diff --git a/apps/files_encryption/ajax/userrecovery.php b/apps/files_encryption/ajax/userrecovery.php
index d6c94bde81e..81ca1459a91 100644
--- a/apps/files_encryption/ajax/userrecovery.php
+++ b/apps/files_encryption/ajax/userrecovery.php
@@ -19,7 +19,7 @@ if (
) {
$userId = \OCP\USER::getUser();
- $view = new \OC_FilesystemView('/');
+ $view = new \OC\Files\View('/');
$util = new \OCA\Encryption\Util($view, $userId);
// Save recovery preference to DB
diff --git a/apps/files_encryption/appinfo/app.php b/apps/files_encryption/appinfo/app.php
index 21de421c195..104e8568caa 100644
--- a/apps/files_encryption/appinfo/app.php
+++ b/apps/files_encryption/appinfo/app.php
@@ -40,7 +40,7 @@ if (!OC_Config::getValue('maintenance', false)) {
\OC_Util::setupFS();
}
- $view = new OC_FilesystemView('/');
+ $view = new OC\Files\View('/');
$sessionReady = OCA\Encryption\Helper::checkRequirements();
if($sessionReady) {
diff --git a/apps/files_encryption/hooks/hooks.php b/apps/files_encryption/hooks/hooks.php
index 5f0494e62ca..c9ffeb454a1 100644
--- a/apps/files_encryption/hooks/hooks.php
+++ b/apps/files_encryption/hooks/hooks.php
@@ -48,7 +48,7 @@ class Hooks {
$l = new \OC_L10N('files_encryption');
- $view = new \OC_FilesystemView('/');
+ $view = new \OC\Files\View('/');
// ensure filesystem is loaded
if(!\OC\Files\Filesystem::$loaded) {
@@ -93,7 +93,7 @@ class Hooks {
// If migration not yet done
if ($ready) {
- $userView = new \OC_FilesystemView('/' . $params['uid']);
+ $userView = new \OC\Files\View('/' . $params['uid']);
// Set legacy encryption key if it exists, to support
// depreciated encryption system
@@ -142,7 +142,7 @@ class Hooks {
public static function postCreateUser($params) {
if (\OCP\App::isEnabled('files_encryption')) {
- $view = new \OC_FilesystemView('/');
+ $view = new \OC\Files\View('/');
$util = new Util($view, $params['uid']);
Helper::setupUser($util, $params['password']);
}
@@ -155,7 +155,7 @@ class Hooks {
public static function postDeleteUser($params) {
if (\OCP\App::isEnabled('files_encryption')) {
- $view = new \OC_FilesystemView('/');
+ $view = new \OC\Files\View('/');
// cleanup public key
$publicKey = '/public-keys/' . $params['uid'] . '.public.key';
@@ -196,7 +196,7 @@ class Hooks {
// the necessary keys)
if (Crypt::mode() === 'server') {
- $view = new \OC_FilesystemView('/');
+ $view = new \OC\Files\View('/');
if ($params['uid'] === \OCP\User::getUser()) {
@@ -308,7 +308,7 @@ class Hooks {
if ($params['itemType'] === 'file' || $params['itemType'] === 'folder') {
- $view = new \OC_FilesystemView('/');
+ $view = new \OC\Files\View('/');
$session = new \OCA\Encryption\Session($view);
$userId = \OCP\User::getUser();
$util = new Util($view, $userId);
@@ -350,7 +350,7 @@ class Hooks {
if ($params['itemType'] === 'file' || $params['itemType'] === 'folder') {
- $view = new \OC_FilesystemView('/');
+ $view = new \OC\Files\View('/');
$userId = \OCP\User::getUser();
$util = new Util($view, $userId);
$path = \OC\Files\Filesystem::getPath($params['fileSource']);
@@ -403,7 +403,7 @@ class Hooks {
*/
public static function preRename($params) {
$user = \OCP\User::getUser();
- $view = new \OC_FilesystemView('/');
+ $view = new \OC\Files\View('/');
$util = new Util($view, $user);
list($ownerOld, $pathOld) = $util->getUidAndFilename($params['oldpath']);
@@ -437,7 +437,7 @@ class Hooks {
$proxyStatus = \OC_FileProxy::$enabled;
\OC_FileProxy::$enabled = false;
- $view = new \OC_FilesystemView('/');
+ $view = new \OC\Files\View('/');
$session = new \OCA\Encryption\Session($view);
$userId = \OCP\User::getUser();
$util = new Util($view, $userId);
@@ -610,7 +610,7 @@ class Hooks {
return true;
}
- $util = new Util(new \OC_FilesystemView('/'), \OCP\USER::getUser());
+ $util = new Util(new \OC\Files\View('/'), \OCP\USER::getUser());
list($owner, $ownerPath) = $util->getUidAndFilename($path);
self::$deleteFiles[$params[\OC\Files\Filesystem::signal_param_path]] = array(
diff --git a/apps/files_encryption/lib/helper.php b/apps/files_encryption/lib/helper.php
index 82a323d5e12..c3a31ff9fbc 100755
--- a/apps/files_encryption/lib/helper.php
+++ b/apps/files_encryption/lib/helper.php
@@ -153,7 +153,7 @@ class Helper {
$return = true;
} else { // get recovery key and check the password
- $util = new \OCA\Encryption\Util(new \OC_FilesystemView('/'), \OCP\User::getUser());
+ $util = new \OCA\Encryption\Util(new \OC\Files\View('/'), \OCP\User::getUser());
$return = $util->checkRecoveryPassword($recoveryPassword);
if ($return) {
$appConfig->setValue('files_encryption', 'recoveryAdminEnabled', 1);
@@ -214,7 +214,7 @@ class Helper {
* @return bool
*/
public static function adminDisableRecovery($recoveryPassword) {
- $util = new Util(new \OC_FilesystemView('/'), \OCP\User::getUser());
+ $util = new Util(new \OC\Files\View('/'), \OCP\User::getUser());
$return = $util->checkRecoveryPassword($recoveryPassword);
if ($return) {
diff --git a/apps/files_encryption/lib/keymanager.php b/apps/files_encryption/lib/keymanager.php
index cb9f5e64af3..5aa8a6ab06e 100755
--- a/apps/files_encryption/lib/keymanager.php
+++ b/apps/files_encryption/lib/keymanager.php
@@ -32,12 +32,12 @@ class Keymanager {
/**
* @brief retrieve the ENCRYPTED private key from a user
*
- * @param \OC_FilesystemView $view
+ * @param \OC\Files\View $view
* @param string $user
* @return string private key or false (hopefully)
* @note the key returned by this method must be decrypted before use
*/
- public static function getPrivateKey(\OC_FilesystemView $view, $user) {
+ public static function getPrivateKey(\OC\Files\View $view, $user) {
$path = '/' . $user . '/' . 'files_encryption' . '/' . $user . '.private.key';
$key = false;
@@ -56,11 +56,11 @@ class Keymanager {
/**
* @brief retrieve public key for a specified user
- * @param \OC_FilesystemView $view
+ * @param \OC\Files\View $view
* @param $userId
* @return string public key or false
*/
- public static function getPublicKey(\OC_FilesystemView $view, $userId) {
+ public static function getPublicKey(\OC\Files\View $view, $userId) {
$proxyStatus = \OC_FileProxy::$enabled;
\OC_FileProxy::$enabled = false;
@@ -75,11 +75,11 @@ class Keymanager {
/**
* @brief Retrieve a user's public and private key
- * @param \OC_FilesystemView $view
+ * @param \OC\Files\View $view
* @param $userId
* @return array keys: privateKey, publicKey
*/
- public static function getUserKeys(\OC_FilesystemView $view, $userId) {
+ public static function getUserKeys(\OC\Files\View $view, $userId) {
return array(
'publicKey' => self::getPublicKey($view, $userId),
@@ -90,11 +90,11 @@ class Keymanager {
/**
* @brief Retrieve public keys for given users
- * @param \OC_FilesystemView $view
+ * @param \OC\Files\View $view
* @param array $userIds
* @return array of public keys for the specified users
*/
- public static function getPublicKeys(\OC_FilesystemView $view, array $userIds) {
+ public static function getPublicKeys(\OC\Files\View $view, array $userIds) {
$keys = array();
@@ -111,7 +111,7 @@ class Keymanager {
/**
* @brief store file encryption key
*
- * @param \OC_FilesystemView $view
+ * @param \OC\Files\View $view
* @param \OCA\Encryption\Util $util
* @param string $path relative path of the file, including filename
* @param string $catfile keyfile content
@@ -119,7 +119,7 @@ class Keymanager {
* @note The keyfile is not encrypted here. Client code must
* asymmetrically encrypt the keyfile before passing it to this method
*/
- public static function setFileKey(\OC_FilesystemView $view, $util, $path, $catfile) {
+ public static function setFileKey(\OC\Files\View $view, $util, $path, $catfile) {
$proxyStatus = \OC_FileProxy::$enabled;
\OC_FileProxy::$enabled = false;
@@ -168,7 +168,7 @@ class Keymanager {
/**
* @brief retrieve keyfile for an encrypted file
- * @param \OC_FilesystemView $view
+ * @param \OC\Files\View $view
* @param \OCA\Encryption\Util $util
* @param string|false $filePath
* @internal param \OCA\Encryption\file $string name
@@ -212,7 +212,7 @@ class Keymanager {
/**
* @brief Delete a keyfile
*
- * @param \OC_FilesystemView $view
+ * @param \OC\Files\View $view
* @param string $path path of the file the key belongs to
* @param string $userId the user to whom the file belongs
* @return bool Outcome of unlink operation
@@ -276,7 +276,7 @@ class Keymanager {
$user = \OCP\User::getUser();
- $view = new \OC_FilesystemView('/' . $user . '/files_encryption');
+ $view = new \OC\Files\View('/' . $user . '/files_encryption');
$proxyStatus = \OC_FileProxy::$enabled;
\OC_FileProxy::$enabled = false;
@@ -295,14 +295,14 @@ class Keymanager {
/**
* @brief store share key
*
- * @param \OC_FilesystemView $view
+ * @param \OC\Files\View $view
* @param string $path where the share key is stored
* @param $shareKey
* @return bool true/false
* @note The keyfile is not encrypted here. Client code must
* asymmetrically encrypt the keyfile before passing it to this method
*/
- private static function setShareKey(\OC_FilesystemView $view, $path, $shareKey) {
+ private static function setShareKey(\OC\Files\View $view, $path, $shareKey) {
$proxyStatus = \OC_FileProxy::$enabled;
\OC_FileProxy::$enabled = false;
@@ -320,13 +320,13 @@ class Keymanager {
/**
* @brief store multiple share keys for a single file
- * @param \OC_FilesystemView $view
+ * @param \OC\Files\View $view
* @param \OCA\Encryption\Util $util
* @param string $path
* @param array $shareKeys
* @return bool
*/
- public static function setShareKeys(\OC_FilesystemView $view, $util, $path, array $shareKeys) {
+ public static function setShareKeys(\OC\Files\View $view, $util, $path, array $shareKeys) {
// $shareKeys must be an array with the following format:
// [userId] => [encrypted key]
@@ -366,7 +366,7 @@ class Keymanager {
/**
* @brief retrieve shareKey for an encrypted file
- * @param \OC_FilesystemView $view
+ * @param \OC\Files\View $view
* @param string $userId
* @param \OCA\Encryption\Util $util
* @param string $filePath
@@ -374,7 +374,7 @@ class Keymanager {
* @note The sharekey returned is encrypted. Decryption
* of the keyfile must be performed by client code
*/
- public static function getShareKey(\OC_FilesystemView $view, $userId, $util, $filePath) {
+ public static function getShareKey(\OC\Files\View $view, $userId, $util, $filePath) {
// try reusing key file if part file
$proxyStatus = \OC_FileProxy::$enabled;
@@ -407,7 +407,7 @@ class Keymanager {
/**
* @brief delete all share keys of a given file
- * @param \OC_FilesystemView $view
+ * @param \OC\Files\View $view
* @param string $userId owner of the file
* @param string $filePath path to the file, relative to the owners file dir
*/
@@ -447,7 +447,7 @@ class Keymanager {
/**
* @brief Delete a single user's shareKey for a single file
*/
- public static function delShareKey(\OC_FilesystemView $view, $userIds, $filePath) {
+ public static function delShareKey(\OC\Files\View $view, $userIds, $filePath) {
$proxyStatus = \OC_FileProxy::$enabled;
\OC_FileProxy::$enabled = false;
@@ -516,7 +516,7 @@ class Keymanager {
* @param string|boolean $path
* @param string $basePath
*/
- public static function keySetPreparation(\OC_FilesystemView $view, $path, $basePath, $userId) {
+ public static function keySetPreparation(\OC\Files\View $view, $path, $basePath, $userId) {
$targetPath = ltrim($path, '/');
diff --git a/apps/files_encryption/lib/proxy.php b/apps/files_encryption/lib/proxy.php
index 5dc407f796a..919853107a8 100644
--- a/apps/files_encryption/lib/proxy.php
+++ b/apps/files_encryption/lib/proxy.php
@@ -65,7 +65,7 @@ class Proxy extends \OC_FileProxy {
return false;
}
- $view = new \OC_FilesystemView('');
+ $view = new \OC\Files\View('');
$util = new Util($view, $userId);
// for write operation we always encrypt the files, for read operations
@@ -90,7 +90,7 @@ class Proxy extends \OC_FileProxy {
if (!is_resource($data)) {
// get root view
- $view = new \OC_FilesystemView('/');
+ $view = new \OC\Files\View('/');
// get relative path
$relativePath = \OCA\Encryption\Helper::stripUserFilesPath($path);
@@ -152,7 +152,7 @@ class Proxy extends \OC_FileProxy {
public function postFile_put_contents($path, $result) {
$normalizedPath = \OC\Files\Filesystem::normalizePath($path);
if ( isset(self::$unencryptedSizes[$normalizedPath]) ) {
- $view = new \OC_FilesystemView('/');
+ $view = new \OC\Files\View('/');
$view->putFileInfo($normalizedPath,
array('encrypted' => true, 'unencrypted_size' => self::$unencryptedSizes[$normalizedPath]));
unset(self::$unencryptedSizes[$normalizedPath]);
@@ -168,7 +168,7 @@ class Proxy extends \OC_FileProxy {
public function postFile_get_contents($path, $data) {
$plainData = null;
- $view = new \OC_FilesystemView('/');
+ $view = new \OC\Files\View('/');
// init session
$session = new \OCA\Encryption\Session($view);
@@ -291,7 +291,7 @@ class Proxy extends \OC_FileProxy {
*/
public function postFileSize($path, $size) {
- $view = new \OC_FilesystemView('/');
+ $view = new \OC\Files\View('/');
$userId = Helper::getUser($path);
$util = new Util($view, $userId);
diff --git a/apps/files_encryption/lib/session.php b/apps/files_encryption/lib/session.php
index 3daaa06425f..19b669a27ff 100644
--- a/apps/files_encryption/lib/session.php
+++ b/apps/files_encryption/lib/session.php
@@ -37,7 +37,7 @@ class Session {
/**
* @brief if session is started, check if ownCloud key pair is set up, if not create it
- * @param \OC_FilesystemView $view
+ * @param \OC\Files\View $view
*
* @note The ownCloud key pair is used to allow public link sharing even if encryption is enabled
*/
diff --git a/apps/files_encryption/lib/stream.php b/apps/files_encryption/lib/stream.php
index df5de558867..8b575174e2e 100644
--- a/apps/files_encryption/lib/stream.php
+++ b/apps/files_encryption/lib/stream.php
@@ -91,7 +91,7 @@ class Stream {
$this->newFile = false;
if (!isset($this->rootView)) {
- $this->rootView = new \OC_FilesystemView('/');
+ $this->rootView = new \OC\Files\View('/');
}
$this->session = new \OCA\Encryption\Session($this->rootView);
diff --git a/apps/files_encryption/lib/util.php b/apps/files_encryption/lib/util.php
index fb0067171ee..37fdcaceaa5 100644
--- a/apps/files_encryption/lib/util.php
+++ b/apps/files_encryption/lib/util.php
@@ -26,7 +26,7 @@ namespace OCA\Encryption;
/**
* @brief Class for utilities relating to encrypted file storage system
- * @param \OC_FilesystemView $view expected to have OC '/' as root path
+ * @param \OC\Files\View $view expected to have OC '/' as root path
* @param string $userId ID of the logged in user
* @param int $client indicating status of client side encryption. Currently
* unused, likely to become obsolete shortly
@@ -38,7 +38,7 @@ class Util {
const MIGRATION_IN_PROGRESS = -1; // migration is running
const MIGRATION_OPEN = 0; // user still needs to be migrated
- private $view; // OC_FilesystemView object for filesystem operations
+ private $view; // OC\Files\View object for filesystem operations
private $userId; // ID of the user we use to encrypt/decrypt files
private $keyId; // ID of the key we want to manipulate
private $client; // Client side encryption mode flag
@@ -53,7 +53,7 @@ class Util {
private $isPublic;
/**
- * @param \OC_FilesystemView $view
+ * @param \OC\Files\View $view
* @param $userId
* @param bool $client
*/
@@ -1522,7 +1522,7 @@ class Util {
if ($item['type'] === 'dir') {
$this->addRecoveryKeys($filePath . '/');
} else {
- $session = new \OCA\Encryption\Session(new \OC_FilesystemView('/'));
+ $session = new \OCA\Encryption\Session(new \OC\Files\View('/'));
$sharingEnabled = \OCP\Share::isEnabled();
// remove '.key' extension from path e.g. 'file.txt.key' to 'file.txt'
$file = substr($filePath, 0, -4);
diff --git a/apps/files_encryption/settings-personal.php b/apps/files_encryption/settings-personal.php
index 09e9df05352..e9875518f67 100644
--- a/apps/files_encryption/settings-personal.php
+++ b/apps/files_encryption/settings-personal.php
@@ -12,7 +12,7 @@
$tmpl = new OCP\Template('files_encryption', 'settings-personal');
$user = \OCP\USER::getUser();
-$view = new \OC_FilesystemView('/');
+$view = new \OC\Files\View('/');
$util = new \OCA\Encryption\Util($view, $user);
$session = new \OCA\Encryption\Session($view);
diff --git a/apps/files_encryption/tests/crypt.php b/apps/files_encryption/tests/crypt.php
index 123943ea26a..83c2ab30b8e 100755
--- a/apps/files_encryption/tests/crypt.php
+++ b/apps/files_encryption/tests/crypt.php
@@ -34,7 +34,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
public $dataUrl;
public $dataShort;
/**
- * @var OC_FilesystemView
+ * @var OC\Files\View
*/
public $view;
public $legacyEncryptedData;
@@ -79,7 +79,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
$this->genPublicKey = $keypair['publicKey'];
$this->genPrivateKey = $keypair['privateKey'];
- $this->view = new \OC_FilesystemView('/');
+ $this->view = new \OC\Files\View('/');
// remember files_trashbin state
$this->stateFilesTrashbin = OC_App::isEnabled('files_trashbin');
@@ -157,7 +157,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
$filename = 'tmp-' . uniqid() . '.test';
- $util = new Encryption\Util(new \OC_FilesystemView(), $this->userId);
+ $util = new Encryption\Util(new \OC\Files\View(), $this->userId);
$cryptedFile = file_put_contents('crypt:///' . $this->userId . '/files/'. $filename, $this->dataShort);
@@ -216,7 +216,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
// Generate a a random filename
$filename = 'tmp-' . uniqid() . '.test';
- $util = new Encryption\Util(new \OC_FilesystemView(), $this->userId);
+ $util = new Encryption\Util(new \OC\Files\View(), $this->userId);
// Save long data as encrypted file using stream wrapper
$cryptedFile = file_put_contents('crypt:///' . $this->userId . '/files/' . $filename, $this->dataLong . $this->dataLong);
diff --git a/apps/files_encryption/tests/hooks.php b/apps/files_encryption/tests/hooks.php
index 047084ca2c1..ee534f708c2 100644
--- a/apps/files_encryption/tests/hooks.php
+++ b/apps/files_encryption/tests/hooks.php
@@ -40,7 +40,7 @@ class Test_Encryption_Hooks extends \PHPUnit_Framework_TestCase {
const TEST_ENCRYPTION_HOOKS_USER2 = "test-encryption-hooks-user2";
/**
- * @var \OC_FilesystemView
+ * @var \OC\Files\View
*/
public $user1View; // view on /data/user1/files
public $user2View; // view on /data/user2/files
@@ -83,9 +83,9 @@ class Test_Encryption_Hooks extends \PHPUnit_Framework_TestCase {
\OC_User::setUserId(\Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER1);
// init filesystem view
- $this->user1View = new \OC_FilesystemView('/'. \Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER1 . '/files');
- $this->user2View = new \OC_FilesystemView('/'. \Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER2 . '/files');
- $this->rootView = new \OC_FilesystemView('/');
+ $this->user1View = new \OC\Files\View('/'. \Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER1 . '/files');
+ $this->user2View = new \OC\Files\View('/'. \Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER2 . '/files');
+ $this->rootView = new \OC\Files\View('/');
// init short data
$this->data = 'hats';
diff --git a/apps/files_encryption/tests/keymanager.php b/apps/files_encryption/tests/keymanager.php
index 0caf12e91a3..2bd2ddc8e68 100644
--- a/apps/files_encryption/tests/keymanager.php
+++ b/apps/files_encryption/tests/keymanager.php
@@ -29,7 +29,7 @@ class Test_Encryption_Keymanager extends \PHPUnit_Framework_TestCase {
public $pass;
public $stateFilesTrashbin;
/**
- * @var OC_FilesystemView
+ * @var OC\Files\View
*/
public $view;
public $randomKey;
@@ -68,7 +68,7 @@ class Test_Encryption_Keymanager extends \PHPUnit_Framework_TestCase {
$this->genPublicKey = $keypair['publicKey'];
$this->genPrivateKey = $keypair['privateKey'];
- $this->view = new \OC_FilesystemView('/');
+ $this->view = new \OC\Files\View('/');
\OC_User::setUserId(\Test_Encryption_Keymanager::TEST_USER);
$this->userId = \Test_Encryption_Keymanager::TEST_USER;
@@ -257,4 +257,4 @@ class TestProtectedKeymanagerMethods extends \OCA\Encryption\Keymanager {
public static function testGetFilenameFromShareKey($sharekey) {
return self::getFilenameFromShareKey($sharekey);
}
-} \ No newline at end of file
+}
diff --git a/apps/files_encryption/tests/proxy.php b/apps/files_encryption/tests/proxy.php
index 647ee955eb1..533aaa376b9 100644
--- a/apps/files_encryption/tests/proxy.php
+++ b/apps/files_encryption/tests/proxy.php
@@ -42,7 +42,7 @@ class Test_Encryption_Proxy extends \PHPUnit_Framework_TestCase {
public $userId;
public $pass;
/**
- * @var \OC_FilesystemView
+ * @var \OC\Files\View
*/
public $view; // view in /data/user/files
public $rootView; // view on /data/user
@@ -75,8 +75,8 @@ class Test_Encryption_Proxy extends \PHPUnit_Framework_TestCase {
$this->pass = \Test_Encryption_Proxy::TEST_ENCRYPTION_PROXY_USER1;
// init filesystem view
- $this->view = new \OC_FilesystemView('/'. \Test_Encryption_Proxy::TEST_ENCRYPTION_PROXY_USER1 . '/files');
- $this->rootView = new \OC_FilesystemView('/'. \Test_Encryption_Proxy::TEST_ENCRYPTION_PROXY_USER1 );
+ $this->view = new \OC\Files\View('/'. \Test_Encryption_Proxy::TEST_ENCRYPTION_PROXY_USER1 . '/files');
+ $this->rootView = new \OC\Files\View('/'. \Test_Encryption_Proxy::TEST_ENCRYPTION_PROXY_USER1 );
// init short data
$this->data = 'hats';
diff --git a/apps/files_encryption/tests/share.php b/apps/files_encryption/tests/share.php
index 512671c5767..f75092f5436 100755
--- a/apps/files_encryption/tests/share.php
+++ b/apps/files_encryption/tests/share.php
@@ -48,7 +48,7 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
public $filename;
public $dataShort;
/**
- * @var OC_FilesystemView
+ * @var OC\Files\View
*/
public $view;
public $folder1;
@@ -92,7 +92,7 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
function setUp() {
$this->dataShort = 'hats';
- $this->view = new \OC_FilesystemView('/');
+ $this->view = new \OC\Files\View('/');
$this->folder1 = '/folder1';
$this->subfolder = '/subfolder1';
@@ -669,7 +669,7 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
// login as admin
\Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1);
- $util = new \OCA\Encryption\Util(new \OC_FilesystemView('/'), \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1);
+ $util = new \OCA\Encryption\Util(new \OC\Files\View('/'), \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1);
// check if recovery password match
$this->assertTrue($util->checkRecoveryPassword('test123'));
@@ -777,7 +777,7 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
// login as user2
\Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2);
- $util = new \OCA\Encryption\Util(new \OC_FilesystemView('/'), \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2);
+ $util = new \OCA\Encryption\Util(new \OC\Files\View('/'), \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2);
// enable recovery for admin
$this->assertTrue($util->setRecoveryForUser(1));
diff --git a/apps/files_encryption/tests/stream.php b/apps/files_encryption/tests/stream.php
index fed2e7d89d1..f742cd3f8e9 100644
--- a/apps/files_encryption/tests/stream.php
+++ b/apps/files_encryption/tests/stream.php
@@ -42,7 +42,7 @@ class Test_Encryption_Stream extends \PHPUnit_Framework_TestCase {
public $userId;
public $pass;
/**
- * @var \OC_FilesystemView
+ * @var \OC\Files\View
*/
public $view;
public $dataShort;
@@ -71,7 +71,7 @@ class Test_Encryption_Stream extends \PHPUnit_Framework_TestCase {
$this->pass = \Test_Encryption_Stream::TEST_ENCRYPTION_STREAM_USER1;
// init filesystem view
- $this->view = new \OC_FilesystemView('/');
+ $this->view = new \OC\Files\View('/');
// init short data
$this->dataShort = 'hats';
diff --git a/apps/files_encryption/tests/trashbin.php b/apps/files_encryption/tests/trashbin.php
index 2f9ecfd9d5d..e36293ba81e 100755
--- a/apps/files_encryption/tests/trashbin.php
+++ b/apps/files_encryption/tests/trashbin.php
@@ -43,7 +43,7 @@ class Test_Encryption_Trashbin extends \PHPUnit_Framework_TestCase {
public $userId;
public $pass;
/**
- * @var \OC_FilesystemView
+ * @var \OC\Files\View
*/
public $view;
public $dataShort;
@@ -81,7 +81,7 @@ class Test_Encryption_Trashbin extends \PHPUnit_Framework_TestCase {
$this->pass = \Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1;
// init filesystem view
- $this->view = new \OC_FilesystemView('/');
+ $this->view = new \OC\Files\View('/');
// init short data
$this->dataShort = 'hats';
diff --git a/apps/files_encryption/tests/util.php b/apps/files_encryption/tests/util.php
index 88ded7ec40a..de83f6bca2b 100755
--- a/apps/files_encryption/tests/util.php
+++ b/apps/files_encryption/tests/util.php
@@ -29,7 +29,7 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase {
public $publicKeyDir;
public $pass;
/**
- * @var OC_FilesystemView
+ * @var OC\Files\View
*/
public $view;
public $keyfilesPath;
@@ -92,7 +92,7 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase {
$this->privateKeyPath =
$this->encryptionDir . '/' . $this->userId . '.private.key'; // e.g. data/admin/admin.private.key
- $this->view = new \OC_FilesystemView('/');
+ $this->view = new \OC\Files\View('/');
$this->util = new Encryption\Util($this->view, $this->userId);
@@ -205,7 +205,7 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase {
function testIsLegacyUser() {
\Test_Encryption_Util::loginHelper(\Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER);
- $userView = new \OC_FilesystemView('/' . \Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER);
+ $userView = new \OC\Files\View('/' . \Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER);
// Disable encryption proxy to prevent recursive calls
$proxyStatus = \OC_FileProxy::$enabled;
@@ -384,7 +384,7 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase {
$params = array('uid' => \OCP\User::getUser(),
'password' => \OCP\User::getUser());
- $view = new OC_FilesystemView('/');
+ $view = new OC\Files\View('/');
$util = new \OCA\Encryption\Util($view, \OCP\User::getUser());
$result = $util->initEncryption($params);
@@ -496,8 +496,8 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase {
function testEncryptLegacyFiles() {
\Test_Encryption_Util::loginHelper(\Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER);
- $userView = new \OC_FilesystemView('/' . \Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER);
- $view = new \OC_FilesystemView('/' . \Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER . '/files');
+ $userView = new \OC\Files\View('/' . \Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER);
+ $view = new \OC\Files\View('/' . \Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER . '/files');
// Disable encryption proxy to prevent recursive calls
$proxyStatus = \OC_FileProxy::$enabled;
diff --git a/apps/files_encryption/tests/webdav.php b/apps/files_encryption/tests/webdav.php
index 1fe4c13d59e..bdd3d51897b 100755
--- a/apps/files_encryption/tests/webdav.php
+++ b/apps/files_encryption/tests/webdav.php
@@ -43,7 +43,7 @@ class Test_Encryption_Webdav extends \PHPUnit_Framework_TestCase {
public $userId;
public $pass;
/**
- * @var \OC_FilesystemView
+ * @var \OC\Files\View
*/
public $view;
public $dataShort;
@@ -82,7 +82,7 @@ class Test_Encryption_Webdav extends \PHPUnit_Framework_TestCase {
$this->pass = \Test_Encryption_Webdav::TEST_ENCRYPTION_WEBDAV_USER1;
// init filesystem view
- $this->view = new \OC_FilesystemView('/');
+ $this->view = new \OC\Files\View('/');
// init short data
$this->dataShort = 'hats';
diff --git a/apps/files_sharing/tests/base.php b/apps/files_sharing/tests/base.php
index 495dca072c7..11bbcb133f5 100644
--- a/apps/files_sharing/tests/base.php
+++ b/apps/files_sharing/tests/base.php
@@ -39,7 +39,7 @@ abstract class Test_Files_Sharing_Base extends \PHPUnit_Framework_TestCase {
public $filename;
public $data;
/**
- * @var OC_FilesystemView
+ * @var OC\Files\View
*/
public $view;
public $folder;
@@ -68,7 +68,7 @@ abstract class Test_Files_Sharing_Base extends \PHPUnit_Framework_TestCase {
self::loginHelper(self::TEST_FILES_SHARING_API_USER1);
$this->data = 'foobar';
- $this->view = new \OC_FilesystemView('/' . self::TEST_FILES_SHARING_API_USER1 . '/files');
+ $this->view = new \OC\Files\View('/' . self::TEST_FILES_SHARING_API_USER1 . '/files');
// remember files_encryption state
$this->stateFilesEncryption = \OC_App::isEnabled('files_encryption');
diff --git a/apps/files_sharing/tests/cache.php b/apps/files_sharing/tests/cache.php
index 1af73c558d5..4e63a1844c6 100644
--- a/apps/files_sharing/tests/cache.php
+++ b/apps/files_sharing/tests/cache.php
@@ -25,7 +25,7 @@ require_once __DIR__ . '/base.php';
class Test_Files_Sharing_Cache extends Test_Files_Sharing_Base {
/**
- * @var OC_FilesystemView
+ * @var OC\Files\View
*/
public $user2View;
diff --git a/apps/files_trashbin/lib/trashbin.php b/apps/files_trashbin/lib/trashbin.php
index 173eb2164cf..e2f220051c7 100644
--- a/apps/files_trashbin/lib/trashbin.php
+++ b/apps/files_trashbin/lib/trashbin.php
@@ -216,7 +216,7 @@ class Trashbin {
list($owner, $ownerPath) = self::getUidAndFilename($file_path);
- $util = new \OCA\Encryption\Util(new \OC_FilesystemView('/'), $user);
+ $util = new \OCA\Encryption\Util(new \OC\Files\View('/'), $user);
// disable proxy to prevent recursive calls
$proxyStatus = \OC_FileProxy::$enabled;
@@ -441,7 +441,7 @@ class Trashbin {
list($owner, $ownerPath) = self::getUidAndFilename($target);
- $util = new \OCA\Encryption\Util(new \OC_FilesystemView('/'), $user);
+ $util = new \OCA\Encryption\Util(new \OC\Files\View('/'), $user);
if ($util->isSystemWideMountPoint($ownerPath)) {
$baseDir = '/files_encryption/';
@@ -498,7 +498,7 @@ class Trashbin {
$rootView->rename($ownerShareKey, $baseDir . '/share-keys/' . $ownerPath . '.' . $user . '.shareKey');
// try to re-share if file is shared
- $filesystemView = new \OC_FilesystemView('/');
+ $filesystemView = new \OC\Files\View('/');
$session = new \OCA\Encryption\Session($filesystemView);
$util = new \OCA\Encryption\Util($filesystemView, $user);
diff --git a/lib/private/files/view.php b/lib/private/files/view.php
index 47fc04c937d..407f5981957 100644
--- a/lib/private/files/view.php
+++ b/lib/private/files/view.php
@@ -11,7 +11,7 @@
* working with files within that view (e.g. read, write, delete, etc.). Each
* view is restricted to a set of directories via a virtual root. The default view
* uses the currently logged in user's data directory as root (parts of
- * OC_Filesystem are merely a wrapper for OC_FilesystemView).
+ * OC_Filesystem are merely a wrapper for OC\Files\View).
*
* Apps that need to access files outside of the user data folders (to modify files
* belonging to a user other than the one currently logged in, for example) should
diff --git a/lib/private/legacy/filesystemview.php b/lib/private/legacy/filesystemview.php
deleted file mode 100644
index d6bca62e06a..00000000000
--- a/lib/private/legacy/filesystemview.php
+++ /dev/null
@@ -1,9 +0,0 @@
-<?php
-
-/**
- * Copyright (c) 2012 Robin Appelman <icewind@owncloud.com>
- * This file is licensed under the Affero General Public License version 3 or
- * later.
- * See the COPYING-README file. */
-
-class OC_FilesystemView extends \OC\Files\View {}
diff --git a/settings/ajax/decryptall.php b/settings/ajax/decryptall.php
index d12df230d41..55685f778d1 100644
--- a/settings/ajax/decryptall.php
+++ b/settings/ajax/decryptall.php
@@ -10,7 +10,7 @@ OC_App::loadApp('files_encryption');
$params = array('uid' => \OCP\User::getUser(),
'password' => $_POST['password']);
-$view = new OC_FilesystemView('/');
+$view = new OC\Files\View('/');
$util = new \OCA\Encryption\Util($view, \OCP\User::getUser());
$l = \OC_L10N::get('settings');
diff --git a/settings/changepassword/controller.php b/settings/changepassword/controller.php
index 9f1e7329964..052715555e5 100644
--- a/settings/changepassword/controller.php
+++ b/settings/changepassword/controller.php
@@ -52,7 +52,7 @@ class Controller {
if (\OC_App::isEnabled('files_encryption')) {
//handle the recovery case
- $util = new \OCA\Encryption\Util(new \OC_FilesystemView('/'), $username);
+ $util = new \OCA\Encryption\Util(new \OC\Files\View('/'), $username);
$recoveryAdminEnabled = \OC_Appconfig::getValue('files_encryption', 'recoveryAdminEnabled');
$validRecoveryPassword = false;