Loading patches/040-hide-password-setting-section-encryption-enabled.patch +20 −2 Original line number Diff line number Diff line Loading @@ -19,13 +19,31 @@ Subject: [PATCH] Hide password settings section when encryption is enabled private IUserManager $userManager, private ?string $userId, ) { @@ -33,6 +35,9 @@ @@ -33,10 +35,25 @@ } public function getSection(): string { + if ($this->config->getSystemValueBool('password_encrypt_enabled', false)) { + if ($this->shouldHideCorePasswordPanel()) { + return null; + } return 'security'; } public function getPriority(): int { return 10; + } + + private function shouldHideCorePasswordPanel(): bool { + if ($this->userId === null) { + return false; + } + + if (!$this->config->getSystemValueBool('password_encrypt_enabled', false)) { + return false; + } + + return $this->config->getUserValue($this->userId, 'passwords', 'defaultE2eeFlowEnabled', '0') !== '1'; } } \ No newline at end of file Loading
patches/040-hide-password-setting-section-encryption-enabled.patch +20 −2 Original line number Diff line number Diff line Loading @@ -19,13 +19,31 @@ Subject: [PATCH] Hide password settings section when encryption is enabled private IUserManager $userManager, private ?string $userId, ) { @@ -33,6 +35,9 @@ @@ -33,10 +35,25 @@ } public function getSection(): string { + if ($this->config->getSystemValueBool('password_encrypt_enabled', false)) { + if ($this->shouldHideCorePasswordPanel()) { + return null; + } return 'security'; } public function getPriority(): int { return 10; + } + + private function shouldHideCorePasswordPanel(): bool { + if ($this->userId === null) { + return false; + } + + if (!$this->config->getSystemValueBool('password_encrypt_enabled', false)) { + return false; + } + + return $this->config->getUserValue($this->userId, 'passwords', 'defaultE2eeFlowEnabled', '0') !== '1'; } } \ No newline at end of file