Passed
Push — master ( aa003d...f49ccd )
by Joas
13:35 queued 12s
created
lib/private/Authentication/Login/CompleteLoginCommand.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -28,23 +28,23 @@
 block discarded – undo
28 28
 
29 29
 class CompleteLoginCommand extends ALoginCommand {
30 30
 
31
-	/** @var Session */
32
-	private $userSession;
33
-
34
-	public function __construct(Session $userSession) {
35
-		$this->userSession = $userSession;
36
-	}
37
-
38
-	public function process(LoginData $loginData): LoginResult {
39
-		$this->userSession->completeLogin(
40
-			$loginData->getUser(),
41
-			[
42
-				'loginName' => $loginData->getUsername(),
43
-				'password' => $loginData->getPassword(),
44
-			]
45
-		);
46
-
47
-		return $this->processNextOrFinishSuccessfully($loginData);
48
-	}
31
+    /** @var Session */
32
+    private $userSession;
33
+
34
+    public function __construct(Session $userSession) {
35
+        $this->userSession = $userSession;
36
+    }
37
+
38
+    public function process(LoginData $loginData): LoginResult {
39
+        $this->userSession->completeLogin(
40
+            $loginData->getUser(),
41
+            [
42
+                'loginName' => $loginData->getUsername(),
43
+                'password' => $loginData->getPassword(),
44
+            ]
45
+        );
46
+
47
+        return $this->processNextOrFinishSuccessfully($loginData);
48
+    }
49 49
 
50 50
 }
Please login to merge, or discard this patch.
lib/private/Authentication/Login/EmailLoginCommand.php 1 patch
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -29,33 +29,33 @@
 block discarded – undo
29 29
 
30 30
 class EmailLoginCommand extends ALoginCommand {
31 31
 
32
-	/** @var IUserManager */
33
-	private $userManager;
34
-
35
-	public function __construct(IUserManager $userManager) {
36
-		$this->userManager = $userManager;
37
-	}
38
-
39
-	public function process(LoginData $loginData): LoginResult {
40
-		if ($loginData->getUser() === false) {
41
-			$users = $this->userManager->getByEmail($loginData->getUsername());
42
-			// we only allow login by email if unique
43
-			if (count($users) === 1) {
44
-				$username = $users[0]->getUID();
45
-				if ($username !== $loginData->getUsername()) {
46
-					$user = $this->userManager->checkPassword(
47
-						$username,
48
-						$loginData->getPassword()
49
-					);
50
-					if ($user !== false) {
51
-						$loginData->setUser($user);
52
-						$loginData->setUsername($username);
53
-					}
54
-				}
55
-			}
56
-		}
57
-
58
-		return $this->processNextOrFinishSuccessfully($loginData);
59
-	}
32
+    /** @var IUserManager */
33
+    private $userManager;
34
+
35
+    public function __construct(IUserManager $userManager) {
36
+        $this->userManager = $userManager;
37
+    }
38
+
39
+    public function process(LoginData $loginData): LoginResult {
40
+        if ($loginData->getUser() === false) {
41
+            $users = $this->userManager->getByEmail($loginData->getUsername());
42
+            // we only allow login by email if unique
43
+            if (count($users) === 1) {
44
+                $username = $users[0]->getUID();
45
+                if ($username !== $loginData->getUsername()) {
46
+                    $user = $this->userManager->checkPassword(
47
+                        $username,
48
+                        $loginData->getPassword()
49
+                    );
50
+                    if ($user !== false) {
51
+                        $loginData->setUser($user);
52
+                        $loginData->setUsername($username);
53
+                    }
54
+                }
55
+            }
56
+        }
57
+
58
+        return $this->processNextOrFinishSuccessfully($loginData);
59
+    }
60 60
 
61 61
 }
Please login to merge, or discard this patch.
lib/private/Authentication/Login/Chain.php 1 patch
Indentation   +80 added lines, -80 removed lines patch added patch discarded remove patch
@@ -27,85 +27,85 @@
 block discarded – undo
27 27
 
