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;
|
$noUserSpecificEncryptionKeys = true;
|
||||||
$isEncryptionModuleLoaded = false;
|
$isEncryptionModuleLoaded = false;
|
||||||
}
|
}
|
||||||
|
$canChangePassword = ($isEncryptionModuleLoaded && $noUserSpecificEncryptionKeys)
|
||||||
$canChangePassword = ($isEncryptionEnabled && $isEncryptionModuleLoaded && $noUserSpecificEncryptionKeys)
|
|| (!$isEncryptionModuleLoaded && !$isEncryptionEnabled);
|
||||||
|| (!$isEncryptionEnabled && !$isEncryptionModuleLoaded)
|
|
||||||
|| (!$isEncryptionEnabled && $isEncryptionModuleLoaded && $noUserSpecificEncryptionKeys);
|
|
||||||
|
|
||||||
return $canChangePassword;
|
return $canChangePassword;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue