mirror of
https://github.com/humhub/humhub.git
synced 2025-01-17 22:28:51 +01:00
Simplify user approval #54
This commit is contained in:
parent
87c5f42a75
commit
6e0a649433
@ -49,24 +49,6 @@ class ApprovalController extends Controller {
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows options for a user registration request.
|
||||
*
|
||||
* Options are approve or decline
|
||||
*/
|
||||
public function actionApproveUser() {
|
||||
|
||||
$id = (int) Yii::app()->request->getQuery('id');
|
||||
|
||||
$model = User::model()->resetScope()->unapproved()->findByPk($id);
|
||||
|
||||
if ($model == null)
|
||||
throw new CHttpException(404, Yii::t('AdminModule.approval', 'Could not load requested user!'));
|
||||
|
||||
$model->scenario = 'edit';
|
||||
$this->render('approveUser', array('model' => $model));
|
||||
}
|
||||
|
||||
/**
|
||||
* Approves a user registration request
|
||||
*
|
||||
|
@ -1,27 +0,0 @@
|
||||
<h1><?php echo Yii::t('AdminModule.base', 'Approve user: {displayName}', array('{displayName}' => $model->displayName)); ?></h1>
|
||||
<br>
|
||||
|
||||
<?php
|
||||
$this->widget('zii.widgets.CDetailView', array(
|
||||
'data' => $model,
|
||||
'attributes' => array(
|
||||
'username',
|
||||
'email:email',
|
||||
array(
|
||||
'name' => 'group_id',
|
||||
'value' => Group::getGroupNameById($model->group_id),
|
||||
),
|
||||
'created_at',
|
||||
),
|
||||
));
|
||||
?>
|
||||
|
||||
|
||||
<br>
|
||||
<a href="<?php echo $this->createUrl('approveUserAccept', array('id' => $model->id)) ?>"
|
||||
class="btn btn-primary"><?php echo Yii::t('AdminModule.base', 'Approve membership'); ?></a>
|
||||
<a href="<?php echo $this->createUrl('approveUserDecline', array('id' => $model->id)) ?>"
|
||||
class="btn btn-danger"><?php echo Yii::t('AdminModule.base', 'Decline membership'); ?></a>
|
||||
|
||||
|
||||
|
@ -34,21 +34,28 @@ $this->widget('zii.widgets.grid.CGridView', array(
|
||||
),
|
||||
array(
|
||||
'class' => 'CButtonColumn',
|
||||
'template' => '{view}',
|
||||
'viewButtonUrl' => 'Yii::app()->createUrl("admin/approval/approveUser", array("id"=>$data->id));',
|
||||
'template' => '{accept}{decline}',
|
||||
'htmlOptions' => array('width' => '160px'),
|
||||
'buttons'=>array
|
||||
(
|
||||
'view' => array
|
||||
'accept' => array
|
||||
(
|
||||
'label'=>'<i class="fa fa-eye"></i>',
|
||||
'label'=>Yii::t('AdminModule.approval', 'Accept'),
|
||||
'url'=>'Yii::app()->createUrl("admin/approval/approveUserAccept", array("id" => $data->id))',
|
||||
'imageUrl'=>false,
|
||||
'options' => array(
|
||||
'style' => 'margin-right: 3px',
|
||||
'class' => 'btn btn-primary btn-xs tt',
|
||||
'data-toggle' => 'tooltip',
|
||||
'data-placement' => 'top',
|
||||
'title' => '',
|
||||
'data-original-title' => 'View user approval',
|
||||
'class' => 'btn btn-primary btn-sm',
|
||||
),
|
||||
),
|
||||
'decline' => array
|
||||
(
|
||||
'label'=>Yii::t('AdminModule.approval', 'Decline'),
|
||||
'url'=>'Yii::app()->createUrl("admin/approval/approveUserDecline", array("id" => $data->id))',
|
||||
'imageUrl'=>false,
|
||||
'options' => array(
|
||||
'style' => 'margin-right: 3px',
|
||||
'class' => 'btn btn-danger btn-sm',
|
||||
),
|
||||
),
|
||||
),
|
||||
|
Loading…
x
Reference in New Issue
Block a user