28 28
 class Chain {
29 29
 
30
-	/** @var PreLoginHookCommand */
31
-	private $preLoginHookCommand;
32
-
33
-	/** @var UserDisabledCheckCommand */
34
-	private $userDisabledCheckCommand;
35
-
36
-	/** @var UidLoginCommand */
37
-	private $uidLoginCommand;
38
-
39
-	/** @var EmailLoginCommand */
40
-	private $emailLoginCommand;
41
-
42
-	/** @var LoggedInCheckCommand */
43
-	private $loggedInCheckCommand;
44
-
45
-	/** @var CompleteLoginCommand */
46
-	private $completeLoginCommand;
47
-
48
-	/** @var CreateSessionTokenCommand */
49
-	private $createSessionTokenCommand;
50
-
51
-	/** @var ClearLostPasswordTokensCommand */
52
-	private $clearLostPasswordTokensCommand;
53
-
54
-	/** @var UpdateLastPasswordConfirmCommand */
55
-	private $updateLastPasswordConfirmCommand;
56
-
57
-	/** @var SetUserTimezoneCommand */
58
-	private $setUserTimezoneCommand;
59
-
60
-	/** @var TwoFactorCommand */
61
-	private $twoFactorCommand;
62
-
63
-	/** @var FinishRememberedLoginCommand */
64
-	private $finishRememberedLoginCommand;
65
-
66
-	public function __construct(PreLoginHookCommand $preLoginHookCommand,
67
-								UserDisabledCheckCommand $userDisabledCheckCommand,
68
-								UidLoginCommand $uidLoginCommand,
69
-								EmailLoginCommand $emailLoginCommand,
70
-								LoggedInCheckCommand $loggedInCheckCommand,
71
-								CompleteLoginCommand $completeLoginCommand,
72
-								CreateSessionTokenCommand $createSessionTokenCommand,
73
-								ClearLostPasswordTokensCommand $clearLostPasswordTokensCommand,
74
-								UpdateLastPasswordConfirmCommand $updateLastPasswordConfirmCommand,
75
-								SetUserTimezoneCommand $setUserTimezoneCommand,
76
-								TwoFactorCommand $twoFactorCommand,
77
-								FinishRememberedLoginCommand $finishRememberedLoginCommand
78
-	) {
79
-		$this->preLoginHookCommand = $preLoginHookCommand;
80
-		$this->userDisabledCheckCommand = $userDisabledCheckCommand;
81
-		$this->uidLoginCommand = $uidLoginCommand;
82
-		$this->emailLoginCommand = $emailLoginCommand;
83
-		$this->loggedInCheckCommand = $loggedInCheckCommand;
84
-		$this->completeLoginCommand = $completeLoginCommand;
85
-		$this->createSessionTokenCommand = $createSessionTokenCommand;
86
-		$this->clearLostPasswordTokensCommand = $clearLostPasswordTokensCommand;
87
-		$this->updateLastPasswordConfirmCommand = $updateLastPasswordConfirmCommand;
88
-		$this->setUserTimezoneCommand = $setUserTimezoneCommand;
89
-		$this->twoFactorCommand = $twoFactorCommand;
90
-		$this->finishRememberedLoginCommand = $finishRememberedLoginCommand;
91
-	}
92
-
93
-	public function process(LoginData $loginData): LoginResult {
94
-		$chain = $this->preLoginHookCommand;
95
-		$chain
96
-			->setNext($this->userDisabledCheckCommand)
97
-			->setNext($this->uidLoginCommand)
98
-			->setNext($this->emailLoginCommand)
99
-			->setNext($this->loggedInCheckCommand)
100
-			->setNext($this->completeLoginCommand)
101
-			->setNext($this->createSessionTokenCommand)
102
-			->setNext($this->clearLostPasswordTokensCommand)
103
-			->setNext($this->updateLastPasswordConfirmCommand)
104
-			->setNext($this->setUserTimezoneCommand)
105
-			->setNext($this->twoFactorCommand)
106
-			->setNext($this->finishRememberedLoginCommand);
107
-
108
-		return $chain->process($loginData);
109
-	}
30
+    /** @var PreLoginHookCommand */
31
+    private $preLoginHookCommand;
32
+
33
+    /** @var UserDisabledCheckCommand */
34
+    private $userDisabledCheckCommand;
35
+
36
+    /** @var UidLoginCommand */
37
+    private $uidLoginCommand;
38
+
39
+    /** @var EmailLoginCommand */
40
+    private $emailLoginCommand;
41
+
42
+    /** @var LoggedInCheckCommand */
43
+    private $loggedInCheckCommand;
44
+
45
+    /** @var CompleteLoginCommand */
46
+    private $completeLoginCommand;
47
+
48
+    /** @var CreateSessionTokenCommand */
49
+    private $createSessionTokenCommand;
50
+
51
+    /** @var ClearLostPasswordTokensCommand */
52
+    private $clearLostPasswordTokensCommand;
53
+
54
+    /** @var UpdateLastPasswordConfirmCommand */
55
+    private $updateLastPasswordConfirmCommand;
56
+
57
+    /** @var SetUserTimezoneCommand */
58
+    private $setUserTimezoneCommand;
59
+
60
+    /** @var TwoFactorCommand */
61
+    private $twoFactorCommand;
62
+
63
+    /** @var FinishRememberedLoginCommand */
64
+    private $finishRememberedLoginCommand;
65
+
66
+    public function __construct(PreLoginHookCommand $preLoginHookCommand,
67
+                                UserDisabledCheckCommand $userDisabledCheckCommand,
68
+                                UidLoginCommand $uidLoginCommand,
69
+                                EmailLoginCommand $emailLoginCommand,
70
+                                LoggedInCheckCommand $loggedInCheckCommand,
71
+                                CompleteLoginCommand $completeLoginCommand,
72
+                                CreateSessionTokenCommand $createSessionTokenCommand,
73
+                                ClearLostPasswordTokensCommand $clearLostPasswordTokensCommand,
74
+                                UpdateLastPasswordConfirmCommand $updateLastPasswordConfirmCommand,
75
+                                SetUserTimezoneCommand $setUserTimezoneCommand,
76
+                                TwoFactorCommand $twoFactorCommand,
77
+                                FinishRememberedLoginCommand $finishRememberedLoginCommand
78
+    ) {
79
+        $this->preLoginHookCommand = $preLoginHookCommand;
80
+        $this->userDisabledCheckCommand = $userDisabledCheckCommand;
81
+        $this->uidLoginCommand = $uidLoginCommand;
82
+        $this->emailLoginCommand = $emailLoginCommand;
83
+        $this->loggedInCheckCommand = $loggedInCheckCommand;
84
+        $this->completeLoginCommand = $completeLoginCommand;
85
+        $this->createSessionTokenCommand = $createSessionTokenCommand;
86
+        $this->clearLostPasswordTokensCommand = $clearLostPasswordTokensCommand;
87
+        $this->updateLastPasswordConfirmCommand = $updateLastPasswordConfirmCommand;
88
+        $this->setUserTimezoneCommand = $setUserTimezoneCommand;
89
+        $this->twoFactorCommand = $twoFactorCommand;
90
+        $this->finishRememberedLoginCommand = $finishRememberedLoginCommand;
91
+    }
92
+
93
+    public function process(LoginData $loginData): LoginResult {
94
+        $chain = $this->preLoginHookCommand;
95
+        $chain
96
+            ->setNext($this->userDisabledCheckCommand)
97
+            ->setNext($this->uidLoginCommand)
98
+            ->setNext($this->emailLoginCommand)
99
+            ->setNext($this->loggedInCheckCommand)
100
+            ->setNext($this->completeLoginCommand)
101
+            ->setNext($this->createSessionTokenCommand)
102
+            ->setNext($this->clearLostPasswordTokensCommand)
103
+            ->setNext($this->updateLastPasswordConfirmCommand)
104
+            ->setNext($this->setUserTimezoneCommand)
105
+            ->setNext($this->twoFactorCommand)
106
+            ->setNext($this->finishRememberedLoginCommand);
107
+
108
+        return $chain->process($loginData);
109
+    }
110 110
 
111 111
 }
