]> source.dussan.org Git - nextcloud-server.git/commitdiff
don't remember login if the encrypion app is enabled because the user
authorBjoern Schiessle <schiessle@owncloud.com>
Tue, 24 Sep 2013 11:08:55 +0000 (13:08 +0200)
committerBjoern Schiessle <schiessle@owncloud.com>
Mon, 30 Sep 2013 19:45:22 +0000 (21:45 +0200)
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
lib/base.php
lib/util.php

index 882ce234cf46922176d2826a740620f876532752..0bb0114f6de3b9b6d216389382029672336ed996 100644 (file)
                        <label for="password" class="infield"><?php p($l->t('Password')); ?></label>
                        <img class="svg" id="password-icon" src="<?php print_unescaped(image_path('', 'actions/password.svg')); ?>" alt=""/>
                </p>
+               <?php if ($_['encryption_enabled'] === false) : ?>
                <input type="checkbox" name="remember_login" value="1" id="remember_login" checked /><label
                        for="remember_login"><?php p($l->t('remember')); ?></label>
+               <?php endif; ?>
                <input type="hidden" name="timezone-offset" id="timezone-offset"/>
                <input type="submit" id="submit" class="login primary" value="<?php p($l->t('Log in')); ?>"/>
        </fieldset>
index 5a1bd4ecbe391d2fa8014f876d33292f005b66d4..c9551cd2749ab44093b8b5ecf36a6fb7d950d304 100644 (file)
@@ -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;
                }
index 71921f0aeddfcc0050b1a6c6fb3df373a702514e..7657b234687c60611cb6636ef24a648ff363d126 100755 (executable)
@@ -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 {
                        }
 
                }
-
        }
 
        /**