}
$view = new OC_FilesystemView('/');
- $session = new \OCA\Encryption\Session($view);
+
+ $sessionReady = false;
+ if(extension_loaded("openssl")) {
+ $session = new \OCA\Encryption\Session($view);
+ $sessionReady = true;
+ }
$user = \OCP\USER::getUser();
// check if user has a private key
- if (
- !$view->file_exists('/' . $user . '/files_encryption/' . $user . '.private.key')
- && OCA\Encryption\Crypt::mode() === 'server'
+ if ($sessionReady === false
+ || (!$view->file_exists('/' . $user . '/files_encryption/' . $user . '.private.key')
+ && OCA\Encryption\Crypt::mode() === 'server')
) {
// Force the user to log-in again if the encryption key isn't unlocked
* @note This method should never be called for users using client side encryption\r
*/\r
public static function login($params) {\r
-\r
- // Manually initialise Filesystem{} singleton with correct \r
- // fake root path, in order to avoid fatal webdav errors\r
- // NOTE: disabled because this give errors on webdav!\r
- //\OC\Files\Filesystem::init( $params['uid'], '/' . 'files' . '/' );\r
+ $l = new \OC_L10N('files_encryption');\r
+ //check if openssl is available\r
+ if(!extension_loaded("openssl") ) {\r
+ $error_msg = $l->t("PHP module OpenSSL is not installed.");\r
+ $hint = $l->t('Please ask your server administrator to install the module. For now the encryption app was disabled.');\r
+ \OC_App::disable('files_encryption');\r
+ \OCP\Util::writeLog('Encryption library', $error_msg . ' ' . $hint, \OCP\Util::ERROR);\r
+ \OCP\Template::printErrorPage($error_msg, $hint);\r
+ }\r
\r
$view = new \OC_FilesystemView('/');\r
\r