aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_encryption/hooks/hooks.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_encryption/hooks/hooks.php')
-rw-r--r--apps/files_encryption/hooks/hooks.php23
1 files changed, 9 insertions, 14 deletions
diff --git a/apps/files_encryption/hooks/hooks.php b/apps/files_encryption/hooks/hooks.php
index b2a17f6bca5..a37bd5728c1 100644
--- a/apps/files_encryption/hooks/hooks.php
+++ b/apps/files_encryption/hooks/hooks.php
@@ -30,9 +30,6 @@ use OC\Files\Filesystem;
*/
class Hooks {
- // TODO: use passphrase for encrypting private key that is separate to
- // the login password
-
/**
* @brief Startup encryption backend upon user login
* @note This method should never be called for users using client side encryption
@@ -40,9 +37,9 @@ class Hooks {
public static function login($params) {
$l = new \OC_L10N('files_encryption');
//check if all requirements are met
- if(!Helper::checkRequirements() ) {
+ if(!Helper::checkRequirements() || !Helper::checkConfiguration() ) {
$error_msg = $l->t("Missing requirements.");
- $hint = $l->t('Please make sure that PHP 5.3.3 or newer is installed and that the OpenSSL PHP extension is enabled and configured properly. For now, the encryption app has been disabled.');
+ $hint = $l->t('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.');
\OC_App::disable('files_encryption');
\OCP\Util::writeLog('Encryption library', $error_msg . ' ' . $hint, \OCP\Util::ERROR);
\OCP\Template::printErrorPage($error_msg, $hint);
@@ -238,6 +235,7 @@ class Hooks {
*/
public static function preShared($params) {
+ $l = new \OC_L10N('files_encryption');
$users = array();
$view = new \OC\Files\View('/public-keys/');
@@ -250,21 +248,18 @@ class Hooks {
break;
}
- $error = false;
+ $notConfigured = array();
foreach ($users as $user) {
if (!$view->file_exists($user . '.public.key')) {
- $error = true;
- break;
+ $notConfigured[] = $user;
}
}
- if ($error) // Set flag var 'run' to notify emitting
- // script that hook execution failed
- {
- $params['run']->run = false;
+ if (count($notConfigured) > 0) {
+ $params['run'] = false;
+ $params['error'] = $l->t('Following users are not set up for encryption:') . ' ' . join(', ' , $notConfigured);
}
- // TODO: Make sure files_sharing provides user
- // feedback on failed share
+
}
/**