diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2013-08-01 13:04:55 +0200 |
---|---|---|
committer | Bjoern Schiessle <schiessle@owncloud.com> | 2013-08-01 13:04:55 +0200 |
commit | 9253627327a35c9446f413bc487c2d7b0f63f9af (patch) | |
tree | 44e2ebe68a69a96278fa34a65a893901717d4ec1 /apps | |
parent | 30963d60bc0bb206fc55d27f04b505ed59e0892d (diff) | |
download | nextcloud-server-9253627327a35c9446f413bc487c2d7b0f63f9af.tar.gz nextcloud-server-9253627327a35c9446f413bc487c2d7b0f63f9af.zip |
cancel sharing if some users doesn't have a working encryption set-up.
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_encryption/hooks/hooks.php | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/apps/files_encryption/hooks/hooks.php b/apps/files_encryption/hooks/hooks.php index b2a17f6bca5..be95037784e 100644 --- a/apps/files_encryption/hooks/hooks.php +++ b/apps/files_encryption/hooks/hooks.php @@ -250,21 +250,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'] = 'Following users are not set up for encryption: ' . join(', ' , $notConfigured);
}
- // TODO: Make sure files_sharing provides user
- // feedback on failed share
+
}
/**
|