User Approval Fixes

This commit is contained in:
Lucas Bartholemy 2016-05-14 01:59:37 +02:00
parent 5be76e7820
commit c384348a1d
6 changed files with 61 additions and 53 deletions

View File

@ -87,7 +87,7 @@ class UserApprovalSearch extends User
foreach ($groups as $group) {
$groupIds[] = $group->id;
}
//$query->andWhere(['IN', 'group.id', $groupIds]);
$query->andWhere(['IN', 'group.id', $groupIds]);
$query->andWhere(['status' => User::STATUS_NEED_APPROVAL]);
$query->andFilterWhere(['id' => $this->id]);
$query->andFilterWhere(['like', 'id', $this->id]);

View File

@ -1,7 +1,9 @@
<div class="container">
<div class="row">
<div class="col-md-12">
<?php echo $content; ?>
<div class="panel">
<?php echo $content; ?>
</div>
</div>
</div>
</div>

View File

@ -4,20 +4,21 @@ use yii\bootstrap\Html;
use yii\helpers\Url;
?>
<div class="panel-body">
<div class="pull-right">
<?php echo Html::a('<i class="fa fa-arrow-left" aria-hidden="true"></i>&nbsp;&nbsp;' . Yii::t('AdminModule.user', 'Back to overview'), Url::to(['index']), array('class' => 'btn btn-default')); ?>
</div>
<div class="pull-right">
<?php echo Html::a('<i class="fa fa-arrow-left" aria-hidden="true"></i>&nbsp;&nbsp;' . Yii::t('AdminModule.user', 'Back to overview'), Url::to(['index']), array('class' => 'btn btn-default')); ?>
</div>
<?php if (!$group->isNewRecord) : ?>
<h4><?php echo Yii::t('AdminModule.user', 'Manage group: {groupName}', ['groupName' => $group->name]); ?></h4>
<?php else: ?>
<h4><?php echo Yii::t('AdminModule.user', 'Add new group'); ?></h4>
<?php endif; ?>
<?php if (!$group->isNewRecord) : ?>
<h4><?php echo Yii::t('AdminModule.user', 'Manage group: {groupName}', ['groupName' => $group->name]); ?></h4>
<?php else: ?>
<h4><?php echo Yii::t('AdminModule.user', 'Add new group'); ?></h4>
<?php endif; ?>
</div>
<br />
<?php if (!$group->isNewRecord) : ?>
<div class="pull-right"><span class="label label-danger"><?php echo Yii::t('AdminModule.group', 'Administrative group'); ?></span>&nbsp;&nbsp;</div>
<?= \humhub\modules\admin\widgets\GroupManagerMenu::widget(); ?>
<br />
<?php endif; ?>

View File

