diff --git a/CHANGELOG.md b/CHANGELOG.md index 493c905602..1ddc418b53 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ Note: HumHub version 1.9+ requires PHP 7.3 or higher! - Fix #5177: Move directory widgets - Enh #5049: Required profile field should not be required in administration (Fix for checkbox field type) - Fix #5009: Fix video thumbnail on Safari browser +- Fix #5182: Password field should not be required if user has no password 1.9.0-beta.2 (July 14, 2021) diff --git a/protected/humhub/modules/user/components/CheckPasswordValidator.php b/protected/humhub/modules/user/components/CheckPasswordValidator.php index 56249a80ac..eab8110e46 100644 --- a/protected/humhub/modules/user/components/CheckPasswordValidator.php +++ b/protected/humhub/modules/user/components/CheckPasswordValidator.php @@ -43,7 +43,7 @@ class CheckPasswordValidator extends Validator /** * Checks if current user has a password set. - * + * * @param User $user the user or null for current * @return boolean */ @@ -57,7 +57,7 @@ class CheckPasswordValidator extends Validator return false; } - return ($user->currentPassword !== null); + return !empty($user->currentPassword->currentPassword); } } diff --git a/protected/humhub/modules/user/models/User.php b/protected/humhub/modules/user/models/User.php index 9f1228f116..c0b54e3f21 100644 --- a/protected/humhub/modules/user/models/User.php +++ b/protected/humhub/modules/user/models/User.php @@ -59,6 +59,7 @@ use yii\web\IdentityInterface; * @property integer $visibility * @property integer $contentcontainer_id * @property Profile $profile + * @property Password $currentPassword * * @property string $displayName * @property string $displayNameSub