mirror of
https://github.com/humhub/humhub.git
synced 2025-01-16 21:58:17 +01:00
Make "Invite new people" always possible for Admins (#6966)
This commit is contained in:
parent
93db54ff0d
commit
2329da4c7d
@ -7,6 +7,7 @@ HumHub Changelog
|
||||
- Fix #6913: Fix API tests
|
||||
- Fix #6919: Fix saving of user profile country field value and enable a searching by country title
|
||||
- Fix #6919: Migration to revert user profile country names to Iso 3166 codes
|
||||
- Fix #6966: Make "Invite new people" always possible for Admins
|
||||
|
||||
1.15.4 (March 20, 2024)
|
||||
-----------------------
|
||||
|
@ -20,6 +20,7 @@ use humhub\modules\admin\models\UserSearch;
|
||||
use humhub\modules\admin\permissions\ManageGroups;
|
||||
use humhub\modules\admin\permissions\ManageSettings;
|
||||
use humhub\modules\admin\permissions\ManageUsers;
|
||||
use humhub\modules\user\models\forms\Invite as InviteForm;
|
||||
use humhub\modules\user\models\forms\Registration;
|
||||
use humhub\modules\user\models\Invite;
|
||||
use humhub\modules\user\models\Profile;
|
||||
@ -262,11 +263,14 @@ class UserController extends Controller
|
||||
return $this->redirect(['edit', 'id' => $registration->getUser()->id]);
|
||||
}
|
||||
|
||||
$adminIsAlwaysAllowed = Yii::$app->user->isAdmin();
|
||||
$invite = new InviteForm();
|
||||
|
||||
return $this->render('add', [
|
||||
'hForm' => $registration,
|
||||
'canInviteByEmail' => Yii::$app->getModule('user')->settings->get('auth.internalUsersCanInviteByEmail'),
|
||||
'canInviteByLink' => Yii::$app->getModule('user')->settings->get('auth.internalUsersCanInviteByLink'),
|
||||
'adminIsAlwaysAllowed' => false,
|
||||
'canInviteByEmail' => $invite->canInviteByEmail($adminIsAlwaysAllowed),
|
||||
'canInviteByLink' => $invite->canInviteByLink($adminIsAlwaysAllowed),
|
||||
'adminIsAlwaysAllowed' => $adminIsAlwaysAllowed,
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,7 @@ use yii\bootstrap\ActiveForm;
|
||||
<?php $form = ActiveForm::begin(); ?>
|
||||
<?= $form->field($model, 'emails')->textarea(['rows' => '3', 'placeholder' => Yii::t('UserModule.invite', 'Email address(es)'), 'id' => 'emails'])->label(false)->hint(Yii::t('UserModule.invite', 'Separate multiple email addresses by comma.')); ?>
|
||||
<a href="#" class="btn btn-primary" data-action-click="ui.modal.submit"
|
||||
data-action-url="<?= Url::to(['/user/invite']) ?>" data-ui-loader>
|
||||
data-action-url="<?= Url::to(['/user/invite', 'adminIsAlwaysAllowed' => $adminIsAlwaysAllowed]) ?>" data-ui-loader>
|
||||
<?= Yii::t('UserModule.invite', 'Send invite') ?>
|
||||
</a>
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user