AddUser.php
9.47 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
<?php
define('EmpireCMSAdmin','1');
require("../../class/connect.php");
require("../../class/db_sql.php");
require("../../class/functions.php");
$link=db_connect();
$empire=new mysqlquery();
$editor=1;
//驗證用戶
$lur=is_login();
$logininid=$lur['userid'];
$loginin=$lur['username'];
$loginrnd=$lur['rnd'];
$loginlevel=$lur['groupid'];
$loginadminstyleid=$lur['adminstyleid'];
//ehash
$ecms_hashur=hReturnEcmsHashStrAll();
//驗證權限
CheckLevel($logininid,$loginin,$classid,"user");
$enews=ehtmlspecialchars($_GET['enews']);
$url="<a href=ListUser.php".$ecms_hashur['whehref'].">管理用戶</a> >增加用戶";
if($enews=="EditUser")
{
$userid=(int)$_GET['userid'];
$r=$empire->fetch1("select username,adminclass,groupid,checked,styleid,filelevel,truename,email,classid from {$dbtbpre}enewsuser where userid='$userid'");
$addur=$empire->fetch1("select equestion,openip from {$dbtbpre}enewsuseradd where userid='$userid'");
$url="<a href=ListUser.php".$ecms_hashur['whehref'].">管理用戶</a> >修改用戶:<b>".$r[username]."</b>";
if($r[checked])
{$checked=" checked";}
}
//-----------用戶組
$sql=$empire->query("select groupid,groupname from {$dbtbpre}enewsgroup order by groupid desc");
while($gr=$empire->fetch($sql))
{
if($r[groupid]==$gr[groupid])
{$select=" selected";}
else
{$select="";}
$group.="<option value=".$gr[groupid].$select.">".$gr[groupname]."</option>";
}
//-----------後台樣式
$stylesql=$empire->query("select styleid,stylename,path from {$dbtbpre}enewsadminstyle order by styleid");
$style="";
while($styler=$empire->fetch($stylesql))
{
if($r[styleid]==$styler[styleid])
{$sselect=" selected";}
else
{$sselect="";}
$style.="<option value=".$styler[styleid].$sselect.">".$styler[stylename]."</option>";
}
//-----------部門
$userclasssql=$empire->query("select classid,classname from {$dbtbpre}enewsuserclass order by classid");
$userclass='';
while($ucr=$empire->fetch($userclasssql))
{
if($r[classid]==$ucr[classid])
{$select=" selected";}
else
{$select="";}
$userclass.="<option value='$ucr[classid]'".$select.">".$ucr[classname]."</option>";
}
//--------------------操作的欄目
$fcfile="../../data/fc/ListEnews.php";
$fcjsfile="../../data/fc/cmsclass.js";
if(file_exists($fcjsfile)&&file_exists($fcfile))
{
$class=GetFcfiletext($fcjsfile);
$acr=explode("|",$r[adminclass]);
$count=count($acr);
for($i=1;$i<$count-1;$i++)
{
$class=str_replace("<option value='$acr[$i]'","<option value='$acr[$i]' selected",$class);
}
}
else
{
$class=ShowClass_AddClass($r[adminclass],"n",0,"|-",0,3);
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>增加用戶 </title>
<link href="../adminstyle/<?=$loginadminstyleid?>/adminstyle.css" rel="stylesheet" type="text/css">
<script>
function selectalls(doselect,formvar)
{
var bool=doselect==1?true:false;
var selectform=document.getElementById(formvar);
for(var i=0;i<selectform.length;i++)
{
selectform.all[i].selected=bool;
}
}
</script>
</head>
<body>
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
<tr>
<td>位置:<?=$url?></td>
</tr>
</table>
<form name="form1" method="post" action="ListUser.php">
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
<?=$ecms_hashur['form']?>
<tr class="header">
<td height="25" colspan="2">增加用戶
<input name="userid" type="hidden" id="userid" value="<?=$userid?>"> <input name="oldusername" type="hidden" id="oldusername" value="<?=$r[username]?>">
<input name="enews" type="hidden" id="enews" value="<?=$enews?>"> <input name="oldadminclass" type="hidden" id="oldadminclass" value="<?=$r[adminclass]?>"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="22%" height="25">用戶名:</td>
<td width="78%" height="25"><input name="username" type="text" id="username" value="<?=$r[username]?>" size="32">
*</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25">是否禁止:</td>
<td height="25"><input name="checked" type="checkbox" id="checked" value="1"<?=$checked?>>
是</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25">密碼:</td>
<td height="25"><input name="password" type="password" id="password" size="32">
* <font color="#666666">(不想修改請留空)</font></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25">重複密碼:</td>
<td height="25"><input name="repassword" type="password" id="repassword" size="32">
* <font color="#666666">(不想修改請留空)</font></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25">安全提問:</td>
<td height="25"> <select name="equestion" id="equestion">
<option value="0"<?=$addur[equestion]==0?' selected':''?>>無安全提問</option>
<option value="1"<?=$addur[equestion]==1?' selected':''?>>母親的名字</option>
<option value="2"<?=$addur[equestion]==2?' selected':''?>>爺爺的名字</option>
<option value="3"<?=$addur[equestion]==3?' selected':''?>>父親出生的城市</option>
<option value="4"<?=$addur[equestion]==4?' selected':''?>>您其中一位老師的名字</option>
<option value="5"<?=$addur[equestion]==5?' selected':''?>>您個人計算機的型號</option>
<option value="6"<?=$addur[equestion]==6?' selected':''?>>您最喜歡的餐館名稱</option>
<option value="7"<?=$addur[equestion]==7?' selected':''?>>駕駛執照的最後四位數字</option>
</select> <font color="#666666">
<input name="oldequestion" type="hidden" id="oldequestion" value="<?=$addur[equestion]?>">
(如果啟用安全提問,登錄時需填入相應的項目才能登錄)</font></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25">安全回答:</td>
<td height="25"><input name="eanswer" type="text" id="eanswer" size="32">
<font color="#666666">(如果修改答案,請在此輸入新答案)</font></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25">姓名:</td>
<td height="25"><input name="truename" type="text" id="truename" value="<?=$r[truename]?>" size="32"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25">郵箱:</td>
<td height="25"><input name="email" type="text" id="email" value="<?=$r[email]?>" size="32"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25">用戶組(*):</td>
<td height="25"><select name="groupid" id="groupid">
<?=$group?>
</select> <input type="button" name="Submit62223222" value="管理用戶組" onclick="window.open('ListGroup.php<?=$ecms_hashur['whehref']?>');">
*</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25">所屬部門:</td>
<td height="25"><select name="classid" id="classid">
<option value="0">未分配</option>
<?=$userclass?>
</select> <input type="button" name="Submit622232222" value="管理部門" onclick="window.open('UserClass.php<?=$ecms_hashur['whehref']?>');"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25">後台樣式(*):</td>
<td height="25"><select name="styleid" id="styleid">
<?=$style?>
</select> <input type="button" name="Submit6222322" value="管理後台樣式" onclick="window.open('../template/AdminStyle.php<?=$ecms_hashur['whehref']?>');">
*</td>
</tr>
<tr bgcolor="#FFFFFF">
<td rowspan="2" valign="top"> <p><strong>管理的欄目信息:</strong><br>
<br>
<input name="filelevel" type="checkbox" id="filelevel" value="1"<?=$r[filelevel]==1?' checked':''?>>
應用於附件權限<br>
<br>
(多個,請用ctrl。)</p></td>
<td height="25" valign="top"> <select name="adminclass[]" size="12" multiple id="adminclassselect" style="width:270;">
<?=$class?>
</select>
[<a href="#empirecms" onclick="selectalls(0,'adminclassselect')">全部取消</a>]
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25" valign="top"> 注意事項:<font color="#FF0000">選擇父欄目會應用於子欄目,並且如果選擇父欄目,請勿選擇其子欄目</font>)</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25"><strong>允許登錄後台的 IP 列表:</strong><br>
只有當管理員處於本列表中的 IP 地址時才可以登錄後台,列表以外的地址訪問將視為 IP 被禁止.每個 IP 一行,既可輸入完整地址,也可只輸入
IP 開頭,例如 "192.168."(不含引號) 可匹配 192.168.0.0~192.168.255.255 範圍內的所有地址,留空為不限</td>
<td height="25"><textarea name="openip" cols="50" rows="8" id="openip"><?=$addur[openip]?></textarea></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25"> </td>
<td height="25"><input type="submit" name="Submit" value="提交"> <input type="reset" name="Submit2" value="重置"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25" colspan="2"><font color="#666666">說明:密碼設置6位以上,且密碼不能包含:$
& * # < > ' " / \ % ; 空格</font></td>
</tr>
</table>
</form>
</body>
</html>
<?php
db_close();
$empire=null;
?>