-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsystem_grant.php
More file actions
106 lines (106 loc) · 3.24 KB
/
system_grant.php
File metadata and controls
106 lines (106 loc) · 3.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<?php
require(dirname(__FILE__)."/include/config_base.php");
require(dirname(__FILE__)."/include/config_rglobals.php");
require_once(dirname(__FILE__)."/include/checklogin.php");
if($action=='save'){
$sql=new dedesql(false);
$query="select * from #@__menu where reid!=0";
$sql->setquery($query);
$sql->execute();
while($row=$sql->getarray()){
$array=$_POST['r'.$row['id']];
$size=count($array);
$grantstring="admin_AllowAll|";
for($i=0;$i<$size;$i++){
$grantstring=$grantstring.$array[$i]."|";
//echo $grantstring."<br>";
$sql->executenonequery("update #@__menu set rank='$grantstring' where id='".$row['id']."'");
}
}
$sql->close();
showmsg('系统权限分配数据已保存.','system_grant.php');
}
else{
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/2019/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf8" />
<link href="style/main.css" rel="stylesheet" type="text/css" />
<title><?php echo $cfg_softname;?>操作员管理</title>
</head>
<body>
<table width="100%" border="0" id="table_style_all" cellpadding="0" cellspacing="0">
<tr>
<td id="table_style" class="l_t"> </td>
<td> </td>
<td id="table_style" class="r_t"> </td>
</tr>
<tr>
<td> </td>
<td>
<table width="100%" border="0" cellpadding="0" cellspacing="2">
<tr>
<td><strong> 操作员权限管理</strong> <a href="system_boss.php?action=new">添加新的操作员</a> | <a href="system_boss.php">查看操作员列表</a> | <a href="system_grant.php">权限分配</a></td>
</tr>
<tr>
<td bgcolor="#FFFFFF">
<table width="100%" cellspacing="0" border="0" id="table_border">
<tr>
<td>
<center>系统操作
</td>
<td>
<center>可操作用户组
</td>
</tr>
<form action="system_grant.php?action=save" method="post">
<?php
$sql=new dedesql(false);
$query="select * from #@__menu where reid!=0";
$sql->setquery($query);
$sql->execute();
while($row=$sql->getarray()){
echo "<tr>
<td id='row_style' style='text-align:left'> ".$row['name']." <font color='#999999'>(文件:".$row['url'].")</font></td>
<td>";
$s=new dedesql(false);
$q1="select * from #@__usertype where rank>1";
$s->setquery($q1);
$s->execute();
while ($r1=$s->getarray()){
$tmparray = explode($r1['content'],$row['rank']);
if(count($tmparray)>1)
echo "<input type='checkbox' name='r".$row['id']."[]' value='".$r1['content']."' checked>".$r1['typename']."\r\n";
else
echo "<input type='checkbox' name='r".$row['id']."[]' value='".$r1['content']."'>".$r1['typename']."\r\n";
}
$s->close();
echo "</td>
</tr>";
}
$sql->close();
?>
<tr><td> </td><td><input type="submit" value="保存"></tr>
</form>
</table>
<?php
}
?>
</td>
</tr>
</table>
</td>
<td> </td>
</tr>
<tr>
<td id="table_style" class="l_b"> </td>
<td> </td>
<td id="table_style" class="r_b"> </td>
</tr>
</table>
<?php
copyright();
?>
</body>
</html>