Merge pull request #23906 from nextcloud/techdebt/noid/simplify-can-change-user-pasword

Simplify the check if admin can change password based on encryption status
This commit is contained in:
Morris Jobke 2020-11-05 23:39:13 +01:00 committed by GitHub
commit f657f0c455
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;
}