Please login to merge, or discard this patch.
lib/private/Authentication/Login/SetUserTimezoneCommand.php 1 patch
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -30,33 +30,33 @@
 block discarded – undo
30 30
 
31 31
 class SetUserTimezoneCommand extends ALoginCommand {
32 32
 
33
-	/** @var IConfig */
34
-	private $config;
35
-
36
-	/** @var ISession */
37
-	private $session;
38
-
39
-	public function __construct(IConfig $config,
40
-								ISession $session) {
41
-		$this->config = $config;
42
-		$this->session = $session;
43
-	}
44
-
45
-	public function process(LoginData $loginData): LoginResult {
46
-		if ($loginData->getTimeZoneOffset() !== '') {
47
-			$this->config->setUserValue(
48
-				$loginData->getUser()->getUID(),
49
-				'core',
50
-				'timezone',
51
-				$loginData->getTimeZone()
52
-			);
53
-			$this->session->set(
54
-				'timezone',
55
-				$loginData->getTimeZoneOffset()
56
-			);
57
-		}
58
-
59
-		return $this->processNextOrFinishSuccessfully($loginData);
60
-	}
33
+    /** @var IConfig */
34
+    private $config;
35
+
36
+    /** @var ISession */
37
+    private $session;
38
+
39
+    public function __construct(IConfig $config,
40
+                                ISession $session) {
41
+        $this->config = $config;
42
+        $this->session = $session;
43
+    }
44
+
45
+    public function process(LoginData $loginData): LoginResult {
46
+        if ($loginData->getTimeZoneOffset() !== '') {
47
+            $this->config->setUserValue(
48
+                $loginData->getUser()->getUID(),
49
+                'core',
50
+                'timezone',
51
+                $loginData->getTimeZone()
52
+            );
53
+            $this->session->set(
54
+                'timezone',
55
+                $loginData->getTimeZoneOffset()
56
+            );
57
+        }
58
+
59
+        return $this->processNextOrFinishSuccessfully($loginData);
60
+    }
61 61
 
62 62
 }
