Skip to content
Snippets Groups Projects
Commit 72eaf289 authored by Björn Schießle's avatar Björn Schießle
Browse files

performance improvement, check configuration only if no private key exists

parent 4dbc7870
No related branches found
No related tags found
No related merge requests found
...@@ -44,13 +44,18 @@ class Hooks { ...@@ -44,13 +44,18 @@ class Hooks {
\OC_Util::setupFS($params['uid']); \OC_Util::setupFS($params['uid']);
} }
//check if all requirements are met $privateKey = \OCA\Encryption\Keymanager::getPrivateKey($view, $params['uid']);
if(!Helper::checkRequirements() || !Helper::checkConfiguration()) {
$error_msg = $l->t("Missing requirements."); // if no private key exists, check server configuration
$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.'); if(!$privateKey) {
\OC_App::disable('files_encryption'); //check if all requirements are met
\OCP\Util::writeLog('Encryption library', $error_msg . ' ' . $hint, \OCP\Util::ERROR); if(!Helper::checkRequirements() || !Helper::checkConfiguration()) {
\OCP\Template::printErrorPage($error_msg, $hint); $error_msg = $l->t("Missing requirements.");
$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);
}
} }
$util = new Util($view, $params['uid']); $util = new Util($view, $params['uid']);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment