admin_admin.htm
10.2 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
221
222
223
224
225
{template header}
<!--{if $a == 'ls'}-->
<script src="js/common.js" type="text/javascript"></script>
<script src="js/calendar.js" type="text/javascript"></script>
<script type="text/javascript">
function switchbtn(btn) {
$('addadmindiv').className = btn == 'addadmin' ? 'tabcontentcur' : '' ;
$('editpwdiv').className = btn == 'addadmin' ? '' : 'tabcontentcur';
$('addadmin').className = btn == 'addadmin' ? 'tabcurrent' : '';
$('editpw').className = btn == 'addadmin' ? '' : 'tabcurrent';
$('addadmindiv').style.display = btn == 'addadmin' ? '' : 'none';
$('editpwdiv').style.display = btn == 'addadmin' ? 'none' : '';
}
function chkeditpw(theform) {
if(theform.oldpw.value == '') {
alert('{lang admin_pw_oldpw}');
theform.oldpw.focus();
return false;
}
if(theform.newpw.value == '') {
alert('{lang admin_pw_newpw}');
theform.newpw.focus();
return false;
}
if(theform.newpw2.value == '') {
alert('{lang admin_pw_newpw2}');
theform.newpw2.focus();
return false;
}
if(theform.newpw.value != theform.newpw2.value) {
alert('{lang admin_pw_incorrect}');
theform.newpw2.focus();
return false;
}
if(theform.newpw.value.length < 6 && !confirm('{lang admin_pw_too_short}')) {
theform.newpw.focus();
return false;
}
return true;
}
</script>
<div class="container">
<!--{if $status}-->
<div class="{if $status > 0}correctmsg{else}errormsg{/if}">
<p>
{if $status == 1} {lang admin_add_succeed}
{elseif $status == -1} {lang admin_add_succeed}
{elseif $status == -2} {lang admin_failed}
{elseif $status == -3}{lang admin_user_nonexistance}
{elseif $status == -4} {lang admin_config_unwritable}
{elseif $status == -5} {lang admin_founder_pw_incorrect}
{elseif $status == -6} {lang admin_pw_incorrect}
{elseif $status == 2} {lang admin_founder_pw_modified}
{/if}
</p>
</div>
<!--{/if}-->
<div class="hastabmenu" style="height:218px;">
<ul class="tabmenu">
<li id="addadmin" class="tabcurrent"><a href="#" onclick="switchbtn('addadmin');">{lang admin_add_admin}</a></li>
<!--{if $user['isfounder']}--><li id="editpw"><a href="#" onclick="switchbtn('editpw');">{lang admin_modify_founder_pw}</a></li><!--{/if}-->
</ul>
<div id="addadmindiv" class="tabcontentcur">
<form action="admin.php?m=admin&a=ls" method="post">
<input type="hidden" name="formhash" value="{FORMHASH}">
<table class="dbtb">
<tr>
<td class="tbtitle">{lang user_name}:</td>
<td><input type="text" name="addname" class="txt" /></td>
</tr>
<tr>
<td valign="top" class="tbtitle">{lang admin_privilege}:</td>
<td>
<ul class="dblist">
<li><input type="checkbox" name="allowadminsetting" value="1" class="checkbox" checked="checked" />{lang admin_allow_setting}</li>
<li><input type="checkbox" name="allowadminapp" value="1" class="checkbox" />{lang admin_allow_app}</li>
<li><input type="checkbox" name="allowadminuser" value="1" class="checkbox" />{lang admin_allow_user}</li>
<li><input type="checkbox" name="allowadminbadword" value="1" class="checkbox" checked="checked" />{lang admin_allow_badwords}</li>
<li><input type="checkbox" name="allowadmintag" value="1" class="checkbox" checked="checked" />{lang admin_allow_tag}</li>
<li><input type="checkbox" name="allowadminpm" value="1" class="checkbox" checked="checked" />{lang admin_allow_pm}</li>
<li><input type="checkbox" name="allowadmincredits" value="1" class="checkbox" checked="checked" />{lang admin_allow_credits}</li>
<li><input type="checkbox" name="allowadmindomain" value="1" class="checkbox" checked="checked" />{lang admin_allow_hosts}</li>
<li><input type="checkbox" name="allowadmindb" value="1" class="checkbox" />{lang admin_allow_database}</li>
<li><input type="checkbox" name="allowadminnote" value="1" class="checkbox" checked="checked" />{lang admin_allow_note}</li>
<li><input type="checkbox" name="allowadmincache" value="1" class="checkbox" checked="checked" />{lang admin_allow_cache}</li>
<li><input type="checkbox" name="allowadminlog" value="1" class="checkbox" checked="checked" />{lang admin_allow_log}</li>
</ul>
</td>
</tr>
<tr>
<td></td>
<td>
<input type="submit" name="addadmin" value="{lang submit}" class="btn" />
</td>
</tr>
</table>
</form>
</div>
<!--{if $user['isfounder']}-->
<div id="editpwdiv" class="tabcontent" style="display:none;">
<p class="i">{lang admin_editfoundertips}</p>
<form action="admin.php?m=admin&a=ls" onsubmit="return chkeditpw(this)" method="post">
<input type="hidden" name="formhash" value="{FORMHASH}">
<table class="dbtb" style="height:123px;">
<tr>
<td class="tbtitle">{lang oldpw}:</td>
<td><input type="password" name="oldpw" class="txt" /></td>
</tr>
<tr>
<td class="tbtitle">{lang newpw}:</td>
<td><input type="password" name="newpw" class="txt" /></td>
</tr>
<tr>
<td class="tbtitle">{lang repeatpw}:</td>
<td><input type="password" name="newpw2" class="txt" /></td>
</tr>
<tr>
<td></td>
<td>
<input type="submit" name="editpwsubmit" value="{lang submit}" class="btn" />
</td>
</tr>
</table>
</form>
</div>
<!--{/if}-->
</div>
<h3>{lang admin_list}</h3>
<div class="mainbox">
<!--{if $userlist}-->
<form action="admin.php?m=admin&a=ls" onsubmit="return confirm('{lang confirm_delete}');" method="post">
<input type="hidden" name="formhash" value="{FORMHASH}">
<table class="datalist fixwidth" onmouseover="addMouseEvent(this);">
<tr>
<th><input type="checkbox" name="chkall" id="chkall" onclick="checkall('delete[]')" value="1" class="checkbox" /><label for="chkall">{lang delete}</label></th>
<th>{lang user_name}</th>
<th>{lang email}</th>
<th>{lang user_regdate}</th>
<th>{lang user_regip}</th>
<th>{lang profile}</th>
<th>{lang privilege}</th>
</tr>
<!--{loop $userlist $user}-->
<tr>
<td class="option"><input type="checkbox" name="delete[]" value="$user[uid]" value="1" class="checkbox" /></td>
<td class="username">$user[username]</td>
<td>$user[email]</td>
<td class="date">$user[regdate]</td>
<td class="ip">$user[regip]</td>
<td class="ip"><a href="admin.php?m=user&a=edit&uid=$user[uid]&fromadmin=yes">{lang profile}</a></td>
<td class="ip"><a href="admin.php?m=admin&a=edit&uid=$user[uid]">{lang privilege}</a></td>
</tr>
<!--{/loop}-->
<tr class="nobg">
<td><input type="submit" value="{lang submit}" class="btn" /></td>
<td class="tdpage" colspan="4">$multipage</td>
</tr>
</table>
</form>
<!--{else}-->
<div class="note">
<p class="i">{lang list_empty}</p>
</div>
<!--{/if}-->
</div>
</div>
<!--{if $_POST['editpwsubmit']}-->
<script type="text/javascript">
switchbtn('editpw');
</script>
<!--{else}-->
<script type="text/javascript">
switchbtn('addadmin');
</script>
<!--{/if}-->
<!--{else}-->
<div class="container">
<h3 class="marginbot">{lang admin_edit_priv}<a href="admin.php?m=admin&a=ls" class="sgbtn">{lang admin_return_admin_ls}</a></h3>
<!--{if $status == 1}-->
<div class="correctmsg"><p>{lang admin_priv_modified_successfully}</p></div>
<!--{elseif $status == -1}-->
<div class="correctmsg"><p>{lang admin_priv_modified_failed}</p></div>
<!--{else}-->
<div class="note">{lang admin_modification_notice}</div>
<!--{/if}-->
<div class="mainbox">
<form action="admin.php?m=admin&a=edit&uid=$uid" method="post">
<input type="hidden" name="formhash" value="{FORMHASH}">
<table class="opt">
<tr>
<th>{lang admin_admin} $admin[username]:</th>
</tr>
<tr>
<td>
<ul>
<li><input type="checkbox" name="allowadminsetting" value="1" class="checkbox" {if $admin[allowadminsetting]} checked="checked" {/if}/>{lang admin_allow_setting}</li>
<li><input type="checkbox" name="allowadminapp" value="1" class="checkbox" {if $admin[allowadminapp]} checked="checked" {/if}/>{lang admin_allow_app}</li>
<li><input type="checkbox" name="allowadminuser" value="1" class="checkbox" {if $admin[allowadminuser]} checked="checked" {/if}/>{lang admin_allow_user}</li>
<li><input type="checkbox" name="allowadminbadword" value="1" class="checkbox" {if $admin[allowadminbadword]} checked="checked" {/if}/>{lang admin_allow_badwords}</li>
<li><input type="checkbox" name="allowadmintag" value="1" class="checkbox" {if $admin[allowadmintag]} checked="checked" {/if}/>{lang admin_allow_tag}</li>
<li><input type="checkbox" name="allowadminpm" value="1" class="checkbox" {if $admin[allowadminpm]} checked="checked" {/if}/>{lang admin_allow_pm}</li>
<li><input type="checkbox" name="allowadmincredits" value="1" class="checkbox" {if $admin[allowadmincredits]} checked="checked" {/if}/>{lang admin_allow_credits}</li>
<li><input type="checkbox" name="allowadmindomain" value="1" class="checkbox" {if $admin[allowadmindomain]} checked="checked" {/if}/>{lang admin_allow_hosts}</li>
<li><input type="checkbox" name="allowadmindb" value="1" class="checkbox" {if $admin[allowadmindb]} checked="checked" {/if}/>{lang admin_allow_database}</li>
<li><input type="checkbox" name="allowadminnote" value="1" class="checkbox" {if $admin[allowadminnote]} checked="checked" {/if}/>{lang admin_allow_note}</li>
<li><input type="checkbox" name="allowadmincache" value="1" class="checkbox" {if $admin[allowadmincache]} checked="checked" {/if}/>{lang admin_allow_cache}</li>
<li><input type="checkbox" name="allowadminlog" value="1" class="checkbox" {if $admin[allowadminlog]} checked="checked" {/if}/>{lang admin_allow_log}</li>
</ul>
</td>
</tr>
</table>
<div class="opt"><input type="submit" name="submit" value=" {lang submit} " class="btn" tabindex="3" /></div>
</form>
</div>
</div>
<!--{/if}-->
{template footer}