Fix assign default group on user registration (#5033)

This commit is contained in:
Yuriy Bakhtin 2021-04-22 15:01:51 +03:00 committed by GitHub
parent 01a2ab9026
commit 73c06b16a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -1,7 +1,8 @@
HumHub Changelog
================
1.8.2 (April 20, 2021)
1.8.2 (Unreleased)
----------------------
- Fix #4959: Horizontal scrollbar for images
@ -19,6 +20,7 @@ HumHub Changelog
- Fix #5004: Preview text maxLength issue
- Fix #5017: File CLI Command fails due to manually deleted files
- Fix: Space visibility options shown to users without permission
- Fix #5022: Fix assign default group on user registration
1.8.1 (March 12, 2021)

View File

@ -451,10 +451,13 @@ class Group extends ActiveRecord
public static function getRegistrationGroups()
{
if (Yii::$app->getModule('user')->settings->get('auth.showRegistrationUserGroup')) {
return self::find()
$groups = self::find()
->where(['show_at_registration' => 1, 'is_admin_group' => 0])
->orderBy('name ASC')
->all();
if (count($groups) > 0) {
return $groups;
}
}
$groups = [];