*/\r
public static function login($params) {\r
$l = new \OC_L10N('files_encryption');\r
- //check if all requirements are met\r
- if(!Helper::checkRequirements() || !Helper::checkConfiguration() ) {\r
- $error_msg = $l->t("Missing requirements.");\r
- $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.');\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
\r
$util = new Util($view, $params['uid']);\r
\r
+ //check if all requirements are met\r
+ if(!$util->ready() && (!Helper::checkRequirements() || !Helper::checkConfiguration())) {\r
+ $error_msg = $l->t("Missing requirements.");\r
+ $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.');\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
// setup user, if user not ready force relogin\r
if (Helper::setupUser($util, $params['password']) === false) {\r
return false;\r
/**
* Create an openssl pkey with config-supplied settings
+ * WARNING: This initializes and caches a new private keypair, which is computationally expensive
* @return resource The pkey resource created
*/
public static function getOpenSSLPkey() {
- static $res = null;
- if (is_null($res)) {
- $res = openssl_pkey_new(self::getOpenSSLConfig());
- }
- return $res;
+ return openssl_pkey_new(self::getOpenSSLConfig());
}
/**