diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2013-08-12 17:25:27 +0200 |
---|---|---|
committer | Bjoern Schiessle <schiessle@owncloud.com> | 2013-08-12 17:25:27 +0200 |
commit | 53bb89824deaf97095acf6bcc2997aa7141dd573 (patch) | |
tree | 8d1ef8a3d2d71295480c1da221fdf514097e9f1e /lib | |
parent | 0bab8935c95c249405f5b12f4724d189c4ec648b (diff) | |
download | nextcloud-server-53bb89824deaf97095acf6bcc2997aa7141dd573.tar.gz nextcloud-server-53bb89824deaf97095acf6bcc2997aa7141dd573.zip |
check if some encrypted files are left after the app was disabled and warn the user
Diffstat (limited to 'lib')
-rw-r--r-- | lib/public/util.php | 8 | ||||
-rwxr-xr-x | lib/util.php | 17 |
2 files changed, 25 insertions, 0 deletions
diff --git a/lib/public/util.php b/lib/public/util.php index 693805946ea..b33f07b55e6 100644 --- a/lib/public/util.php +++ b/lib/public/util.php @@ -123,6 +123,14 @@ class Util { } /** + * @brief check if some encrypted files are stored + * @return bool + */ + public static function encryptedFiles() { + return \OC_Util::encryptedFiles(); + } + + /** * @brief Creates an absolute url * @param string $app app * @param string $file file diff --git a/lib/util.php b/lib/util.php index 2586ad28320..cc432af62af 100755 --- a/lib/util.php +++ b/lib/util.php @@ -313,6 +313,23 @@ class OC_Util { } /** + * @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 */ |