diff options
author | Georg Ehrke <developer@georgehrke.com> | 2013-08-19 11:24:17 +0200 |
---|---|---|
committer | Georg Ehrke <developer@georgehrke.com> | 2013-08-19 11:24:17 +0200 |
commit | f2702ff1ca45d72300eed5dfa58ebc19aa6e9910 (patch) | |
tree | b1424be17877cbd25bf3781600d353efd3dd0759 /lib/util.php | |
parent | 7e4dcd268f6cb6618600718a51c4d882e9027829 (diff) | |
parent | 9be836814cb4165ea54a086a0f97526d783bcd37 (diff) | |
download | nextcloud-server-f2702ff1ca45d72300eed5dfa58ebc19aa6e9910.tar.gz nextcloud-server-f2702ff1ca45d72300eed5dfa58ebc19aa6e9910.zip |
Merge master into oc_preview
Diffstat (limited to 'lib/util.php')
-rwxr-xr-x | lib/util.php | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/util.php b/lib/util.php index a7a83cf1a23..8c8ab496f7b 100755 --- a/lib/util.php +++ b/lib/util.php @@ -168,6 +168,10 @@ class OC_Util { * @return array arrays with error messages and hints */ public static function checkServer() { + // Assume that if checkServer() succeeded before in this session, then all is fine. + if(\OC::$session->exists('checkServer_suceeded') && \OC::$session->get('checkServer_suceeded')) + return array(); + $errors=array(); $defaults = new \OC_Defaults(); @@ -309,10 +313,30 @@ class OC_Util { 'hint'=>'Please ask your server administrator to restart the web server.'); } + // Cache the result of this function + \OC::$session->set('checkServer_suceeded', count($errors) == 0); + return $errors; } /** + * @brief check if there are still some encrypted files stored + * @return boolean + */ + public static function encryptedFiles() { + //check if encryption was enabled in the past + $encryptedFiles = false; + if (OC_App::isEnabled('files_encryption') === false) { + $view = new OC\Files\View('/' . OCP\User::getUser()); + if ($view->file_exists('/files_encryption/keyfiles')) { + $encryptedFiles = true; + } + } + + return $encryptedFiles; + } + + /** * Check for correct file permissions of data directory * @return array arrays with error messages and hints */ |