|
|
|
@ -438,4 +438,48 @@ class AuthManagerController extends AdminController{
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function dataempower() {
|
|
|
|
|
|
|
|
|
|
$auth_group = M('AuthGroup')->where( array('status'=>array('egt','0'),'module'=>'admin','type'=>AuthGroupModel::TYPE_ADMIN) )
|
|
|
|
|
->getfield('id,id,title,rules');
|
|
|
|
|
// var_dump($auth_group);die();
|
|
|
|
|
$empower_type = M('AuthGroup')->field('data_empower_type')->where(array('id'=>$_GET['group_id']))->find();
|
|
|
|
|
// var_dump($empower_type);die();
|
|
|
|
|
$this->assign('data_empower_type', $empower_type['data_empower_type']);
|
|
|
|
|
$this->assign('auth_group', $auth_group);
|
|
|
|
|
$this->display();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function dataEmpowerSave() {
|
|
|
|
|
$mid = I('id');
|
|
|
|
|
$gid = I('group_id');
|
|
|
|
|
$data_empower_type = I('data_empower_type');
|
|
|
|
|
|
|
|
|
|
if( empty($gid)||empty($data_empower_type) ){
|
|
|
|
|
$this->error('参数有误');
|
|
|
|
|
}
|
|
|
|
|
$AuthGroup = D('AuthGroup');
|
|
|
|
|
if( !$AuthGroup->find($gid)){
|
|
|
|
|
$this->error('用户组不存在');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( $mid && !$AuthGroup->checkModelId($mid)){
|
|
|
|
|
$this->error($AuthGroup->error);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($AuthGroup->where("id = {$gid}")->save(array('data_empower_type'=>$data_empower_type))) {
|
|
|
|
|
$this->success('操作成功',U('AuthManager/index'));
|
|
|
|
|
} else {
|
|
|
|
|
$this->error('操作失败');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getRootPromote() {
|
|
|
|
|
$promoteData = M('promote','tab_')->field('id as value,account as title')->where(array('level'=>1,'chain'=>'/'))->select();
|
|
|
|
|
|
|
|
|
|
$this->ajaxReturn(json_encode($promoteData));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|