Loading patches/040-hide-password-setting-section-encryption-enabled.patch +8 −7 Original line number Diff line number Diff line Loading @@ -4,22 +4,24 @@ Subject: [PATCH] Hide password settings section when encryption is enabled --- ./apps/settings/lib/Settings/Personal/Security/Password.php 2026-05-13 23:38:33 +++ ./apps/settings/lib/Settings/Personal/Security/Password-new.php 2026-05-13 23:41:36 @@ -9,12 +9,14 @@ @@ -9,12 +9,16 @@ namespace OCA\Settings\Settings\Personal\Security; use OCP\AppFramework\Http\TemplateResponse; +use OCP\IConfig; +use OCP\IAppConfig; +use OCP\IUserConfig; use OCP\IUserManager; use OCP\Settings\ISettings; class Password implements ISettings { public function __construct( + private IConfig $config, + private IAppConfig $appConfig, + private IUserConfig $userConfig, private IUserManager $userManager, private ?string $userId, ) { @@ -33,10 +35,25 @@ @@ -33,10 +37,25 @@ } public function getSection(): string { Loading @@ -38,12 +40,11 @@ Subject: [PATCH] Hide password settings section when encryption is enabled + return false; + } + + if (!$this->config->getSystemValueBool('passwords.enable_change_password_form', false)) { + if (!$this->appConfig->getValueBool('passwords', 'enable_change_password_form', false)) { + return false; + } + + return $this->config->getUserValue($this->userId, 'passwords', 'defaultE2eeFlowEnabled', '0') !== '1'; + return $this->userConfig->getUserValueString('passwords', 'defaultE2eeFlowEnabled', '0') !== '1'; } } \ No newline at end of file Loading
patches/040-hide-password-setting-section-encryption-enabled.patch +8 −7 Original line number Diff line number Diff line Loading @@ -4,22 +4,24 @@ Subject: [PATCH] Hide password settings section when encryption is enabled --- ./apps/settings/lib/Settings/Personal/Security/Password.php 2026-05-13 23:38:33 +++ ./apps/settings/lib/Settings/Personal/Security/Password-new.php 2026-05-13 23:41:36 @@ -9,12 +9,14 @@ @@ -9,12 +9,16 @@ namespace OCA\Settings\Settings\Personal\Security; use OCP\AppFramework\Http\TemplateResponse; +use OCP\IConfig; +use OCP\IAppConfig; +use OCP\IUserConfig; use OCP\IUserManager; use OCP\Settings\ISettings; class Password implements ISettings { public function __construct( + private IConfig $config, + private IAppConfig $appConfig, + private IUserConfig $userConfig, private IUserManager $userManager, private ?string $userId, ) { @@ -33,10 +35,25 @@ @@ -33,10 +37,25 @@ } public function getSection(): string { Loading @@ -38,12 +40,11 @@ Subject: [PATCH] Hide password settings section when encryption is enabled + return false; + } + + if (!$this->config->getSystemValueBool('passwords.enable_change_password_form', false)) { + if (!$this->appConfig->getValueBool('passwords', 'enable_change_password_form', false)) { + return false; + } + + return $this->config->getUserValue($this->userId, 'passwords', 'defaultE2eeFlowEnabled', '0') !== '1'; + return $this->userConfig->getUserValueString('passwords', 'defaultE2eeFlowEnabled', '0') !== '1'; } } \ No newline at end of file