diff options
Diffstat (limited to 'apps/files_encryption')
21 files changed, 98 insertions, 26 deletions
diff --git a/apps/files_encryption/appinfo/info.xml b/apps/files_encryption/appinfo/info.xml index 419bdb1b120..48a28fde78a 100644 --- a/apps/files_encryption/appinfo/info.xml +++ b/apps/files_encryption/appinfo/info.xml @@ -5,7 +5,7 @@ <description>Server side encryption of files. DEPRECATED. This app is no longer supported and will be replaced with an improved version in ownCloud 5. Only enable this features if you want to read old encrypted data. Warning: You will lose your data if you enable this App and forget your password. Encryption is not yet compatible with LDAP.</description> <licence>AGPL</licence> <author>Robin Appelman</author> - <require>4</require> + <require>4.9</require> <shipped>true</shipped> <types> <filesystem/> diff --git a/apps/files_encryption/l10n/de_DE.php b/apps/files_encryption/l10n/de_DE.php new file mode 100644 index 00000000000..d486a82322b --- /dev/null +++ b/apps/files_encryption/l10n/de_DE.php @@ -0,0 +1,6 @@ +<?php $TRANSLATIONS = array( +"Encryption" => "Verschlüsselung", +"Exclude the following file types from encryption" => "Die folgenden Dateitypen von der Verschlüsselung ausnehmen", +"None" => "Keine", +"Enable Encryption" => "Verschlüsselung aktivieren" +); diff --git a/apps/files_encryption/l10n/es_AR.php b/apps/files_encryption/l10n/es_AR.php new file mode 100644 index 00000000000..a15c37e730e --- /dev/null +++ b/apps/files_encryption/l10n/es_AR.php @@ -0,0 +1,6 @@ +<?php $TRANSLATIONS = array( +"Encryption" => "Encriptación", +"Exclude the following file types from encryption" => "Exceptuar de la encriptación los siguientes tipos de archivo", +"None" => "Ninguno", +"Enable Encryption" => "Habilitar encriptación" +); diff --git a/apps/files_encryption/l10n/gl.php b/apps/files_encryption/l10n/gl.php new file mode 100644 index 00000000000..1434ff48aac --- /dev/null +++ b/apps/files_encryption/l10n/gl.php @@ -0,0 +1,6 @@ +<?php $TRANSLATIONS = array( +"Encryption" => "Encriptado", +"Exclude the following file types from encryption" => "Excluír os seguintes tipos de ficheiro da encriptación", +"None" => "Nada", +"Enable Encryption" => "Habilitar encriptación" +); diff --git a/apps/files_encryption/l10n/id.php b/apps/files_encryption/l10n/id.php new file mode 100644 index 00000000000..824ae883041 --- /dev/null +++ b/apps/files_encryption/l10n/id.php @@ -0,0 +1,6 @@ +<?php $TRANSLATIONS = array( +"Encryption" => "enkripsi", +"Exclude the following file types from encryption" => "pengecualian untuk tipe file berikut dari enkripsi", +"None" => "tidak ada", +"Enable Encryption" => "aktifkan enkripsi" +); diff --git a/apps/files_encryption/l10n/ku_IQ.php b/apps/files_encryption/l10n/ku_IQ.php new file mode 100644 index 00000000000..bd8977ac515 --- /dev/null +++ b/apps/files_encryption/l10n/ku_IQ.php @@ -0,0 +1,6 @@ +<?php $TRANSLATIONS = array( +"Encryption" => "نهێنیکردن", +"Exclude the following file types from encryption" => "بهربهست کردنی ئهم جۆره پهڕگانه له نهێنیکردن", +"None" => "هیچ", +"Enable Encryption" => "چالاکردنی نهێنیکردن" +); diff --git a/apps/files_encryption/l10n/pt_BR.php b/apps/files_encryption/l10n/pt_BR.php new file mode 100644 index 00000000000..5c02f52217f --- /dev/null +++ b/apps/files_encryption/l10n/pt_BR.php @@ -0,0 +1,6 @@ +<?php $TRANSLATIONS = array( +"Encryption" => "Criptografia", +"Exclude the following file types from encryption" => "Excluir os seguintes tipos de arquivo da criptografia", +"None" => "Nenhuma", +"Enable Encryption" => "Habilitar Criptografia" +); diff --git a/apps/files_encryption/l10n/pt_PT.php b/apps/files_encryption/l10n/pt_PT.php new file mode 100644 index 00000000000..570462b414f --- /dev/null +++ b/apps/files_encryption/l10n/pt_PT.php @@ -0,0 +1,6 @@ +<?php $TRANSLATIONS = array( +"Encryption" => "Encriptação", +"Exclude the following file types from encryption" => "Excluir da encriptação os seguintes tipo de ficheiros", +"None" => "Nenhum", +"Enable Encryption" => "Activar Encriptação" +); diff --git a/apps/files_encryption/l10n/ro.php b/apps/files_encryption/l10n/ro.php new file mode 100644 index 00000000000..97f3f262d76 --- /dev/null +++ b/apps/files_encryption/l10n/ro.php @@ -0,0 +1,6 @@ +<?php $TRANSLATIONS = array( +"Encryption" => "Încriptare", +"Exclude the following file types from encryption" => "Exclude următoarele tipuri de fișiere de la încriptare", +"None" => "Niciuna", +"Enable Encryption" => "Activare încriptare" +); diff --git a/apps/files_encryption/l10n/ru_RU.php b/apps/files_encryption/l10n/ru_RU.php new file mode 100644 index 00000000000..1328b0d0359 --- /dev/null +++ b/apps/files_encryption/l10n/ru_RU.php @@ -0,0 +1,6 @@ +<?php $TRANSLATIONS = array( +"Encryption" => "Шифрование", +"Exclude the following file types from encryption" => "Исключите следующие типы файлов из шифрования", +"None" => "Ни один", +"Enable Encryption" => "Включить шифрование" +); diff --git a/apps/files_encryption/l10n/si_LK.php b/apps/files_encryption/l10n/si_LK.php new file mode 100644 index 00000000000..a29884afffd --- /dev/null +++ b/apps/files_encryption/l10n/si_LK.php @@ -0,0 +1,6 @@ +<?php $TRANSLATIONS = array( +"Encryption" => "ගුප්ත කේතනය", +"Exclude the following file types from encryption" => "මෙම ගොනු වර්ග ගුප්ත කේතනය කිරීමෙන් බැහැරව තබන්න", +"None" => "කිසිවක් නැත", +"Enable Encryption" => "ගුප්ත කේතනය සක්රිය කරන්න" +); diff --git a/apps/files_encryption/l10n/sl.php b/apps/files_encryption/l10n/sl.php index 65807910e10..f62fe781c6a 100644 --- a/apps/files_encryption/l10n/sl.php +++ b/apps/files_encryption/l10n/sl.php @@ -1,6 +1,6 @@ <?php $TRANSLATIONS = array( "Encryption" => "Šifriranje", -"Exclude the following file types from encryption" => "Naslednje vrste datotek naj se ne šifrirajo", +"Exclude the following file types from encryption" => "Navedene vrste datotek naj ne bodo šifrirane", "None" => "Brez", "Enable Encryption" => "Omogoči šifriranje" ); diff --git a/apps/files_encryption/l10n/uk.php b/apps/files_encryption/l10n/uk.php new file mode 100644 index 00000000000..3c15bb28436 --- /dev/null +++ b/apps/files_encryption/l10n/uk.php @@ -0,0 +1,6 @@ +<?php $TRANSLATIONS = array( +"Encryption" => "Шифрування", +"Exclude the following file types from encryption" => "Не шифрувати файли наступних типів", +"None" => "Жоден", +"Enable Encryption" => "Включити шифрування" +); diff --git a/apps/files_encryption/l10n/zh_CN.GB2312.php b/apps/files_encryption/l10n/zh_CN.GB2312.php new file mode 100644 index 00000000000..297444fcf55 --- /dev/null +++ b/apps/files_encryption/l10n/zh_CN.GB2312.php @@ -0,0 +1,6 @@ +<?php $TRANSLATIONS = array( +"Encryption" => "加密", +"Exclude the following file types from encryption" => "从加密中排除如下文件类型", +"None" => "无", +"Enable Encryption" => "启用加密" +); diff --git a/apps/files_encryption/lib/crypt.php b/apps/files_encryption/lib/crypt.php index 38d8edf28c3..d057c1ed194 100644 --- a/apps/files_encryption/lib/crypt.php +++ b/apps/files_encryption/lib/crypt.php @@ -151,7 +151,7 @@ class OC_Crypt { */ public static function encryptFile( $source, $target, $key='') { $handleread = fopen($source, "rb"); - if($handleread!=FALSE) { + if($handleread!=false) { $handlewrite = fopen($target, "wb"); while (!feof($handleread)) { $content = fread($handleread, 8192); @@ -174,7 +174,7 @@ class OC_Crypt { */ public static function decryptFile( $source, $target, $key='') { $handleread = fopen($source, "rb"); - if($handleread!=FALSE) { + if($handleread!=false) { $handlewrite = fopen($target, "wb"); while (!feof($handleread)) { $content = fread($handleread, 8192); diff --git a/apps/files_encryption/lib/cryptstream.php b/apps/files_encryption/lib/cryptstream.php index 721a1b955df..95b58b8cce7 100644 --- a/apps/files_encryption/lib/cryptstream.php +++ b/apps/files_encryption/lib/cryptstream.php @@ -167,7 +167,7 @@ class OC_CryptStream{ public function stream_close() { $this->flush(); if($this->meta['mode']!='r' and $this->meta['mode']!='rb') { - OC_FileCache::put($this->path,array('encrypted'=>true,'size'=>$this->size),''); + OC_FileCache::put($this->path, array('encrypted'=>true,'size'=>$this->size),''); } return fclose($this->source); } diff --git a/apps/files_encryption/lib/proxy.php b/apps/files_encryption/lib/proxy.php index f61cd1e3773..61b87ab5463 100644 --- a/apps/files_encryption/lib/proxy.php +++ b/apps/files_encryption/lib/proxy.php @@ -42,13 +42,13 @@ class OC_FileProxy_Encryption extends OC_FileProxy{ return false; } if(is_null(self::$blackList)) { - self::$blackList=explode(',',OCP\Config::getAppValue('files_encryption','type_blacklist','jpg,png,jpeg,avi,mpg,mpeg,mkv,mp3,oga,ogv,ogg')); + self::$blackList=explode(',', OCP\Config::getAppValue('files_encryption', 'type_blacklist', 'jpg,png,jpeg,avi,mpg,mpeg,mkv,mp3,oga,ogv,ogg')); } if(self::isEncrypted($path)) { return true; } - $extension=substr($path,strrpos($path,'.')+1); - if(array_search($extension,self::$blackList)===false) { + $extension=substr($path, strrpos($path, '.')+1); + if(array_search($extension, self::$blackList)===false) { return true; } } @@ -68,7 +68,7 @@ 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),''); } } } diff --git a/apps/files_encryption/settings.php b/apps/files_encryption/settings.php index 0a0d4d1abba..168124a8d22 100644 --- a/apps/files_encryption/settings.php +++ b/apps/files_encryption/settings.php @@ -7,7 +7,7 @@ */ $tmpl = new OCP\Template( 'files_encryption', 'settings'); -$blackList=explode(',',OCP\Config::getAppValue('files_encryption','type_blacklist','jpg,png,jpeg,avi,mpg,mpeg,mkv,mp3,oga,ogv,ogg')); +$blackList=explode(',', OCP\Config::getAppValue('files_encryption', 'type_blacklist', 'jpg,png,jpeg,avi,mpg,mpeg,mkv,mp3,oga,ogv,ogg')); $enabled=(OCP\Config::getAppValue('files_encryption','enable_encryption','true')=='true'); $tmpl->assign('blacklist',$blackList); $tmpl->assign('encryption_enabled',$enabled); diff --git a/apps/files_encryption/tests/encryption.php b/apps/files_encryption/tests/encryption.php index 89397f6ef2c..a7bc2df0e12 100644 --- a/apps/files_encryption/tests/encryption.php +++ b/apps/files_encryption/tests/encryption.php @@ -19,7 +19,7 @@ class Test_Encryption extends UnitTestCase { $chunk=substr($source,0,8192); $encrypted=OC_Crypt::encrypt($chunk,$key); - $this->assertEqual(strlen($chunk),strlen($encrypted)); + $this->assertEqual(strlen($chunk), strlen($encrypted)); $decrypted=OC_Crypt::decrypt($encrypted,$key); $decrypted=rtrim($decrypted, "\0"); $this->assertEqual($decrypted,$chunk); @@ -66,7 +66,7 @@ class Test_Encryption extends UnitTestCase { $this->assertEqual($decrypted,$source); $encrypted=OC_Crypt::blockEncrypt($source,$key); - $decrypted=OC_Crypt::blockDecrypt($encrypted,$key,strlen($source)); + $decrypted=OC_Crypt::blockDecrypt($encrypted,$key, strlen($source)); $this->assertEqual($decrypted,$source); } } diff --git a/apps/files_encryption/tests/proxy.php b/apps/files_encryption/tests/proxy.php index 042011a6c87..c3c8f4a2db0 100644 --- a/apps/files_encryption/tests/proxy.php +++ b/apps/files_encryption/tests/proxy.php @@ -30,7 +30,7 @@ class Test_CryptProxy extends UnitTestCase { //set up temporary storage OC_Filesystem::clearMounts(); - OC_Filesystem::mount('OC_Filestorage_Temporary',array(),'/'); + OC_Filesystem::mount('OC_Filestorage_Temporary', array(),'/'); OC_Filesystem::init('/'.$user.'/files'); @@ -59,7 +59,7 @@ class Test_CryptProxy extends UnitTestCase { $fromFile=OC_Filesystem::file_get_contents('/file'); $this->assertNotEqual($original,$stored); - $this->assertEqual(strlen($original),strlen($fromFile)); + $this->assertEqual(strlen($original), strlen($fromFile)); $this->assertEqual($original,$fromFile); } @@ -98,7 +98,7 @@ class Test_CryptProxy extends UnitTestCase { $fromFile=OC_Filesystem::file_get_contents('/file'); $this->assertNotEqual($original,$stored); - $this->assertEqual(strlen($original),strlen($fromFile)); + $this->assertEqual(strlen($original), strlen($fromFile)); $this->assertEqual($original,$fromFile); $file=__DIR__.'/zeros'; @@ -112,6 +112,6 @@ class Test_CryptProxy extends UnitTestCase { $fromFile=OC_Filesystem::file_get_contents('/file'); $this->assertNotEqual($original,$stored); - $this->assertEqual(strlen($original),strlen($fromFile)); + $this->assertEqual(strlen($original), strlen($fromFile)); } } diff --git a/apps/files_encryption/tests/stream.php b/apps/files_encryption/tests/stream.php index 39b13620782..5ea0da48017 100644 --- a/apps/files_encryption/tests/stream.php +++ b/apps/files_encryption/tests/stream.php @@ -10,11 +10,11 @@ class Test_CryptStream extends UnitTestCase { private $tmpFiles=array(); function testStream() { - $stream=$this->getStream('test1','w',strlen('foobar')); + $stream=$this->getStream('test1','w', strlen('foobar')); fwrite($stream,'foobar'); fclose($stream); - $stream=$this->getStream('test1','r',strlen('foobar')); + $stream=$this->getStream('test1','r', strlen('foobar')); $data=fread($stream,6); fclose($stream); $this->assertEqual('foobar',$data); @@ -26,10 +26,10 @@ class Test_CryptStream extends UnitTestCase { fclose($target); fclose($source); - $stream=$this->getStream('test2','r',filesize($file)); + $stream=$this->getStream('test2','r', filesize($file)); $data=stream_get_contents($stream); $original=file_get_contents($file); - $this->assertEqual(strlen($original),strlen($data)); + $this->assertEqual(strlen($original), strlen($data)); $this->assertEqual($original,$data); } @@ -59,27 +59,27 @@ class Test_CryptStream extends UnitTestCase { $file=__DIR__.'/binary'; $source=file_get_contents($file); - $stream=$this->getStream('test','w',strlen($source)); + $stream=$this->getStream('test','w', strlen($source)); fwrite($stream,$source); fclose($stream); - $stream=$this->getStream('test','r',strlen($source)); + $stream=$this->getStream('test','r', strlen($source)); $data=stream_get_contents($stream); fclose($stream); - $this->assertEqual(strlen($data),strlen($source)); + $this->assertEqual(strlen($data), strlen($source)); $this->assertEqual($source,$data); $file=__DIR__.'/zeros'; $source=file_get_contents($file); - $stream=$this->getStream('test2','w',strlen($source)); + $stream=$this->getStream('test2','w', strlen($source)); fwrite($stream,$source); fclose($stream); - $stream=$this->getStream('test2','r',strlen($source)); + $stream=$this->getStream('test2','r', strlen($source)); $data=stream_get_contents($stream); fclose($stream); - $this->assertEqual(strlen($data),strlen($source)); + $this->assertEqual(strlen($data), strlen($source)); $this->assertEqual($source,$data); } } |