]> source.dussan.org Git - nextcloud-server.git/commitdiff
loginname is not necessarily username
authorArthur Schiwon <blizzz@owncloud.com>
Thu, 28 Nov 2013 12:26:31 +0000 (13:26 +0100)
committerArthur Schiwon <blizzz@owncloud.com>
Thu, 28 Nov 2013 12:26:31 +0000 (13:26 +0100)
apps/files_encryption/ajax/getMigrationStatus.php

index 4da035a97d46ffd41e8fd8cb99ef0a9c8e2b037b..17469a1af0c2e7979306d8008a343bb99c8bba2a 100644 (file)
@@ -10,14 +10,15 @@ use OCA\Encryption\Util;
 
 \OCP\JSON::checkAppEnabled('files_encryption');
 
-$user = isset($_POST['user']) ? $_POST['user'] : '';
+$loginname = isset($_POST['user']) ? $_POST['user'] : '';
 $password = isset($_POST['password']) ? $_POST['password'] : '';
 
 $migrationCompleted = true;
 
-if ($user !== '' && $password !== '') {
-       if (\OCP\User::checkPassword($user, $password)) {
-               $util = new Util(new \OC_FilesystemView('/'), $user);
+if ($loginname !== '' && $password !== '') {
+       $username = \OCP\User::checkPassword($loginname, $password);
+       if ($username) {
+               $util = new Util(new \OC_FilesystemView('/'), $username);
                if ($util->getMigrationStatus() !== Util::MIGRATION_COMPLETED) {
                        $migrationCompleted = false;
                }