summaryrefslogtreecommitdiffstats
path: root/apps/files_encryption
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_encryption')
-rw-r--r--apps/files_encryption/js/settings.js4
-rw-r--r--apps/files_encryption/l10n/.gitkeep0
-rw-r--r--apps/files_encryption/l10n/ca.php6
-rw-r--r--apps/files_encryption/l10n/cs_CZ.php6
-rw-r--r--apps/files_encryption/l10n/de.php6
-rw-r--r--apps/files_encryption/l10n/el.php6
-rw-r--r--apps/files_encryption/l10n/eo.php6
-rw-r--r--apps/files_encryption/l10n/es.php3
-rw-r--r--apps/files_encryption/l10n/et_EE.php6
-rw-r--r--apps/files_encryption/l10n/fa.php5
-rw-r--r--apps/files_encryption/l10n/fi_FI.php6
-rw-r--r--apps/files_encryption/l10n/fr.php6
-rw-r--r--apps/files_encryption/l10n/it.php6
-rw-r--r--apps/files_encryption/l10n/ja_JP.php6
-rw-r--r--apps/files_encryption/l10n/lt_LT.php6
-rw-r--r--apps/files_encryption/l10n/nb_NO.php6
-rw-r--r--apps/files_encryption/l10n/pl.php6
-rw-r--r--apps/files_encryption/l10n/sl.php6
-rw-r--r--apps/files_encryption/l10n/sv.php6
-rw-r--r--apps/files_encryption/l10n/th_TH.php6
-rw-r--r--apps/files_encryption/lib/crypt.php3
-rw-r--r--apps/files_encryption/lib/cryptstream.php5
-rw-r--r--apps/files_encryption/lib/proxy.php10
-rw-r--r--apps/files_encryption/templates/settings.php2
-rw-r--r--apps/files_encryption/tests/proxy.php8
25 files changed, 121 insertions, 15 deletions
diff --git a/apps/files_encryption/js/settings.js b/apps/files_encryption/js/settings.js
index 37d62265c94..8cc433246cb 100644
--- a/apps/files_encryption/js/settings.js
+++ b/apps/files_encryption/js/settings.js
@@ -17,8 +17,8 @@ $(document).ready(function(){
OC.AppConfig.setValue('files_encryption','type_blacklist',blackList);
}
- $('#enbale_encryption').change(function(){
- var checked=$('#enbale_encryption').is(':checked');
+ $('#enable_encryption').change(function(){
+ var checked=$('#enable_encryption').is(':checked');
OC.AppConfig.setValue('files_encryption','enable_encryption',(checked)?'true':'false');
})
}) \ No newline at end of file
diff --git a/apps/files_encryption/l10n/.gitkeep b/apps/files_encryption/l10n/.gitkeep
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/apps/files_encryption/l10n/.gitkeep
diff --git a/apps/files_encryption/l10n/ca.php b/apps/files_encryption/l10n/ca.php
new file mode 100644
index 00000000000..8e087b34620
--- /dev/null
+++ b/apps/files_encryption/l10n/ca.php
@@ -0,0 +1,6 @@
+<?php $TRANSLATIONS = array(
+"Encryption" => "Encriptatge",
+"Exclude the following file types from encryption" => "Exclou els tipus de fitxers següents de l'encriptatge",
+"None" => "Cap",
+"Enable Encryption" => "Activa l'encriptatge"
+);
diff --git a/apps/files_encryption/l10n/cs_CZ.php b/apps/files_encryption/l10n/cs_CZ.php
new file mode 100644
index 00000000000..15cf7705709
--- /dev/null
+++ b/apps/files_encryption/l10n/cs_CZ.php
@@ -0,0 +1,6 @@
+<?php $TRANSLATIONS = array(
+"Encryption" => "Kryptování",
+"Exclude the following file types from encryption" => "Při kryptování vynechat následující typy souborů",
+"None" => "Žádný",
+"Enable Encryption" => "Povolit kryptování"
+);
diff --git a/apps/files_encryption/l10n/de.php b/apps/files_encryption/l10n/de.php
new file mode 100644
index 00000000000..d486a82322b
--- /dev/null
+++ b/apps/files_encryption/l10n/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/el.php b/apps/files_encryption/l10n/el.php
new file mode 100644
index 00000000000..40a7c6a3672
--- /dev/null
+++ b/apps/files_encryption/l10n/el.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/eo.php b/apps/files_encryption/l10n/eo.php
new file mode 100644
index 00000000000..af3c9ae98e4
--- /dev/null
+++ b/apps/files_encryption/l10n/eo.php
@@ -0,0 +1,6 @@
+<?php $TRANSLATIONS = array(
+"Encryption" => "Ĉifrado",
+"Exclude the following file types from encryption" => "Malinkluzivigi la jenajn dosiertipojn el ĉifrado",
+"None" => "Nenio",
+"Enable Encryption" => "Kapabligi ĉifradon"
+);
diff --git a/apps/files_encryption/l10n/es.php b/apps/files_encryption/l10n/es.php
new file mode 100644
index 00000000000..26ace24e336
--- /dev/null
+++ b/apps/files_encryption/l10n/es.php
@@ -0,0 +1,3 @@
+<?php $TRANSLATIONS = array(
+"Encryption" => "Cifrado"
+);
diff --git a/apps/files_encryption/l10n/et_EE.php b/apps/files_encryption/l10n/et_EE.php
new file mode 100644
index 00000000000..a7cd9395bf0
--- /dev/null
+++ b/apps/files_encryption/l10n/et_EE.php
@@ -0,0 +1,6 @@
+<?php $TRANSLATIONS = array(
+"Encryption" => "Krüpteerimine",
+"Exclude the following file types from encryption" => "Järgnevaid failitüüpe ära krüpteeri",
+"None" => "Pole",
+"Enable Encryption" => "Luba krüpteerimine"
+);
diff --git a/apps/files_encryption/l10n/fa.php b/apps/files_encryption/l10n/fa.php
new file mode 100644
index 00000000000..0faa3f3aae7
--- /dev/null
+++ b/apps/files_encryption/l10n/fa.php
@@ -0,0 +1,5 @@
+<?php $TRANSLATIONS = array(
+"Encryption" => "رمزگذاری",
+"None" => "هیچ‌کدام",
+"Enable Encryption" => "فعال کردن رمزگذاری"
+);
diff --git a/apps/files_encryption/l10n/fi_FI.php b/apps/files_encryption/l10n/fi_FI.php
new file mode 100644
index 00000000000..5796499a26c
--- /dev/null
+++ b/apps/files_encryption/l10n/fi_FI.php
@@ -0,0 +1,6 @@
+<?php $TRANSLATIONS = array(
+"Encryption" => "Salaus",
+"Exclude the following file types from encryption" => "Jätä seuraavat tiedostotyypit salaamatta",
+"None" => "Ei mitään",
+"Enable Encryption" => "Käytä salausta"
+);
diff --git a/apps/files_encryption/l10n/fr.php b/apps/files_encryption/l10n/fr.php
new file mode 100644
index 00000000000..c9367d1a312
--- /dev/null
+++ b/apps/files_encryption/l10n/fr.php
@@ -0,0 +1,6 @@
+<?php $TRANSLATIONS = array(
+"Encryption" => "Chiffrement",
+"Exclude the following file types from encryption" => "Ne pas chiffrer les fichiers dont les types sont les suivants",
+"None" => "Aucun",
+"Enable Encryption" => "Activer le chiffrement"
+);
diff --git a/apps/files_encryption/l10n/it.php b/apps/files_encryption/l10n/it.php
new file mode 100644
index 00000000000..5136b061797
--- /dev/null
+++ b/apps/files_encryption/l10n/it.php
@@ -0,0 +1,6 @@
+<?php $TRANSLATIONS = array(
+"Encryption" => "Cifratura",
+"Exclude the following file types from encryption" => "Escludi i seguenti tipi di file dalla cifratura",
+"None" => "Nessuna",
+"Enable Encryption" => "Abilita cifratura"
+);
diff --git a/apps/files_encryption/l10n/ja_JP.php b/apps/files_encryption/l10n/ja_JP.php
new file mode 100644
index 00000000000..2c3e5410de3
--- /dev/null
+++ b/apps/files_encryption/l10n/ja_JP.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/lt_LT.php b/apps/files_encryption/l10n/lt_LT.php
new file mode 100644
index 00000000000..b939df164c8
--- /dev/null
+++ b/apps/files_encryption/l10n/lt_LT.php
@@ -0,0 +1,6 @@
+<?php $TRANSLATIONS = array(
+"Encryption" => "Šifravimas",
+"Exclude the following file types from encryption" => "Nešifruoti pasirinkto tipo failų",
+"None" => "Nieko",
+"Enable Encryption" => "Įjungti šifravimą"
+);
diff --git a/apps/files_encryption/l10n/nb_NO.php b/apps/files_encryption/l10n/nb_NO.php
new file mode 100644
index 00000000000..e65df7b6ce3
--- /dev/null
+++ b/apps/files_encryption/l10n/nb_NO.php
@@ -0,0 +1,6 @@
+<?php $TRANSLATIONS = array(
+"Encryption" => "Kryptering",
+"Exclude the following file types from encryption" => "Ekskluder følgende filer fra kryptering",
+"None" => "Ingen",
+"Enable Encryption" => "Slå på kryptering"
+);
diff --git a/apps/files_encryption/l10n/pl.php b/apps/files_encryption/l10n/pl.php
new file mode 100644
index 00000000000..5cfc707450e
--- /dev/null
+++ b/apps/files_encryption/l10n/pl.php
@@ -0,0 +1,6 @@
+<?php $TRANSLATIONS = array(
+"Encryption" => "Szyfrowanie",
+"Exclude the following file types from encryption" => "Wyłącz następujące typy plików z szyfrowania",
+"None" => "Brak",
+"Enable Encryption" => "Włącz szyfrowanie"
+);
diff --git a/apps/files_encryption/l10n/sl.php b/apps/files_encryption/l10n/sl.php
new file mode 100644
index 00000000000..65807910e10
--- /dev/null
+++ b/apps/files_encryption/l10n/sl.php
@@ -0,0 +1,6 @@
+<?php $TRANSLATIONS = array(
+"Encryption" => "Šifriranje",
+"Exclude the following file types from encryption" => "Naslednje vrste datotek naj se ne šifrirajo",
+"None" => "Brez",
+"Enable Encryption" => "Omogoči šifriranje"
+);
diff --git a/apps/files_encryption/l10n/sv.php b/apps/files_encryption/l10n/sv.php
new file mode 100644
index 00000000000..0a477f83460
--- /dev/null
+++ b/apps/files_encryption/l10n/sv.php
@@ -0,0 +1,6 @@
+<?php $TRANSLATIONS = array(
+"Encryption" => "Kryptering",
+"Exclude the following file types from encryption" => "Exkludera följande filtyper från kryptering",
+"None" => "Ingen",
+"Enable Encryption" => "Aktivera kryptering"
+);
diff --git a/apps/files_encryption/l10n/th_TH.php b/apps/files_encryption/l10n/th_TH.php
new file mode 100644
index 00000000000..c2685de6e3a
--- /dev/null
+++ b/apps/files_encryption/l10n/th_TH.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 7d39d926678..849e88ee0b2 100644
--- a/apps/files_encryption/lib/crypt.php
+++ b/apps/files_encryption/lib/crypt.php
@@ -3,7 +3,7 @@
* ownCloud
*
* @author Frank Karlitschek
- * @copyright 2010 Frank Karlitschek karlitschek@kde.org
+ * @copyright 2012 Frank Karlitschek frank@owncloud.org
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
@@ -58,6 +58,7 @@ class OC_Crypt {
$_SESSION['enckey']=OC_Crypt::decrypt($key, $password);
}
+
/**
* get the blowfish encryption handeler for a key
* @param string $key (optional)
diff --git a/apps/files_encryption/lib/cryptstream.php b/apps/files_encryption/lib/cryptstream.php
index 9949c1896a8..46471911d94 100644
--- a/apps/files_encryption/lib/cryptstream.php
+++ b/apps/files_encryption/lib/cryptstream.php
@@ -31,9 +31,7 @@ class OC_CryptStream{
public static $sourceStreams=array();
private $source;
private $path;
- private $readBuffer;//for streams that dont support seeking
private $meta=array();//header/meta for source stream
- private $count;
private $writeCache;
private $size;
private static $rootView;
@@ -100,7 +98,6 @@ class OC_CryptStream{
public function stream_write($data){
$length=strlen($data);
- $written=0;
$currentPos=ftell($this->source);
if($this->writeCache){
$data=$this->writeCache.$data;
@@ -170,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 633ae6b93d6..f25e4a662f6 100644
--- a/apps/files_encryption/lib/proxy.php
+++ b/apps/files_encryption/lib/proxy.php
@@ -59,7 +59,7 @@ class OC_FileProxy_Encryption extends OC_FileProxy{
* @return bool
*/
private static function isEncrypted($path){
- $metadata=OC_FileCache::getCached($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){
if(self::isEncrypted($path)){
- $cached=OC_FileCache::getCached($path,'/');
+ $cached=OC_FileCache_Cached::get($path,'');
$data=OC_Crypt::blockDecrypt($data,'',$cached['size']);
}
return $data;
@@ -113,7 +113,7 @@ class OC_FileProxy_Encryption extends OC_FileProxy{
public function postStat($path,$data){
if(self::isEncrypted($path)){
- $cached=OC_FileCache::getCached($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::getCached($path,'/');
+ $cached=OC_FileCache_Cached::get($path,'');
return $cached['size'];
}else{
return $size;
diff --git a/apps/files_encryption/templates/settings.php b/apps/files_encryption/templates/settings.php
index 25b5a06f56c..79780d694cf 100644
--- a/apps/files_encryption/templates/settings.php
+++ b/apps/files_encryption/templates/settings.php
@@ -7,6 +7,6 @@
<option selected="selected" value="<?php echo $type;?>"><?php echo $type;?></option>
<?php endforeach;?>
</select>
- <input type='checkbox' id='enbale_encryption' <?php if($_['encryption_enabled']){echo 'checked="checked"';} ?>></input><label for='enbale_encryption'><?php echo $l->t('Enable Encryption')?></label>
+ <input type='checkbox' id='enable_encryption' <?php if($_['encryption_enabled']){echo 'checked="checked"';} ?>></input><label for='enable_encryption'><?php echo $l->t('Enable Encryption')?></label>
</fieldset>
</form>
diff --git a/apps/files_encryption/tests/proxy.php b/apps/files_encryption/tests/proxy.php
index fcfc4cfb9f0..5463836a209 100644
--- a/apps/files_encryption/tests/proxy.php
+++ b/apps/files_encryption/tests/proxy.php
@@ -11,6 +11,8 @@ class Test_CryptProxy extends UnitTestCase {
private $oldKey;
public function setUp(){
+ $user=OC_User::getUser();
+
$this->oldConfig=OCP\Config::getAppValue('files_encryption','enable_encryption','true');
OCP\Config::setAppValue('files_encryption','enable_encryption','true');
$this->oldKey=isset($_SESSION['enckey'])?$_SESSION['enckey']:null;
@@ -30,10 +32,12 @@ class Test_CryptProxy extends UnitTestCase {
OC_Filesystem::clearMounts();
OC_Filesystem::mount('OC_Filestorage_Temporary',array(),'/');
+ OC_Filesystem::init('/'.$user.'/files');
+
//set up the users home folder in the temp storage
$rootView=new OC_FilesystemView('');
- $rootView->mkdir('/'.OC_User::getUser());
- $rootView->mkdir('/'.OC_User::getUser().'/files');
+ $rootView->mkdir('/'.$user);
+ $rootView->mkdir('/'.$user.'/files');
}
public function tearDown(){