aboutsummaryrefslogtreecommitdiffstats
path: root/core/Controller
diff options
context:
space:
mode:
Diffstat (limited to 'core/Controller')
-rw-r--r--core/Controller/LoginController.php8
-rw-r--r--core/Controller/LostController.php19
-rw-r--r--core/Controller/TokenController.php8
3 files changed, 19 insertions, 16 deletions
diff --git a/core/Controller/LoginController.php b/core/Controller/LoginController.php
index 083f4bb0518..884eea8869e 100644
--- a/core/Controller/LoginController.php
+++ b/core/Controller/LoginController.php
@@ -33,12 +33,14 @@ use OC_Util;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\RedirectResponse;
use OCP\AppFramework\Http\TemplateResponse;
+use OCP\Authentication\TwoFactorAuth\IProvider;
use OCP\IConfig;
use OCP\IRequest;
use OCP\ISession;
use OCP\IURLGenerator;
use OCP\IUser;
use OCP\IUserManager;
+use OCP\IUserSession;
class LoginController extends Controller {
/** @var IUserManager */
@@ -47,7 +49,7 @@ class LoginController extends Controller {
private $config;
/** @var ISession */
private $session;
- /** @var Session */
+ /** @var IUserSession|Session */
private $userSession;
/** @var IURLGenerator */
private $urlGenerator;
@@ -62,7 +64,7 @@ class LoginController extends Controller {
* @param IUserManager $userManager
* @param IConfig $config
* @param ISession $session
- * @param Session $userSession
+ * @param IUserSession $userSession
* @param IURLGenerator $urlGenerator
* @param Manager $twoFactorManager
* @param Throttler $throttler
@@ -72,7 +74,7 @@ class LoginController extends Controller {
IUserManager $userManager,
IConfig $config,
ISession $session,
- Session $userSession,
+ IUserSession $userSession,
IURLGenerator $urlGenerator,
Manager $twoFactorManager,
Throttler $throttler) {
diff --git a/core/Controller/LostController.php b/core/Controller/LostController.php
index b1111559a6c..bfc24bd1e0f 100644
--- a/core/Controller/LostController.php
+++ b/core/Controller/LostController.php
@@ -33,6 +33,7 @@ namespace OC\Core\Controller;
use \OCP\AppFramework\Controller;
use \OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Utility\ITimeFactory;
+use OCP\Encryption\IManager;
use \OCP\IURLGenerator;
use \OCP\IRequest;
use \OCP\IL10N;
@@ -60,8 +61,8 @@ class LostController extends Controller {
protected $l10n;
/** @var string */
protected $from;
- /** @var bool */
- protected $isDataEncrypted;
+ /** @var IManager */
+ protected $encryptionManager;
/** @var IConfig */
protected $config;
/** @var ISecureRandom */
@@ -80,8 +81,8 @@ class LostController extends Controller {
* @param IL10N $l10n
* @param IConfig $config
* @param ISecureRandom $secureRandom
- * @param string $from
- * @param string $isDataEncrypted
+ * @param string $defaultMailAddress
+ * @param IManager $encryptionManager
* @param IMailer $mailer
* @param ITimeFactory $timeFactory
*/
@@ -93,8 +94,8 @@ class LostController extends Controller {
IL10N $l10n,
IConfig $config,
ISecureRandom $secureRandom,
- $from,
- $isDataEncrypted,
+ $defaultMailAddress,
+ IManager $encryptionManager,
IMailer $mailer,
ITimeFactory $timeFactory) {
parent::__construct($appName, $request);
@@ -103,8 +104,8 @@ class LostController extends Controller {
$this->defaults = $defaults;
$this->l10n = $l10n;
$this->secureRandom = $secureRandom;
- $this->from = $from;
- $this->isDataEncrypted = $isDataEncrypted;
+ $this->from = $defaultMailAddress;
+ $this->encryptionManager = $encryptionManager;
$this->config = $config;
$this->mailer = $mailer;
$this->timeFactory = $timeFactory;
@@ -207,7 +208,7 @@ class LostController extends Controller {
* @return array
*/
public function setPassword($token, $userId, $password, $proceed) {
- if ($this->isDataEncrypted && !$proceed) {
+ if ($this->encryptionManager->isEnabled() && !$proceed) {
return $this->error('', array('encryption' => true));
}
diff --git a/core/Controller/TokenController.php b/core/Controller/TokenController.php
index 6e3ff50fa1d..865bae9665c 100644
--- a/core/Controller/TokenController.php
+++ b/core/Controller/TokenController.php
@@ -27,14 +27,14 @@ use OC\AppFramework\Http;
use OC\Authentication\Token\IProvider;
use OC\Authentication\Token\IToken;
use OC\Authentication\TwoFactorAuth\Manager as TwoFactorAuthManager;
-use OC\User\Manager as UserManager;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\JSONResponse;
use OCP\IRequest;
+use OCP\IUserManager;
use OCP\Security\ISecureRandom;
class TokenController extends Controller {
- /** @var UserManager */
+ /** @var IUserManager */
private $userManager;
/** @var IProvider */
private $tokenProvider;
@@ -46,14 +46,14 @@ class TokenController extends Controller {
/**
* @param string $appName
* @param IRequest $request
- * @param UserManager $userManager
+ * @param IUserManager $userManager
* @param IProvider $tokenProvider
* @param TwoFactorAuthManager $twoFactorAuthManager
* @param ISecureRandom $secureRandom
*/
public function __construct($appName,
IRequest $request,
- UserManager $userManager,
+ IUserManager $userManager,
IProvider $tokenProvider,
TwoFactorAuthManager $twoFactorAuthManager,
ISecureRandom $secureRandom) {