add user status
This commit is contained in:
parent
859c898264
commit
1cbecb415b
@ -33,6 +33,8 @@ class UserCreate extends User{
|
|||||||
|
|
||||||
[['role'], 'required'],
|
[['role'], 'required'],
|
||||||
[['role'], 'string', 'max' => 20],
|
[['role'], 'string', 'max' => 20],
|
||||||
|
['status', 'default', 'value' => self::STATUS_ACTIVE],
|
||||||
|
['status', 'in', 'range' => [self::STATUS_ACTIVE, self::STATUS_DELETED]],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -47,7 +49,7 @@ class UserCreate extends User{
|
|||||||
|
|
||||||
public function attributeLabels(){
|
public function attributeLabels(){
|
||||||
return [
|
return [
|
||||||
|
'status' => 'Státusz',
|
||||||
'email' =>'E-mail',
|
'email' =>'E-mail',
|
||||||
'username' =>'Felhasználónév',
|
'username' =>'Felhasználónév',
|
||||||
'created_at' =>'Létrehozás dátuma',
|
'created_at' =>'Létrehozás dátuma',
|
||||||
|
|||||||
@ -47,7 +47,7 @@ class UserSearch extends User
|
|||||||
'query' => $query,
|
'query' => $query,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$query->andWhere(['status' => User::STATUS_ACTIVE]);
|
//$query->andWhere(['status' => User::STATUS_ACTIVE]);
|
||||||
|
|
||||||
$this->load($params);
|
$this->load($params);
|
||||||
|
|
||||||
|
|||||||
@ -33,6 +33,10 @@ class UserUpdate extends User {
|
|||||||
],
|
],
|
||||||
[['role'], 'required'],
|
[['role'], 'required'],
|
||||||
[['role'], 'string', 'max' => 20],
|
[['role'], 'string', 'max' => 20],
|
||||||
|
|
||||||
|
['status', 'default', 'value' => self::STATUS_ACTIVE],
|
||||||
|
['status', 'in', 'range' => [self::STATUS_ACTIVE, self::STATUS_DELETED]],
|
||||||
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -51,6 +55,7 @@ class UserUpdate extends User {
|
|||||||
public function attributeLabels() {
|
public function attributeLabels() {
|
||||||
return [
|
return [
|
||||||
|
|
||||||
|
'status' => 'Státusz',
|
||||||
'email' => 'E-mail',
|
'email' => 'E-mail',
|
||||||
'username' => 'Felhasználónév',
|
'username' => 'Felhasználónév',
|
||||||
'created_at' => 'Létrehozás dátuma',
|
'created_at' => 'Létrehozás dátuma',
|
||||||
|
|||||||
@ -5,6 +5,7 @@ use yii\widgets\ActiveForm;
|
|||||||
use yii\grid\GridView;
|
use yii\grid\GridView;
|
||||||
use yii\data\ArrayDataProvider;
|
use yii\data\ArrayDataProvider;
|
||||||
use common\components\RoleDefinition;
|
use common\components\RoleDefinition;
|
||||||
|
use common\models\User;
|
||||||
|
|
||||||
/* @var $this yii\web\View */
|
/* @var $this yii\web\View */
|
||||||
/* @var $model common\models\User */
|
/* @var $model common\models\User */
|
||||||
@ -25,6 +26,8 @@ asort($roleOptions);
|
|||||||
|
|
||||||
<?= $form->field($model, 'username')->textInput() ?>
|
<?= $form->field($model, 'username')->textInput() ?>
|
||||||
<?= $form->field($model, 'email')->textInput() ?>
|
<?= $form->field($model, 'email')->textInput() ?>
|
||||||
|
<?= $form->field($model, 'status')
|
||||||
|
->dropDownList(User::statuses())->hint("Csak aktív felhasználó tud bejelentkezni") ?>
|
||||||
<?= $form->field($model, 'password_plain')->passwordInput() ?>
|
<?= $form->field($model, 'password_plain')->passwordInput() ?>
|
||||||
<?= $form->field($model, 'password_repeat')->passwordInput() ?>
|
<?= $form->field($model, 'password_repeat')->passwordInput() ?>
|
||||||
<?= $form->field($model, 'role')->dropDownList($roleOptions) ?>
|
<?= $form->field($model, 'role')->dropDownList($roleOptions) ?>
|
||||||
|
|||||||
@ -31,7 +31,7 @@ $this->params['breadcrumbs'][] = $this->title;
|
|||||||
'username',
|
'username',
|
||||||
'email:email',
|
'email:email',
|
||||||
'created_at:datetime',
|
'created_at:datetime',
|
||||||
|
['attribute' => 'status' , 'value' => 'statusHuman'],
|
||||||
[
|
[
|
||||||
'attribute' => 'role',
|
'attribute' => 'role',
|
||||||
'value' => function ($model){
|
'value' => function ($model){
|
||||||
|
|||||||
@ -212,6 +212,7 @@ class User extends ActiveRecord implements IdentityInterface
|
|||||||
|
|
||||||
public function attributeLabels(){
|
public function attributeLabels(){
|
||||||
return [
|
return [
|
||||||
|
'status' => 'Státusz',
|
||||||
'username' => Yii::t('backend/user', 'Username'),
|
'username' => Yii::t('backend/user', 'Username'),
|
||||||
'email' => Yii::t('backend/user', 'E-Mail'),
|
'email' => Yii::t('backend/user', 'E-Mail'),
|
||||||
'created_at' => Yii::t('backend/user', 'Created at'),
|
'created_at' => Yii::t('backend/user', 'Created at'),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user