Please login to merge, or discard this patch.
lib/public/Support/CrashReport/IMessageReporter.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -30,14 +30,14 @@
 block discarded – undo
30 30
  */
31 31
 interface IMessageReporter extends IReporter {
32 32
 
33
-	/**
34
-	 * Report a (error) message
35
-	 *
36
-	 * @param string $message
37
-	 * @param array $context
38
-	 *
39
-	 * @since 17.0.0
40
-	 */
41
-	public function reportMessage(string $message, array $context = []): void;
33
+    /**
34
+     * Report a (error) message
35
+     *
36
+     * @param string $message
37
+     * @param array $context
38
+     *
39
+     * @since 17.0.0
40
+     */
41
+    public function reportMessage(string $message, array $context = []): void;
42 42
 
43 43
 }
Please login to merge, or discard this patch.
lib/public/Support/Subscription/ISupportedApps.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -28,10 +28,10 @@
 block discarded – undo
28 28
  */
29 29
 interface ISupportedApps extends ISubscription {
30 30
 
31
-	/**
32
-	 * Fetches the list of app IDs that are supported by the subscription
33
-	 *
34
-	 * @since 17.0.0
35
-	 */
36
-	public function getSupportedApps(): array;
31
+    /**
32
+     * Fetches the list of app IDs that are supported by the subscription
33
+     *
34
+     * @since 17.0.0
35
+     */
36
+    public function getSupportedApps(): array;
37 37
 }
Please login to merge, or discard this patch.
lib/public/Authentication/TwoFactorAuth/IActivatableAtLogin.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -31,13 +31,13 @@
 block discarded – undo
31 31
  */
32 32
 interface IActivatableAtLogin extends IProvider {
33 33
 
34
-	/**
35
-	 * @param IUser $user
36
-	 *
37
-	 * @return ILoginSetupProvider
38
-	 *
39
-	 * @since 17.0.0
40
-	 */
41
-	public function getLoginSetup(IUser $user): ILoginSetupProvider;
34
+    /**
35
+     * @param IUser $user
36
+     *
37
+     * @return ILoginSetupProvider
38
+     *
39
+     * @since 17.0.0
40
+     */
41
+    public function getLoginSetup(IUser $user): ILoginSetupProvider;
42 42
 
43 43
 }
Please login to merge, or discard this patch.
lib/public/Authentication/TwoFactorAuth/ILoginSetupProvider.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -31,11 +31,11 @@
 block discarded – undo
31 31
  */
32 32
 interface ILoginSetupProvider {
33 33
 
34
-	/**
35
-	 * @return Template
36
-	 *
37
-	 * @since 17.0.0
38
-	 */
39
-	public function getBody(): Template;
34
+    /**
35
+     * @return Template
36
+     *
37
+     * @since 17.0.0
38
+     */
39
+    public function getBody(): Template;
40 40
 
41 41
 }
Please login to merge, or discard this patch.
lib/private/Authentication/Exceptions/WipeTokenException.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -26,16 +26,16 @@
 block discarded – undo
26 26
 use OC\Authentication\Token\IToken;
27 27
 
28 28
 class WipeTokenException extends InvalidTokenException {
29
-	/** @var IToken */
30
-	private $token;
29
+    /** @var IToken */
30
+    private $token;
31 31
 
32
-	public function __construct(IToken $token) {
33
-		parent::__construct();
32
+    public function __construct(IToken $token) {
33
+        parent::__construct();
34 34
 
35
-		$this->token = $token;
36
-	}
35
+        $this->token = $token;
36
+    }
37 37
 
38
-	public function getToken(): IToken {
39
-		return $this->token;
40
-	}
38
+    public function getToken(): IToken {
39
+        return $this->token;
40
+    }
41 41
 }
Please login to merge, or discard this patch.