aboutsummaryrefslogtreecommitdiffstats
path: root/apps/settings/lib/Controller/UsersController.php
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2020-11-05 13:21:19 +0100
committerMorris Jobke <hey@morrisjobke.de>2020-11-05 22:20:34 +0100
commita223f603f95ad14d66226118b597bb1c97a1d1da (patch)
tree0b683400d79271327d4ff3b31dd92403b56cc979 /apps/settings/lib/Controller/UsersController.php
parenteb9faa7bdbb5db60a4189299196b894e12dd795d (diff)
downloadnextcloud-server-a223f603f95ad14d66226118b597bb1c97a1d1da.tar.gz
nextcloud-server-a223f603f95ad14d66226118b597bb1c97a1d1da.zip
Simplify the check if admin can change password based on encryption status
Found by Psalm: ``` /home/runner/work/server/server/apps/settings/lib/Controller/UsersController.php:324:8:error - RedundantCondition: Type true for $isEncryptionModuleLoaded is never falsy ``` Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'apps/settings/lib/Controller/UsersController.php')
-rw-r--r--apps/settings/lib/Controller/UsersController.php6
1 files changed, 2 insertions, 4 deletions
diff --git a/apps/settings/lib/Controller/UsersController.php b/apps/settings/lib/Controller/UsersController.php
index b9d20f5c0de..cad21c5f3b3 100644
--- a/apps/settings/lib/Controller/UsersController.php
+++ b/apps/settings/lib/Controller/UsersController.php
@@ -318,10 +318,8 @@ class UsersController extends Controller {
$noUserSpecificEncryptionKeys = true;
$isEncryptionModuleLoaded = false;
}
-
- $canChangePassword = ($isEncryptionEnabled && $isEncryptionModuleLoaded && $noUserSpecificEncryptionKeys)
- || (!$isEncryptionEnabled && !$isEncryptionModuleLoaded)
- || (!$isEncryptionEnabled && $isEncryptionModuleLoaded && $noUserSpecificEncryptionKeys);
+ $canChangePassword = ($isEncryptionModuleLoaded && $noUserSpecificEncryptionKeys)
+ || (!$isEncryptionModuleLoaded && !$isEncryptionEnabled);
return $canChangePassword;
}