fix check if app is enabled

This commit is contained in:
Bjoern Schiessle 2013-09-25 19:23:07 +02:00
parent 71bbb2ea8b
commit 0b98427536
1 changed files with 3 additions and 4 deletions

View File

@ -50,9 +50,8 @@ class Proxy extends \OC_FileProxy {
private static function shouldEncrypt($path) { private static function shouldEncrypt($path) {
if (is_null(self::$enableEncryption)) { if (is_null(self::$enableEncryption)) {
if ( if (
\OCP\Config::getAppValue('files_encryption', 'enable_encryption', 'true') === 'true' \OCP\App::isEnabled('files_encryption') === true
&& Crypt::mode() === 'server' && Crypt::mode() === 'server'
) { ) {
@ -200,7 +199,7 @@ class Proxy extends \OC_FileProxy {
*/ */
public function preUnlink($path) { public function preUnlink($path) {
// let the trashbin handle this // let the trashbin handle this
if (\OCP\App::isEnabled('files_trashbin')) { if (\OCP\App::isEnabled('files_trashbin')) {
return true; return true;
} }
@ -291,7 +290,7 @@ class Proxy extends \OC_FileProxy {
// Close the original encrypted file // Close the original encrypted file
fclose($result); fclose($result);
// Open the file using the crypto stream wrapper // Open the file using the crypto stream wrapper
// protocol and let it do the decryption work instead // protocol and let it do the decryption work instead
$result = fopen('crypt://' . $path, $meta['mode']); $result = fopen('crypt://' . $path, $meta['mode']);