diff --git a/application/admin/controller/auth/Group.php b/application/admin/controller/auth/Group.php index 8aebd666..488bf73e 100644 --- a/application/admin/controller/auth/Group.php +++ b/application/admin/controller/auth/Group.php @@ -84,12 +84,13 @@ class Group extends Backend if (!in_array($params['pid'], $this->childrenIds)) { $this->code = -1; + $this->msg = __(''); return; } $parentmodel = model("AuthGroup")->get($params['pid']); if (!$parentmodel) { - $this->code = -1; + $this->msg = __('The parent group can not found'); return; } // 父级别的规则节点 @@ -126,10 +127,10 @@ class Group extends Backend { $this->code = -1; $params = $this->request->post("row/a"); - // 复节点不能是它自身的子节点 + // 父节点不能是它自身的子节点 if (!in_array($params['pid'], $this->childrenIds)) { - $this->code = -1; + $this->msg = __('The parent group can not be its own child'); return; } $params['rules'] = explode(',', $params['rules']); @@ -137,7 +138,7 @@ class Group extends Backend $parentmodel = model("AuthGroup")->get($params['pid']); if (!$parentmodel) { - $this->code = -1; + $this->msg = __('The parent group can not found'); return; } // 父级别的规则节点 @@ -200,6 +201,11 @@ class Group extends Backend continue; } } + if (!$ids) + { + $this->msg = __('You can not delete group that contain child group and administrators'); + return; + } $count = $this->model->where('id', 'in', $ids)->delete(); if ($count) { diff --git a/application/admin/lang/zh-cn/auth/admin.php b/application/admin/lang/zh-cn/auth/admin.php new file mode 100644 index 00000000..0a36d7ce --- /dev/null +++ b/application/admin/lang/zh-cn/auth/admin.php @@ -0,0 +1,6 @@ + '所属组别', + 'Login time' => '最后登录', +]; diff --git a/application/admin/lang/zh-cn/auth/group.php b/application/admin/lang/zh-cn/auth/group.php new file mode 100644 index 00000000..89f3a8ee --- /dev/null +++ b/application/admin/lang/zh-cn/auth/group.php @@ -0,0 +1,7 @@ + '父组别不能是自身的子组别', + 'The parent group can not found' => '父组别未找到', + 'You can not delete group that contain child group and administrators' => '你不能删除含有子组和管理员的组', +]; diff --git a/application/admin/lang/zh-cn/auth/rule.php b/application/admin/lang/zh-cn/auth/rule.php new file mode 100644 index 00000000..d173e4d5 --- /dev/null +++ b/application/admin/lang/zh-cn/auth/rule.php @@ -0,0 +1,10 @@ + '显示全部', + 'Condition' => '条件', + 'Remark' => '备注', + 'Icon' => '图标', + 'Alert' => '警告', + 'If not necessary, use the command line to build rule' => '非必要情况下请使用命令行来生成', +]; diff --git a/application/admin/view/auth/rule/add.html b/application/admin/view/auth/rule/add.html index 1ec1f98e..469289ae 100644 --- a/application/admin/view/auth/rule/add.html +++ b/application/admin/view/auth/rule/add.html @@ -1,6 +1,6 @@