Procházet zdrojové kódy

remove legacy aka deprecated code: OC_FilesystemView

tags/v7.0.0alpha2
Thomas Müller před 10 roky
rodič
revize
e0dd69e4e6

+ 1
- 1
apps/files_encryption/ajax/changeRecoveryPassword.php Zobrazit soubor

@@ -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;

+ 1
- 1
apps/files_encryption/ajax/getMigrationStatus.php Zobrazit soubor

@@ -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();
}
}

+ 1
- 1
apps/files_encryption/ajax/userrecovery.php Zobrazit soubor

@@ -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

+ 1
- 1
apps/files_encryption/appinfo/app.php Zobrazit soubor

@@ -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) {

+ 10
- 10
apps/files_encryption/hooks/hooks.php Zobrazit soubor

@@ -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(

+ 2
- 2
apps/files_encryption/lib/helper.php Zobrazit soubor

@@ -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) {

+ 22
- 22
apps/files_encryption/lib/keymanager.php Zobrazit soubor

@@ -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, '/');


+ 5
- 5
apps/files_encryption/lib/proxy.php Zobrazit soubor

@@ -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);

+ 1
- 1
apps/files_encryption/lib/session.php Zobrazit soubor

@@ -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
*/

+ 1
- 1
apps/files_encryption/lib/stream.php Zobrazit soubor

@@ -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);

+ 4
- 4
apps/files_encryption/lib/util.php Zobrazit soubor

@@ -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);

+ 1
- 1
apps/files_encryption/settings-personal.php Zobrazit soubor

@@ -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);

+ 4
- 4
apps/files_encryption/tests/crypt.php Zobrazit soubor

@@ -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);

+ 4
- 4
apps/files_encryption/tests/hooks.php Zobrazit soubor

@@ -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';

+ 3
- 3
apps/files_encryption/tests/keymanager.php Zobrazit soubor

@@ -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);
}
}
}

+ 3
- 3
apps/files_encryption/tests/proxy.php Zobrazit soubor

@@ -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';

+ 4
- 4
apps/files_encryption/tests/share.php Zobrazit soubor

@@ -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));

+ 2
- 2
apps/files_encryption/tests/stream.php Zobrazit soubor

@@ -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';

+ 2
- 2
apps/files_encryption/tests/trashbin.php Zobrazit soubor

@@ -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';

+ 6
- 6
apps/files_encryption/tests/util.php Zobrazit soubor

@@ -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;

+ 2
- 2
apps/files_encryption/tests/webdav.php Zobrazit soubor

@@ -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';

+ 2
- 2
apps/files_sharing/tests/base.php Zobrazit soubor

@@ -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');


+ 1
- 1
apps/files_sharing/tests/cache.php Zobrazit soubor

@@ -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;


+ 3
- 3
apps/files_trashbin/lib/trashbin.php Zobrazit soubor

@@ -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);


+ 1
- 1
lib/private/files/view.php Zobrazit soubor

@@ -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

+ 0
- 9
lib/private/legacy/filesystemview.php Zobrazit soubor

@@ -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 {}

+ 1
- 1
settings/ajax/decryptall.php Zobrazit soubor

@@ -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');


+ 1
- 1
settings/changepassword/controller.php Zobrazit soubor

@@ -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;

Načítá se…
Zrušit
Uložit