From 81830703f36985265ea1302bedf7fd39522b60e6 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Wed, 26 Feb 2020 18:19:51 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=92=E8=89=B2=E6=9D=83=E9=99=90-=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E6=97=A5=E5=BF=971?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AuthManagerController.class.php | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/Application/Admin/Controller/AuthManagerController.class.php b/Application/Admin/Controller/AuthManagerController.class.php index 2ee93a048..2505fe021 100644 --- a/Application/Admin/Controller/AuthManagerController.class.php +++ b/Application/Admin/Controller/AuthManagerController.class.php @@ -220,8 +220,18 @@ class AuthManagerController extends AdminController{ if ( empty($data['id']) ) { \Think\Log::actionLog('AuthManager/createGroup','authGroup',1); $r = $AuthGroup->add(); + addOperationLog(array( + "op_type"=>0, + "key"=> $_POST['title'], + "url"=>U("User/index") + )); }else{ \Think\Log::actionLog('AuthManager/editGroup','authGroup',1); + addOperationLog(array( + "op_type"=>1, + "key"=> $_POST['title'], + "url"=>U("User/index") + )); $r = $AuthGroup->save(); } if($r===false){ @@ -239,9 +249,46 @@ class AuthManagerController extends AdminController{ * @author 朱亚杰 */ public function changeStatus($method=null){ + //操作日志-begin + if(is_array ( $_REQUEST['id'] )){ + $ids = implode(",",$_REQUEST['id']); + }else{ + $ids = $_REQUEST['id']; + } + $lr = M("AuthGroup")->field('title,status')->where("id in ({$ids})")->select(); + $status = 0; + $op_name =''; + $op_type =1; if ( empty($_REQUEST['id']) ) { $this->error('请选择要操作的数据!'); } + // 1正常,为0禁用,-1为删除' + switch ( strtolower($method) ){ + case 'forbidgroup': + $status = 0; + $op_name = "禁用"; + break; + case 'resumegroup': + $status = 1; + $op_name = "正常"; + break; + case 'deletegroup': + $status = -1; + $op_name = "删除"; + $op_type = 2; + break; + } + foreach ($lr as $k => $v) { + if($v['status'] != $status){ + addOperationLog(array( + "op_type"=>$op_type, + "key"=> $v['title'], + "menu"=>"用户-管理组-角色权限-".$op_name, + "url"=>U("User/index") + )); + } + } + //操作日志end switch ( strtolower($method) ){ case 'forbidgroup': \Think\Log::actionLog('AuthManager/changeStatus?method=forbidGroup','AuthGroup',$_REQUEST['id']);