diff options
Diffstat (limited to 'apps/files_encryption/lib')
-rw-r--r-- | apps/files_encryption/lib/crypt.php | 2 | ||||
-rw-r--r-- | apps/files_encryption/lib/cryptstream.php | 6 | ||||
-rw-r--r-- | apps/files_encryption/lib/proxy.php | 18 |
3 files changed, 13 insertions, 13 deletions
diff --git a/apps/files_encryption/lib/crypt.php b/apps/files_encryption/lib/crypt.php index d8e7e4d1dd9..5ff3f578384 100644 --- a/apps/files_encryption/lib/crypt.php +++ b/apps/files_encryption/lib/crypt.php @@ -80,7 +80,7 @@ class OC_Crypt { } } - public static function createkey($username,$passcode) { + public static function createkey($username, $passcode) { // generate a random key $key=mt_rand(10000, 99999).mt_rand(10000, 99999).mt_rand(10000, 99999).mt_rand(10000, 99999); diff --git a/apps/files_encryption/lib/cryptstream.php b/apps/files_encryption/lib/cryptstream.php index 3170cff366c..8b05560050d 100644 --- a/apps/files_encryption/lib/cryptstream.php +++ b/apps/files_encryption/lib/cryptstream.php @@ -23,7 +23,7 @@ /** * transparently encrypted filestream * - * you can use it as wrapper around an existing stream by setting OC_CryptStream::$sourceStreams['foo']=array('path'=>$path,'stream'=>$stream) + * you can use it as wrapper around an existing stream by setting OC_CryptStream::$sourceStreams['foo']=array('path'=>$path, 'stream'=>$stream) * and then fopen('crypt://streams/foo'); */ @@ -123,11 +123,11 @@ class OC_CryptStream{ $data=substr($data, 8192); } } - $this->size=max($this->size,$currentPos+$length); + $this->size=max($this->size, $currentPos+$length); return $length; } - public function stream_set_option($option,$arg1,$arg2) { + public function stream_set_option($option, $arg1, $arg2) { switch($option) { case STREAM_OPTION_BLOCKING: stream_set_blocking($this->source, $arg1); diff --git a/apps/files_encryption/lib/proxy.php b/apps/files_encryption/lib/proxy.php index fed6acaf91b..cacf7d7920a 100644 --- a/apps/files_encryption/lib/proxy.php +++ b/apps/files_encryption/lib/proxy.php @@ -36,7 +36,7 @@ class OC_FileProxy_Encryption extends OC_FileProxy{ */ private static function shouldEncrypt($path) { if(is_null(self::$enableEncryption)) { - self::$enableEncryption=(OCP\Config::getAppValue('files_encryption','enable_encryption','true')=='true'); + self::$enableEncryption=(OCP\Config::getAppValue('files_encryption', 'enable_encryption', 'true')=='true'); } if(!self::$enableEncryption) { return false; @@ -59,7 +59,7 @@ class OC_FileProxy_Encryption extends OC_FileProxy{ * @return bool */ private static function isEncrypted($path) { - $metadata=OC_FileCache_Cached::get($path,''); + $metadata=OC_FileCache_Cached::get($path, ''); return isset($metadata['encrypted']) and (bool)$metadata['encrypted']; } @@ -68,14 +68,14 @@ class OC_FileProxy_Encryption extends OC_FileProxy{ if (!is_resource($data)) {//stream put contents should have been converter to fopen $size=strlen($data); $data=OC_Crypt::blockEncrypt($data); - OC_FileCache::put($path, array('encrypted'=>true,'size'=>$size),''); + OC_FileCache::put($path, array('encrypted'=>true,'size'=>$size), ''); } } } - public function postFile_get_contents($path,$data) { + public function postFile_get_contents($path, $data) { if(self::isEncrypted($path)) { - $cached=OC_FileCache_Cached::get($path,''); + $cached=OC_FileCache_Cached::get($path, ''); $data=OC_Crypt::blockDecrypt($data, '', $cached['size']); } return $data; @@ -92,7 +92,7 @@ class OC_FileProxy_Encryption extends OC_FileProxy{ }elseif(self::shouldEncrypt($path) and $meta['mode']!='r' and $meta['mode']!='rb') { if(OC_Filesystem::file_exists($path) and OC_Filesystem::filesize($path)>0) { //first encrypt the target file so we don't end up with a half encrypted file - OCP\Util::writeLog('files_encryption','Decrypting '.$path.' before writing',OCP\Util::DEBUG); + OCP\Util::writeLog('files_encryption','Decrypting '.$path.' before writing', OCP\Util::DEBUG); $tmp=fopen('php://temp'); OCP\Files::streamCopy($result, $tmp); fclose($result); @@ -106,14 +106,14 @@ class OC_FileProxy_Encryption extends OC_FileProxy{ public function postGetMimeType($path, $mime) { if(self::isEncrypted($path)) { - $mime=OCP\Files::getMimeType('crypt://'.$path,'w'); + $mime=OCP\Files::getMimeType('crypt://'.$path, 'w'); } return $mime; } public function postStat($path, $data) { if(self::isEncrypted($path)) { - $cached=OC_FileCache_Cached::get($path,''); + $cached=OC_FileCache_Cached::get($path, ''); $data['size']=$cached['size']; } return $data; @@ -121,7 +121,7 @@ class OC_FileProxy_Encryption extends OC_FileProxy{ public function postFileSize($path, $size) { if(self::isEncrypted($path)) { - $cached=OC_FileCache_Cached::get($path,''); + $cached=OC_FileCache_Cached::get($path, ''); return $cached['size']; }else{ return $size; |