diff options
author | Morris Jobke <morris.jobke@gmail.com> | 2013-09-30 06:55:56 -0700 |
---|---|---|
committer | Morris Jobke <morris.jobke@gmail.com> | 2013-09-30 06:55:56 -0700 |
commit | d4fed61871a6dc2a3f74a0cccc8e8072b267290d (patch) | |
tree | a23401244c03eaa86d778a8e7236083b8a792eb3 /lib/util.php | |
parent | 480aeb804fc64be6fdcb1551f89e21304e270b33 (diff) | |
parent | 03d5ea6cec4e88dad36648a931ff0f39a1da23ee (diff) | |
download | nextcloud-server-d4fed61871a6dc2a3f74a0cccc8e8072b267290d.tar.gz nextcloud-server-d4fed61871a6dc2a3f74a0cccc8e8072b267290d.zip |
Merge pull request #5012 from owncloud/check_keyfiles_exists
check not only if the keyfile folder exists but also if it contains keyfiles
Diffstat (limited to 'lib/util.php')
-rwxr-xr-x | lib/util.php | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/lib/util.php b/lib/util.php index d4f4eed1ca7..6be56d07c9a 100755 --- a/lib/util.php +++ b/lib/util.php @@ -410,14 +410,18 @@ class OC_Util { $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; + $keyfilePath = '/files_encryption/keyfiles'; + if ($view->is_dir($keyfilePath)) { + $dircontent = $view->getDirectoryContent($keyfilePath); + if (!empty($dircontent)) { + $encryptedFiles = true; + } } } - + return $encryptedFiles; } - + /** * @brief Check for correct file permissions of data directory * @paran string $dataDirectory @@ -654,16 +658,16 @@ class OC_Util { } return $value; } - + /** * @brief Public function to encode url parameters * * This function is used to encode path to file before output. * Encoding is done according to RFC 3986 with one exception: - * Character '/' is preserved as is. + * Character '/' is preserved as is. * * @param string $component part of URI to encode - * @return string + * @return string */ public static function encodePath($component) { $encoded = rawurlencode($component); @@ -801,7 +805,7 @@ class OC_Util { } } } - + /** * @brief Check if the connection to the internet is disabled on purpose * @return bool |