aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_encryption
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_encryption')
-rw-r--r--apps/files_encryption/files/error.php3
-rw-r--r--apps/files_encryption/hooks/hooks.php62
-rw-r--r--apps/files_encryption/l10n/ca.php6
-rw-r--r--apps/files_encryption/l10n/mk.php16
-rw-r--r--apps/files_encryption/lib/util.php13
-rw-r--r--apps/files_encryption/settings-admin.php4
6 files changed, 84 insertions, 20 deletions
diff --git a/apps/files_encryption/files/error.php b/apps/files_encryption/files/error.php
index 61574edf509..317cea05a12 100644
--- a/apps/files_encryption/files/error.php
+++ b/apps/files_encryption/files/error.php
@@ -12,7 +12,8 @@ if (!isset($_)) { //also provide standalone error page
$errorMsg = $l->t('Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app.');
break;
case \OCA\Encryption\Crypt::ENCRYPTION_PRIVATE_KEY_NOT_VALID_ERROR:
- $errorMsg = $l->t('Your private key is not valid! Likely your password was changed outside the ownCloud system (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files.');
+ $theme = new OC_Defaults();
+ $errorMsg = $l->t('Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files.', array($theme->getName()));
break;
case \OCA\Encryption\Crypt::ENCRYPTION_NO_SHARE_KEY_FOUND:
$errorMsg = $l->t('Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you.');
diff --git a/apps/files_encryption/hooks/hooks.php b/apps/files_encryption/hooks/hooks.php
index 6e2d360917b..35574b8e5b9 100644
--- a/apps/files_encryption/hooks/hooks.php
+++ b/apps/files_encryption/hooks/hooks.php
@@ -35,6 +35,12 @@ class Hooks {
* @note This method should never be called for users using client side encryption
*/
public static function login($params) {
+
+ if (\OCP\App::isEnabled('files_encryption') === false) {
+ return true;
+ }
+
+
$l = new \OC_L10N('files_encryption');
$view = new \OC_FilesystemView('/');
@@ -117,11 +123,12 @@ class Hooks {
* @note This method should never be called for users using client side encryption
*/
public static function postCreateUser($params) {
- $view = new \OC_FilesystemView('/');
-
- $util = new Util($view, $params['uid']);
- Helper::setupUser($util, $params['password']);
+ if (\OCP\App::isEnabled('files_encryption')) {
+ $view = new \OC_FilesystemView('/');
+ $util = new Util($view, $params['uid']);
+ Helper::setupUser($util, $params['password']);
+ }
}
/**
@@ -129,26 +136,31 @@ class Hooks {
* @note This method should never be called for users using client side encryption
*/
public static function postDeleteUser($params) {
- $view = new \OC_FilesystemView('/');
- // cleanup public key
- $publicKey = '/public-keys/' . $params['uid'] . '.public.key';
+ if (\OCP\App::isEnabled('files_encryption')) {
+ $view = new \OC_FilesystemView('/');
- // Disable encryption proxy to prevent recursive calls
- $proxyStatus = \OC_FileProxy::$enabled;
- \OC_FileProxy::$enabled = false;
+ // cleanup public key
+ $publicKey = '/public-keys/' . $params['uid'] . '.public.key';
- $view->unlink($publicKey);
+ // Disable encryption proxy to prevent recursive calls
+ $proxyStatus = \OC_FileProxy::$enabled;
+ \OC_FileProxy::$enabled = false;
- \OC_FileProxy::$enabled = $proxyStatus;
+ $view->unlink($publicKey);
+
+ \OC_FileProxy::$enabled = $proxyStatus;
+ }
}
/**
* @brief If the password can't be changed within ownCloud, than update the key password in advance.
*/
public static function preSetPassphrase($params) {
- if ( ! \OC_User::canUserChangePassword($params['uid']) ) {
- self::setPassphrase($params);
+ if (\OCP\App::isEnabled('files_encryption')) {
+ if ( ! \OC_User::canUserChangePassword($params['uid']) ) {
+ self::setPassphrase($params);
+ }
}
}
@@ -157,6 +169,11 @@ class Hooks {
* @param array $params keys: uid, password
*/
public static function setPassphrase($params) {
+
+ if (\OCP\App::isEnabled('files_encryption') === false) {
+ return true;
+ }
+
// Only attempt to change passphrase if server-side encryption
// is in use (client-side encryption does not have access to
// the necessary keys)
@@ -227,6 +244,10 @@ class Hooks {
*/
public static function preShared($params) {
+ if (\OCP\App::isEnabled('files_encryption') === false) {
+ return true;
+ }
+
$l = new \OC_L10N('files_encryption');
$users = array();
$view = new \OC\Files\View('/public-keys/');
@@ -278,6 +299,10 @@ class Hooks {
// [run] => whether emitting script should continue to run
// TODO: Should other kinds of item be encrypted too?
+ if (\OCP\App::isEnabled('files_encryption') === false) {
+ return true;
+ }
+
if ($params['itemType'] === 'file' || $params['itemType'] === 'folder') {
$view = new \OC_FilesystemView('/');
@@ -372,6 +397,10 @@ class Hooks {
// [shareWith] => test1
// [itemParent] =>
+ if (\OCP\App::isEnabled('files_encryption') === false) {
+ return true;
+ }
+
if ($params['itemType'] === 'file' || $params['itemType'] === 'folder') {
$view = new \OC_FilesystemView('/');
@@ -453,6 +482,11 @@ class Hooks {
* of the stored versions along the actual file
*/
public static function postRename($params) {
+
+ if (\OCP\App::isEnabled('files_encryption') === false) {
+ return true;
+ }
+
// Disable encryption proxy to prevent recursive calls
$proxyStatus = \OC_FileProxy::$enabled;
\OC_FileProxy::$enabled = false;
diff --git a/apps/files_encryption/l10n/ca.php b/apps/files_encryption/l10n/ca.php
index d55c5f6d302..61f45daee43 100644
--- a/apps/files_encryption/l10n/ca.php
+++ b/apps/files_encryption/l10n/ca.php
@@ -8,20 +8,26 @@ $TRANSLATIONS = array(
"Could not change the password. Maybe the old password was not correct." => "No s'ha pogut canviar la contrasenya. Potser la contrasenya anterior no era correcta.",
"Private key password successfully updated." => "La contrasenya de la clau privada s'ha actualitzat.",
"Could not update the private key password. Maybe the old password was not correct." => "No s'ha pogut actualitzar la contrasenya de la clau privada. Potser la contrasenya anterior no era correcta.",
+"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." => "L'aplicació d'encriptació no està inicialitzada! Potser l'aplicació d'encriptació ha estat reiniciada durant la sessió. Intenteu sortir i acreditar-vos de nou per reinicialitzar l'aplicació d'encriptació.",
"Your private key is not valid! Likely your password was changed outside the ownCloud system (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "La clau privada no és vàlida! Probablement la contrasenya va ser canviada des de fora del sistema ownCloud (per exemple, en el directori de l'empresa). Vostè pot actualitzar la contrasenya de clau privada en la seva configuració personal per poder recuperar l'accés en els arxius xifrats.",
+"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "No es pot desencriptar aquest fitxer, probablement és un fitxer compartit. Demaneu al propietari del fitxer que el comparteixi de nou amb vós.",
+"Unknown error please check your system settings or contact your administrator" => "Error desconegut. Comproveu l'arranjament del sistema o contacteu amb l'administrador",
"Missing requirements." => "Manca de requisits.",
"Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Assegureu-vos que teniu instal·lat PHP 5.3.3 o una versió superior i que està activat Open SSL i habilitada i configurada correctament l'extensió de PHP. De moment, l'aplicació d'encriptació s'ha desactivat.",
"Following users are not set up for encryption:" => "Els usuaris següents no estan configurats per a l'encriptació:",
"Saving..." => "Desant...",
+"Go directly to your " => "Vés directament a",
"personal settings" => "arranjament personal",
"Encryption" => "Xifrat",
"Enable recovery key (allow to recover users files in case of password loss):" => "Activa la clau de recuperació (permet recuperar fitxers d'usuaris en cas de pèrdua de contrasenya):",
"Recovery key password" => "Clau de recuperació de la contrasenya",
+"Repeat Recovery key password" => "Repetiu la clau de recuperació de contrasenya",
"Enabled" => "Activat",
"Disabled" => "Desactivat",
"Change recovery key password:" => "Canvia la clau de recuperació de contrasenya:",
"Old Recovery key password" => "Antiga clau de recuperació de contrasenya",
"New Recovery key password" => "Nova clau de recuperació de contrasenya",
+"Repeat New Recovery key password" => "Repetiu la nova clau de recuperació de contrasenya",
"Change Password" => "Canvia la contrasenya",
"Your private key password no longer match your log-in password:" => "La clau privada ja no es correspon amb la contrasenya d'accés:",
"Set your old private key password to your current log-in password." => "Establiu la vostra contrasenya clau en funció de la contrasenya actual d'accés.",
diff --git a/apps/files_encryption/l10n/mk.php b/apps/files_encryption/l10n/mk.php
index fd8dd4e51c1..098f4d635ba 100644
--- a/apps/files_encryption/l10n/mk.php
+++ b/apps/files_encryption/l10n/mk.php
@@ -1,6 +1,20 @@
<?php
$TRANSLATIONS = array(
+"Password successfully changed." => "Лозинката е успешно променета.",
+"Could not change the password. Maybe the old password was not correct." => "Лозинката не можеше да се промени. Можеби старата лозинка не беше исправна.",
+"Missing requirements." => "Барања кои недостасуваат.",
"Saving..." => "Снимам...",
-"Encryption" => "Енкрипција"
+"Go directly to your " => "Одете директно на вашиот",
+"personal settings" => "лични подесувања",
+"Encryption" => "Енкрипција",
+"Repeat Recovery key password" => "Повтори ја лозинката за клучот на обновување",
+"Enabled" => "Овозможен",
+"Disabled" => "Оневозможен",
+"Old Recovery key password" => "Старата лозинка за клучот на обновување ",
+"Repeat New Recovery key password" => "Повтори ја лозинката за клучот на обновувањето",
+"Change Password" => "Смени лозинка",
+"Old log-in password" => "Старата лозинка за најавување",
+"Current log-in password" => "Тековната лозинка за најавување",
+"Enable password recovery:" => "Овозможи го обновувањето на лозинката:"
);
$PLURAL_FORMS = "nplurals=2; plural=(n % 10 == 1 && n % 100 != 11) ? 0 : 1;";
diff --git a/apps/files_encryption/lib/util.php b/apps/files_encryption/lib/util.php
index 0d34af043a1..5e855abd973 100644
--- a/apps/files_encryption/lib/util.php
+++ b/apps/files_encryption/lib/util.php
@@ -205,7 +205,7 @@ class Util {
$this->userId,
'server-side',
0,
- 0
+ self::MIGRATION_OPEN
);
$query = \OCP\DB::prepare($sql);
$query->execute($args);
@@ -1285,6 +1285,17 @@ class Util {
// If no record is found
if (empty($migrationStatus)) {
\OCP\Util::writeLog('Encryption library', "Could not get migration status for " . $this->userId . ", no record found", \OCP\Util::ERROR);
+ // insert missing entry in DB with status open
+ $sql = 'INSERT INTO `*PREFIX*encryption` (`uid`,`mode`,`recovery_enabled`,`migration_status`) VALUES (?,?,?,?)';
+ $args = array(
+ $this->userId,
+ 'server-side',
+ 0,
+ self::MIGRATION_OPEN
+ );
+ $query = \OCP\DB::prepare($sql);
+ $query->execute($args);
+
return self::MIGRATION_OPEN;
// If a record is found
} else {
diff --git a/apps/files_encryption/settings-admin.php b/apps/files_encryption/settings-admin.php
index 53676058982..9ad9bfb8877 100644
--- a/apps/files_encryption/settings-admin.php
+++ b/apps/files_encryption/settings-admin.php
@@ -11,9 +11,7 @@
$tmpl = new OCP\Template('files_encryption', 'settings-admin');
// Check if an adminRecovery account is enabled for recovering files after lost pwd
-$view = new OC_FilesystemView('');
-
-$recoveryAdminEnabled = OC_Appconfig::getValue('files_encryption', 'recoveryAdminEnabled');
+$recoveryAdminEnabled = OC_Appconfig::getValue('files_encryption', 'recoveryAdminEnabled', '0');
$tmpl->assign('recoveryEnabled', $recoveryAdminEnabled);