-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathadmin_permissions.php
226 lines (205 loc) · 11.8 KB
/
admin_permissions.php
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
226
<?php
/***********************************************************************
Copyright (C) 2002-2005 Rickard Andersson ([email protected])
This file is part of PunBB.
PunBB is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
PunBB is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston,
MA 02111-1307 USA
************************************************************************/
// Tell header.php to use the admin template
define('PUN_ADMIN_CONSOLE', 1);
define('PUN_ROOT', './');
require PUN_ROOT.'include/common.php';
require PUN_ROOT.'include/common_admin.php';
if ($pun_user['g_id'] > PUN_ADMIN)
message($lang_common['No permission']);
if (isset($_POST['form_sent']))
{
confirm_referrer('admin_permissions.php');
$form = array_map('intval', $_POST['form']);
while (list($key, $input) = @each($form))
{
// Only update values that have changed
if (array_key_exists('p_'.$key, $pun_config) && $pun_config['p_'.$key] != $input)
$db->query('UPDATE '.$db->prefix.'config SET conf_value='.$input.' WHERE conf_name=\'p_'.$db->escape($key).'\'') or error('Unable to update board config', __FILE__, __LINE__, $db->error());
}
// Regenerate the config cache
require_once PUN_ROOT.'include/cache.php';
generate_config_cache();
redirect('admin_permissions.php', 'Permissions updated. Redirecting …');
}
$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Permissions';
require PUN_ROOT.'header.php';
generate_admin_menu('permissions');
?>
<div class="blockform">
<h2><span>Permissions</span></h2>
<div class="box">
<form method="post" action="admin_permissions.php">
<p class="submittop"><input type="submit" name="save" value="Save changes" /></p>
<div class="inform">
<input type="hidden" name="form_sent" value="1" />
<fieldset>
<legend>Posting</legend>
<div class="infldset">
<table summary="Bcode settings" class="aligntop" cellspacing="0">
<tr>
<th scope="row">BBCode</th>
<td>
<input type="radio" name="form[message_bbcode]" value="1"<?php if ($pun_config['p_message_bbcode'] == '1') echo ' checked="checked"' ?> /> <strong>Yes</strong> <input type="radio" name="form[message_bbcode]" value="0"<?php if ($pun_config['p_message_bbcode'] == '0') echo ' checked="checked"' ?> /> <strong>No</strong>
<span>Allow BBCode in posts (recommended).</span>
</td>
</tr>
<tr>
<th scope="row">Image tag</th>
<td>
<input type="radio" name="form[message_img_tag]" value="1"<?php if ($pun_config['p_message_img_tag'] == '1') echo ' checked="checked"' ?> /> <strong>Yes</strong> <input type="radio" name="form[message_img_tag]" value="0"<?php if ($pun_config['p_message_img_tag'] == '0') echo ' checked="checked"' ?> /> <strong>No</strong>
<span>Allow the BBCode [img][/img] tag in posts.</span>
</td>
</tr>
<tr>
<th scope="row">All caps message</th>
<td>
<input type="radio" name="form[message_all_caps]" value="1"<?php if ($pun_config['p_message_all_caps'] == '1') echo ' checked="checked"' ?> /> <strong>Yes</strong> <input type="radio" name="form[message_all_caps]" value="0"<?php if ($pun_config['p_message_all_caps'] == '0') echo ' checked="checked"' ?> /> <strong>No</strong>
<span>Allow a message to contain only capital letters.</span>
</td>
</tr>
<tr>
<th scope="row">All caps subject</th>
<td>
<input type="radio" name="form[subject_all_caps]" value="1"<?php if ($pun_config['p_subject_all_caps'] == '1') echo ' checked="checked"' ?> /> <strong>Yes</strong> <input type="radio" name="form[subject_all_caps]" value="0"<?php if ($pun_config['p_subject_all_caps'] == '0') echo ' checked="checked"' ?> /> <strong>No</strong>
<span>Allow a subject to contain only capital letters.</span>
</td>
</tr>
<tr>
<th scope="row">Require guest e-mail</th>
<td>
<input type="radio" name="form[force_guest_email]" value="1"<?php if ($pun_config['p_force_guest_email'] == '1') echo ' checked="checked"' ?> /> <strong>Yes</strong> <input type="radio" name="form[force_guest_email]" value="0"<?php if ($pun_config['p_force_guest_email'] == '0') echo ' checked="checked"' ?> /> <strong>No</strong>
<span>Require guests to supply an e-mail address when posting.</span>
</td>
</tr>
</table>
</div>
</fieldset>
</div>
<div class="inform">
<fieldset>
<legend>Signatures</legend>
<div class="infldset">
<table summary="signature settings" class="aligntop" cellspacing="0">
<tr>
<th scope="row">BBCodes in signatures</th>
<td>
<input type="radio" name="form[sig_bbcode]" value="1"<?php if ($pun_config['p_sig_bbcode'] == '1') echo ' checked="checked"' ?> /> <strong>Yes</strong> <input type="radio" name="form[sig_bbcode]" value="0"<?php if ($pun_config['p_sig_bbcode'] == '0') echo ' checked="checked"' ?> /> <strong>No</strong>
<span>Allow BBCodes in user signatures.</span>
</td>
</tr>
<tr>
<th scope="row">Image tag in signatures</th>
<td>
<input type="radio" name="form[sig_img_tag]" value="1"<?php if ($pun_config['p_sig_img_tag'] == '1') echo ' checked="checked"' ?> /> <strong>Yes</strong> <input type="radio" name="form[sig_img_tag]" value="0"<?php if ($pun_config['p_sig_img_tag'] == '0') echo ' checked="checked"' ?> /> <strong>No</strong>
<span>Allow the BBCode [img][/img] tag in user signatures (not recommended).</span>
</td>
</tr>
<tr>
<th scope="row">All caps signature</th>
<td>
<input type="radio" name="form[sig_all_caps]" value="1"<?php if ($pun_config['p_sig_all_caps'] == '1') echo ' checked="checked"' ?> /> <strong>Yes</strong> <input type="radio" name="form[sig_all_caps]" value="0"<?php if ($pun_config['p_sig_all_caps'] == '0') echo ' checked="checked"' ?> /> <strong>No</strong>
<span>Allow a signature to contain only capital letters.</span>
</td>
</tr>
<tr>
<th scope="row">Maximum signature length</th>
<td>
<input type="text" name="form[sig_length]" size="5" maxlength="5" value="<?php echo $pun_config['p_sig_length'] ?>" />
<span>The maximum number of characters a user signature may contain.</span>
</td>
</tr>
<tr>
<th scope="row">Maximum signature lines</th>
<td>
<input type="text" name="form[sig_lines]" size="3" maxlength="3" value="<?php echo $pun_config['p_sig_lines'] ?>" />
<span>The maximum number of lines a user signature may contain.</span>
</td>
</tr>
</table>
</div>
</fieldset>
</div>
<div class="inform">
<fieldset>
<legend>Moderators</legend>
<div class="infldset">
<table summary="user profiles" class="aligntop" cellspacing="0">
<tr>
<th scope="row">Edit user profiles</th>
<td>
<input type="radio" name="form[mod_edit_users]" value="1"<?php if ($pun_config['p_mod_edit_users'] == '1') echo ' checked="checked"' ?> /> <strong>Yes</strong> <input type="radio" name="form[mod_edit_users]" value="0"<?php if ($pun_config['p_mod_edit_users'] == '0') echo ' checked="checked"' ?> /> <strong>No</strong>
<span>Allow moderators to edit user profiles.</span>
</td>
</tr>
<tr>
<th scope="row">Rename users</th>
<td>
<input type="radio" name="form[mod_rename_users]" value="1"<?php if ($pun_config['p_mod_rename_users'] == '1') echo ' checked="checked"' ?> /> <strong>Yes</strong> <input type="radio" name="form[mod_rename_users]" value="0"<?php if ($pun_config['p_mod_rename_users'] == '0') echo ' checked="checked"' ?> /> <strong>No</strong>
<span>Allow moderators to rename users. Other moderators and administrators are excluded.</span>
</td>
</tr>
<tr>
<th scope="row">Change user passwords</th>
<td>
<input type="radio" name="form[mod_change_passwords]" value="1"<?php if ($pun_config['p_mod_change_passwords'] == '1') echo ' checked="checked"' ?> /> <strong>Yes</strong> <input type="radio" name="form[mod_change_passwords]" value="0"<?php if ($pun_config['p_mod_change_passwords'] == '0') echo ' checked="checked"' ?> /> <strong>No</strong>
<span>Allow moderators to change user passwords. Other moderators and administrators are excluded.</span>
</td>
</tr>
<tr>
<th scope="row">Ban users</th>
<td>
<input type="radio" name="form[mod_ban_users]" value="1"<?php if ($pun_config['p_mod_ban_users'] == '1') echo ' checked="checked"' ?> /> <strong>Yes</strong> <input type="radio" name="form[mod_ban_users]" value="0"<?php if ($pun_config['p_mod_ban_users'] == '0') echo ' checked="checked"' ?> /> <strong>No</strong>
<span>Allow moderators to ban users (and edit/remove current bans).</span>
</td>
</tr>
</table>
</div>
</fieldset>
</div>
<div class="inform">
<fieldset>
<legend>Registration</legend>
<div class="infldset">
<table summary="banned emails" class="aligntop" cellspacing="0">
<tr>
<th scope="row">Allow banned e-mail addresses</th>
<td>
<input type="radio" name="form[allow_banned_email]" value="1"<?php if ($pun_config['p_allow_banned_email'] == '1') echo ' checked="checked"' ?> /> <strong>Yes</strong> <input type="radio" name="form[allow_banned_email]" value="0"<?php if ($pun_config['p_allow_banned_email'] == '0') echo ' checked="checked"' ?> /> <strong>No</strong>
<span>Allow users to register with or change to a banned e-mail address/domain. If left at it's default setting (yes) this action will be allowed, but an alert e-mail will be sent to the mailing list (an effective way of detecting multiple registrations).</span>
</td>
</tr>
<tr>
<th scope="row">Allow duplicate e-mail addresses</th>
<td>
<input type="radio" name="form[allow_dupe_email]" value="1"<?php if ($pun_config['p_allow_dupe_email'] == '1') echo ' checked="checked"' ?> /> <strong>Yes</strong> <input type="radio" name="form[allow_dupe_email]" value="0"<?php if ($pun_config['p_allow_dupe_email'] == '0') echo ' checked="checked"' ?> /> <strong>No</strong>
<span>Controls whether users should be allowed to register with an e-mail address that another user already has. If allowed, an alert e-mail will be sent to the mailing list if a duplicate is detected.</span>
</td>
</tr>
</table>
</div>
</fieldset>
</div>
<p class="submitend"><input type="submit" name="save" value="Save changes" /></p>
</form>
</div>
</div>
<div class="clearer"></div>
</div>
<?php
require PUN_ROOT.'footer.php';