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