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>
This commit is contained in:
Morris Jobke 2020-11-05 13:21:19 +01:00
parent eb9faa7bdb
commit a223f603f9
No known key found for this signature in database
GPG Key ID: FE03C3A163FEDE68
1 changed files with 2 additions and 4 deletions

View File

@ -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;
}