|
|
|
@ -272,23 +272,29 @@ class AuthManagerController extends AdminController{
|
|
|
|
|
$this->error('请选择要操作的数据!');
|
|
|
|
|
}
|
|
|
|
|
// 1正常,为0禁用,-1为删除'
|
|
|
|
|
|
|
|
|
|
switch ( strtolower($method) ){
|
|
|
|
|
case 'forbidgroup':
|
|
|
|
|
$status = 0;
|
|
|
|
|
$op_name = "禁用";
|
|
|
|
|
$msg = array('success'=>'操作成功,状态禁用成功!', 'error'=>'状态禁用失败!', 'url'=>'' ,'ajax'=>IS_AJAX);
|
|
|
|
|
break;
|
|
|
|
|
case 'resumegroup':
|
|
|
|
|
$status = 1;
|
|
|
|
|
$op_name = "正常";
|
|
|
|
|
$msg = array('success'=>'操作成功,状态恢复成功!', 'error'=>'状态恢复失败!', 'url'=>'' ,'ajax'=>IS_AJAX);
|
|
|
|
|
break;
|
|
|
|
|
case 'deletegroup':
|
|
|
|
|
$status = -1;
|
|
|
|
|
$op_name = "删除";
|
|
|
|
|
$op_type = 2;
|
|
|
|
|
$msg = array('success'=>'操作成功,删除成功!', 'error'=>'删除失败!', 'url'=>'' ,'ajax'=>IS_AJAX);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
$setFalg =false;
|
|
|
|
|
foreach ($lr as $k => $v) {
|
|
|
|
|
if($v['status'] != $status){
|
|
|
|
|
$setFalg = true;
|
|
|
|
|
addOperationLog(array(
|
|
|
|
|
"op_type"=>$op_type,
|
|
|
|
|
"key"=> $v['title'],
|
|
|
|
@ -297,22 +303,18 @@ class AuthManagerController extends AdminController{
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//操作日志end
|
|
|
|
|
switch ( strtolower($method) ){
|
|
|
|
|
case 'forbidgroup':
|
|
|
|
|
\Think\Log::actionLog('AuthManager/changeStatus?method=forbidGroup','AuthGroup',$_REQUEST['id']);
|
|
|
|
|
$this->forbid('AuthGroup');
|
|
|
|
|
break;
|
|
|
|
|
case 'resumegroup':
|
|
|
|
|
\Think\Log::actionLog('AuthManager/changeStatus?method=resumegroup','AuthGroup',$_REQUEST['id']);
|
|
|
|
|
$this->resume('AuthGroup');
|
|
|
|
|
break;
|
|
|
|
|
case 'deletegroup':
|
|
|
|
|
\Think\Log::actionLog('AuthManager/changeStatus?method=deletegroup','AuthGroup',$_REQUEST['id']);
|
|
|
|
|
$this->delete('AuthGroup');
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
$this->error($method.'参数非法');
|
|
|
|
|
if($setFalg){
|
|
|
|
|
$savedata = [
|
|
|
|
|
"status"=>$status
|
|
|
|
|
];
|
|
|
|
|
$res = M("AuthGroup")->where("id in ({$ids})")->save($savedata);
|
|
|
|
|
if($res !==false ){
|
|
|
|
|
$this->success($msg['success'],$msg['url'],$msg['ajax']);
|
|
|
|
|
}else{
|
|
|
|
|
$this->error($msg['error'],$msg['url'],$msg['ajax']);
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
$this->success("操作成功,状态未改变",'',IS_AJAX);;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|