@ -1,4 +1,5 @@
<?php
use yii\widgets\ActiveForm;
use humhub\compat\CHtml;
use yii\helpers\Url;
@ -7,48 +8,52 @@ use yii\helpers\Html;
<?php $this->beginContent('@admin/views/group/_manageLayout.php', ['group' => $group]) ?>
<div class="panel-body">
<?php $form = ActiveForm::begin(); ?>
<?php echo $form->field($group, 'name'); ?>
<?php echo $form->field($group, 'description')->textarea(['rows' => 5]); ?>
<?php echo $form->field($group, 'defaultSpaceGuid')->textInput(['id' => 'space_select']); ?>
<?php
echo \humhub\modules\space\widgets\Picker::widget([
'inputId' => 'space_select',
'maxSpaces' => 1,
'model' => $group,
'attribute' => 'defaultSpaceGuid'
]);
?>
<?php if ($isManagerApprovalSetting): ?>
<?php echo $form->field($group, 'managerGuids', ['inputOptions' => ['id' => 'user_select']]); ?>
<?php $form = ActiveForm::begin(); ?>
<?php echo $form->field($group, 'name'); ?>
<?php echo $form->field($group, 'description')->textarea(['rows' => 5]); ?>
<?php if (!$group->is_admin_group): ?>
<?php echo $form->field($group, 'defaultSpaceGuid')->textInput(['id' => 'space_select']); ?>
<?php
echo \humhub\modules\space\widgets\Picker::widget([
'inputId' => 'space_select',
'maxSpaces' => 1,
'model' => $group,
'attribute' => 'defaultSpaceGuid'
]);
?>
<?php endif; ?>
<?php if ($isManagerApprovalSetting && !$group->is_admin_group): ?>
<?php echo $form->field($group, 'managerGuids', ['inputOptions' => ['id' => 'user_select']]); ?>
<?php
$url = ($group->isNewRecord) ? null : Url::toRoute('/admin/group/admin-user-search');
echo \humhub\modules\user\widgets\UserPicker::widget([
'inputId' => 'user_select',
'model' => $group,
'attribute' => 'managerGuids',
'userSearchUrl' => $url,
'data' => ['id' => $group->id],
'placeholderText' => 'Add a user'
]);
?>
<?php endif; ?>
<strong><?php echo Yii::t('AdminModule.views_group_edit', 'Visibility'); ?></strong>
<br>
<br>
<?php if ($isManagerApprovalSetting && !$group->is_admin_group): ?>
<?php echo $form->field($group, 'show_at_registration')->checkbox(); ?>
<?php endif; ?>
<?php echo $form->field($group, 'show_at_directory')->checkbox(); ?>
<?php echo CHtml::submitButton(Yii::t('AdminModule.views_group_edit', 'Save'), array('class' => 'btn btn-primary', 'data-ui-loader' => "")); ?>
<?php
$url = ($group->isNewRecord) ? null : Url::toRoute('/admin/group/admin-user-search');
echo \humhub\modules\user\widgets\UserPicker::widget([
'inputId' => 'user_select',
'model' => $group,
'attribute' => 'managerGuids',
'userSearchUrl' => $url,
'data' => ['id' => $group->id],
'placeholderText' => 'Add a user'
]);
if ($showDeleteButton) {
echo Html::a(Yii::t('AdminModule.views_group_edit', 'Delete'), Url::toRoute(['/admin/group/delete', 'id' => $group->id]), array('class' => 'btn btn-danger', 'data-method' => 'POST'));
}
?>
<?php endif; ?>
<strong><?php echo Yii::t('AdminModule.views_group_edit', 'Visibility'); ?></strong>
<br>
<br>
<?php if ($isManagerApprovalSetting): ?>
<?php echo $form->field($group, 'show_at_registration')->checkbox(); ?>
<?php endif; ?>
<?php echo $form->field($group, 'show_at_directory')->checkbox(); ?>
<?php echo CHtml::submitButton(Yii::t('AdminModule.views_group_edit', 'Save'), array('class' => 'btn btn-primary', 'data-ui-loader' => "")); ?>
<?php
if ($showDeleteButton) {
echo Html::a(Yii::t('AdminModule.views_group_edit', 'Delete'), Url::toRoute(['/admin/group/delete', 'id' => $group->id]), array('class' => 'btn btn-danger', 'data-method' => 'POST'));
}
?>
<?php ActiveForm::end(); ?>
<?php ActiveForm::end(); ?>
</div>
<?php $this->endContent(); ?>

View File

@ -10,4 +10,4 @@ use humhub\models\Setting;
<?php echo strip_tags(Yii::t('UserModule.views_mails_UserInviteSelf', 'Welcome to %appName%. Please click on the button below to proceed with your registration.', array('%appName%' => Html::encode(Yii::$app->name)))); ?>
<?php echo strip_tags(Yii::t('UserModule.views_mails_UserInviteSelf', 'Sign up')); ?>: <?php echo urldecode(Url::toRoute(["/user/auth/create-account", 'token' => $token], true)); ?>
<?php echo strip_tags(Yii::t('UserModule.views_mails_UserInviteSelf', 'Sign up')); ?>: <?php echo $registrationUrl; ?>

View File

@ -22,7 +22,7 @@ $this->pageTitle = Yii::t('UserModule.views_auth_createAccount', 'Create Account
<p><?php echo Yii::t('UserModule.views_auth_createAccount_success', 'To log in with your new account, click the button below.'); ?></p>
<br/>
<a href="<?php echo Url::home() ?>"
class="btn btn-primary"><?php echo Yii::t('UserModule.views_auth_createAccount_success', 'Go to login page') ?></a>
class="btn btn-primary" data-ui-loader=""><?php echo Yii::t('UserModule.views_auth_createAccount_success', 'Go to login page') ?></a>
<?php endif; ?>
</div>
</div>