diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2016-08-29 21:17:16 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2016-08-29 21:52:09 +0200 |
commit | f6423f74e3ca925fd43c67f2669384994ccc55fe (patch) | |
tree | 1ea6c8b142e584cc2b11fd56e206f86c059ad138 /core/Controller | |
parent | c0ed865ab2e5166e71fd6046fc2c426dd5b7c6d4 (diff) | |
download | nextcloud-server-f6423f74e3ca925fd43c67f2669384994ccc55fe.tar.gz nextcloud-server-f6423f74e3ca925fd43c67f2669384994ccc55fe.zip |
Minor cleanup in core Controllers
Diffstat (limited to 'core/Controller')
-rw-r--r-- | core/Controller/LoginController.php | 1 | ||||
-rw-r--r-- | core/Controller/LostController.php | 5 | ||||
-rw-r--r-- | core/Controller/TokenController.php | 7 | ||||
-rw-r--r-- | core/Controller/TwoFactorChallengeController.php | 2 |
4 files changed, 5 insertions, 10 deletions
diff --git a/core/Controller/LoginController.php b/core/Controller/LoginController.php index 67e1e215289..f63d5cd8f2c 100644 --- a/core/Controller/LoginController.php +++ b/core/Controller/LoginController.php @@ -25,7 +25,6 @@ namespace OC\Core\Controller; -use OC\AppFramework\Utility\TimeFactory; use OC\Authentication\TwoFactorAuth\Manager; use OC\Security\Bruteforce\Throttler; use OC\User\Session; diff --git a/core/Controller/LostController.php b/core/Controller/LostController.php index fe6be1e6852..b1111559a6c 100644 --- a/core/Controller/LostController.php +++ b/core/Controller/LostController.php @@ -40,7 +40,6 @@ use \OCP\IConfig; use OCP\IUserManager; use OCP\Mail\IMailer; use OCP\Security\ISecureRandom; -use OCP\Security\StringUtils; /** * Class LostController @@ -144,7 +143,7 @@ class LostController extends Controller { } /** - * @param string $userId + * @param string $token * @param string $userId * @throws \Exception */ @@ -161,7 +160,7 @@ class LostController extends Controller { throw new \Exception($this->l10n->t('Couldn\'t reset password because the token is expired')); } - if (!StringUtils::equals($splittedToken[1], $token)) { + if (!hash_equals($splittedToken[1], $token)) { throw new \Exception($this->l10n->t('Couldn\'t reset password because the token is invalid')); } } diff --git a/core/Controller/TokenController.php b/core/Controller/TokenController.php index 9d4fd7c9656..6e3ff50fa1d 100644 --- a/core/Controller/TokenController.php +++ b/core/Controller/TokenController.php @@ -24,13 +24,10 @@ namespace OC\Core\Controller; use OC\AppFramework\Http; -use OC\AppFramework\Utility\TimeFactory; -use OC\Authentication\Token\DefaultTokenProvider; use OC\Authentication\Token\IProvider; use OC\Authentication\Token\IToken; use OC\Authentication\TwoFactorAuth\Manager as TwoFactorAuthManager; use OC\User\Manager as UserManager; -use OCA\User_LDAP\User\Manager; use OCP\AppFramework\Controller; use OCP\AppFramework\Http\JSONResponse; use OCP\IRequest; @@ -100,9 +97,9 @@ class TokenController extends Controller { $token = $this->secureRandom->generate(128); $this->tokenProvider->generateToken($token, $user->getUID(), $loginName, $password, $name, IToken::PERMANENT_TOKEN); - return [ + return new JSONResponse([ 'token' => $token, - ]; + ]); } } diff --git a/core/Controller/TwoFactorChallengeController.php b/core/Controller/TwoFactorChallengeController.php index b9e10b147ce..c19cf523279 100644 --- a/core/Controller/TwoFactorChallengeController.php +++ b/core/Controller/TwoFactorChallengeController.php @@ -96,7 +96,7 @@ class TwoFactorChallengeController extends Controller { * * @param string $challengeProviderId * @param string $redirect_url - * @return TemplateResponse + * @return TemplateResponse|RedirectResponse */ public function showChallenge($challengeProviderId, $redirect_url) { $user = $this->userSession->getUser(); |