|
@@ -189,7 +189,7 @@ discard block |
|
|
block discarded – undo |
|
189
|
189
|
Util::addHeader('meta', ['property' => 'og:site_name', 'content' => Util::sanitizeHTML($this->defaults->getName())]); |
|
190
|
190
|
Util::addHeader('meta', ['property' => 'og:url', 'content' => $this->urlGenerator->getAbsoluteURL('/')]); |
|
191
|
191
|
Util::addHeader('meta', ['property' => 'og:type', 'content' => 'website']); |
|
192
|
|
- Util::addHeader('meta', ['property' => 'og:image', 'content' => $this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core','favicon-touch.png'))]); |
|
|
192
|
+ Util::addHeader('meta', ['property' => 'og:image', 'content' => $this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core', 'favicon-touch.png'))]); |
|
193
|
193
|
|
|
194
|
194
|
return new TemplateResponse( |
|
195
|
195
|
$this->appName, 'login', $parameters, 'guest' |
|
@@ -227,14 +227,14 @@ discard block |
|
|
block discarded – undo |
|
227
|
227
|
* @return RedirectResponse |
|
228
|
228
|
*/ |
|
229
|
229
|
public function tryLogin($user, $password, $redirect_url, $remember_login = false, $timezone = '', $timezone_offset = '') { |
|
230
|
|
- if(!is_string($user)) { |
|
|
230
|
+ if (!is_string($user)) { |
|
231
|
231
|
throw new \InvalidArgumentException('Username must be string'); |
|
232
|
232
|
} |
|
233
|
233
|
|
|
234
|
234
|
// If the user is already logged in and the CSRF check does not pass then |
|
235
|
235
|
// simply redirect the user to the correct page as required. This is the |
|
236
|
236
|
// case when an user has already logged-in, in another tab. |
|
237
|
|
- if(!$this->request->passesCSRFCheck()) { |
|
|
237
|
+ if (!$this->request->passesCSRFCheck()) { |
|
238
|
238
|
return $this->generateRedirect($redirect_url); |
|
239
|
239
|
} |
|
240
|
240
|
|
|
@@ -253,7 +253,7 @@ discard block |
|
|
block discarded – undo |
|
253
|
253
|
$user = $users[0]->getUID(); |
|
254
|
254
|
$loginResult = $this->userManager->checkPassword($user, $password); |
|
255
|
255
|
} else { |
|
256
|
|
- $this->logger->warning('Login failed: \''. $user .'\' (Remote IP: \''. $this->request->getRemoteAddress(). '\')', ['app' => 'core']); |
|
|
256
|
+ $this->logger->warning('Login failed: \''.$user.'\' (Remote IP: \''.$this->request->getRemoteAddress().'\')', ['app' => 'core']); |
|
257
|
257
|
} |
|
258
|
258
|
} |
|
259
|
259
|
if ($loginResult === false) { |
|
@@ -272,7 +272,7 @@ discard block |
|
|
block discarded – undo |
|
272
|
272
|
// TODO: remove password checks from above and let the user session handle failures |
|
273
|
273
|
// requires https://github.com/owncloud/core/pull/24616 |
|
274
|
274
|
$this->userSession->completeLogin($loginResult, ['loginName' => $user, 'password' => $password]); |
|
275
|
|
- $this->userSession->createSessionToken($this->request, $loginResult->getUID(), $user, $password, (int)$remember_login); |
|
|
275
|
+ $this->userSession->createSessionToken($this->request, $loginResult->getUID(), $user, $password, (int) $remember_login); |
|
276
|
276
|
|
|
277
|
277
|
// User has successfully logged in, now remove the password reset link, when it is available |
|
278
|
278
|
$this->config->deleteUserValue($loginResult->getUID(), 'core', 'lostpassword'); |