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:
parent
eb9faa7bdb
commit
a223f603f9
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue