Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'core/Command/User/ResetPassword.php')
-rw-r--r--core/Command/User/ResetPassword.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/core/Command/User/ResetPassword.php b/core/Command/User/ResetPassword.php
index 21bc5cc45b0..294cea38b71 100644
--- a/core/Command/User/ResetPassword.php
+++ b/core/Command/User/ResetPassword.php
@@ -28,6 +28,7 @@
namespace OC\Core\Command\User;
use OC\Core\Command\Base;
+use OCP\App\IAppManager;
use OCP\IUser;
use OCP\IUserManager;
use Stecman\Component\Symfony\Console\BashCompletion\CompletionContext;
@@ -41,10 +42,12 @@ use Symfony\Component\Console\Question\Question;
class ResetPassword extends Base {
protected IUserManager $userManager;
+ private IAppManager $appManager;
- public function __construct(IUserManager $userManager) {
- $this->userManager = $userManager;
+ public function __construct(IUserManager $userManager, IAppManager $appManager) {
parent::__construct();
+ $this->userManager = $userManager;
+ $this->appManager = $appManager;
}
protected function configure() {
@@ -84,7 +87,7 @@ class ResetPassword extends Base {
/** @var QuestionHelper $helper */
$helper = $this->getHelper('question');
- if (\OCP\App::isEnabled('encryption')) {
+ if ($this->appManager->isEnabledForUser('encryption', $user)) {
$output->writeln(
'<error>Warning: Resetting the password when using encryption will result in data loss!</error>'
);