diff options
author | Bjoern Schiessle <bjoern@schiessle.org> | 2017-05-30 14:03:47 +0200 |
---|---|---|
committer | Bjoern Schiessle <bjoern@schiessle.org> | 2017-07-06 11:47:11 +0200 |
commit | 1a55ace97c3671ec0bed91301aed4ca29456a43f (patch) | |
tree | a2001ba55dde8f939edbd0ff77b171c5f6f97631 /settings | |
parent | d668e17769cfe4ccf82794fa75a3f80995b8e43b (diff) | |
download | nextcloud-server-1a55ace97c3671ec0bed91301aed4ca29456a43f.tar.gz nextcloud-server-1a55ace97c3671ec0bed91301aed4ca29456a43f.zip |
no warning on password change if no encryption module uses per-user keys
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'settings')
-rw-r--r-- | settings/Controller/UsersController.php | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/settings/Controller/UsersController.php b/settings/Controller/UsersController.php index a193f9bc8de..76394fcb6c6 100644 --- a/settings/Controller/UsersController.php +++ b/settings/Controller/UsersController.php @@ -42,6 +42,8 @@ use OCP\AppFramework\Http\DataResponse; use OCP\AppFramework\Utility\ITimeFactory; use OCP\BackgroundJob\IJobList; use OCP\Files\Config\IUserMountCache; +use OCP\Encryption\IEncryptionModule; +use OCP\Encryption\IManager; use OCP\IConfig; use OCP\IGroupManager; use OCP\IL10N; @@ -99,9 +101,14 @@ class UsersController extends Controller { private $keyManager; /** @var IJobList */ private $jobList; + /** @var IUserMountCache */ private $userMountCache; + /** @var IManager */ + private $encryptionManager; + + /** * @param string $appName * @param IRequest $request @@ -124,6 +131,7 @@ class UsersController extends Controller { * @param Manager $keyManager * @param IJobList $jobList * @param IUserMountCache $userMountCache + * @param IManager $encryptionManager */ public function __construct($appName, IRequest $request, @@ -145,7 +153,8 @@ class UsersController extends Controller { ICrypto $crypto, Manager $keyManager, IJobList $jobList, - IUserMountCache $userMountCache) { + IUserMountCache $userMountCache, + IManager $encryptionManager) { parent::__construct($appName, $request); $this->userManager = $userManager; $this->groupManager = $groupManager; @@ -165,6 +174,7 @@ class UsersController extends Controller { $this->keyManager = $keyManager; $this->jobList = $jobList; $this->userMountCache = $userMountCache; + $this->encryptionManager = $encryptionManager; // check for encryption state - TODO see formatUserForIndex $this->isEncryptionAppEnabled = $appManager->isEnabledForUser('encryption'); @@ -200,6 +210,17 @@ class UsersController extends Controller { // user also has recovery mode enabled $restorePossible = true; } + } else { + $modules = $this->encryptionManager->getEncryptionModules(); + $restorePossible = true; + foreach ($modules as $id => $module) { + /* @var IEncryptionModule $instance */ + $instance = call_user_func($module['callback']); + if ($instance->needDetailedAccessList()) { + $restorePossible = false; + break; + } + } } } else { // recovery is possible if encryption is disabled (plain files are |