|
@@ -32,6 +32,8 @@ class AdminController extends BaseController |
|
@@ -32,6 +32,8 @@ class AdminController extends BaseController |
32
|
$model->setPassword($posts['password']);
|
32
|
$model->setPassword($posts['password']);
|
33
|
$model->generateAuthKey();
|
33
|
$model->generateAuthKey();
|
34
|
$model->generatePasswordResetToken();
|
34
|
$model->generatePasswordResetToken();
|
|
|
35
|
+ //用户加入后默认启用状态
|
|
|
36
|
+ $model->status = Admin::STATUS_ACTIVE;
|
35
|
|
37
|
|
36
|
if ($model->save()){
|
38
|
if ($model->save()){
|
37
|
if (($roleName = Yii::$app->request->post('role')) && ($role = $this->authManager->getRole($roleName))){
|
39
|
if (($roleName = Yii::$app->request->post('role')) && ($role = $this->authManager->getRole($roleName))){
|
|
@@ -120,10 +122,10 @@ class AdminController extends BaseController |
|
@@ -120,10 +122,10 @@ class AdminController extends BaseController |
120
|
$authManager = $this->authManager;
|
122
|
$authManager = $this->authManager;
|
121
|
switch (true){
|
123
|
switch (true){
|
122
|
case $target == 'user' && $type == 'disable':
|
124
|
case $target == 'user' && $type == 'disable':
|
123
|
- $r = Admin::findOne(Yii::$app->getRequest()->getQueryParam('id'))->updateAll(['status'=>Admin::STATUS_DELETED]);
|
125
|
+ $r = Admin::findOne(Yii::$app->getRequest()->getQueryParam('id'))->updateAttributes(['status'=>Admin::STATUS_DELETED]);
|
124
|
break;
|
126
|
break;
|
125
|
case $target == 'user' && $type == 'enable':
|
127
|
case $target == 'user' && $type == 'enable':
|
126
|
- $r = Admin::findOne(Yii::$app->getRequest()->getQueryParam('id'))->updateAll(['status'=>Admin::STATUS_ACTIVE]);
|
128
|
+ $r = Admin::findOne(Yii::$app->getRequest()->getQueryParam('id'))->updateAttributes(['status'=>Admin::STATUS_ACTIVE]);
|
127
|
break;
|
129
|
break;
|
128
|
case $target == 'user' && $type == 'del':
|
130
|
case $target == 'user' && $type == 'del':
|
129
|
$r = Admin::findOne(Yii::$app->getRequest()->getQueryParam('id'))->delete();
|
131
|
$r = Admin::findOne(Yii::$app->getRequest()->getQueryParam('id'))->delete();
|