From f95da8ba592ad45b802997b74693565292524259 Mon Sep 17 00:00:00 2001
From: Bjoern Schiessle
Date: Tue, 24 Sep 2013 13:08:55 +0200
Subject: [PATCH] don't remember login if the encrypion app is enabled because
the user needs to log-in again in order to decrypt his private key with his
password
Conflicts:
core/templates/login.php
lib/util.php
---
core/templates/login.php | 2 ++
lib/base.php | 1 +
lib/util.php | 27 ++++++++++++++++++++++-----
3 files changed, 25 insertions(+), 5 deletions(-)
diff --git a/core/templates/login.php b/core/templates/login.php
index 882ce234cf4..0bb0114f6de 100644
--- a/core/templates/login.php
+++ b/core/templates/login.php
@@ -35,8 +35,10 @@
+
+
diff --git a/lib/base.php b/lib/base.php
index 5a1bd4ecbe3..c9551cd2749 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -746,6 +746,7 @@ class OC {
|| !isset($_COOKIE["oc_token"])
|| !isset($_COOKIE["oc_username"])
|| !$_COOKIE["oc_remember_login"]
+ || OC_App::isEnabled('files_encryption')
) {
return false;
}
diff --git a/lib/util.php b/lib/util.php
index 71921f0aedd..7657b234687 100755
--- a/lib/util.php
+++ b/lib/util.php
@@ -312,9 +312,27 @@ class OC_Util {
}
/**
- * Check for correct file permissions of data directory
- * @return array arrays with error messages and hints
- */
+ * @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;
+ }
+
+ /**
+ * @brief Check for correct file permissions of data directory
+ * @paran string $dataDirectory
+ * @return array arrays with error messages and hints
+ */
public static function checkDataDirectoryPermissions($dataDirectory) {
$errors = array();
if (stristr(PHP_OS, 'WIN')) {
@@ -354,6 +372,7 @@ class OC_Util {
}
$parameters['alt_login'] = OC_App::getAlternativeLogIns();
+ $parameters['encryption_enabled'] = OC_App::isEnabled('files_encryption');
OC_Template::printGuestPage("", "login", $parameters);
}
@@ -536,7 +555,6 @@ class OC_Util {
return $value;
}
-
/**
* Check if the htaccess file is working by creating a test file in the data directory and trying to access via http
*/
@@ -677,7 +695,6 @@ class OC_Util {
}
}
-
}
/**
--
2.39.5