2 /***********************************************************************
4 Copyright (C) 2002-2005 Rickard Andersson (rickard@punbb.org)
6 This file is part of PunBB.
8 PunBB is free software; you can redistribute it and/or modify it
9 under the terms of the GNU General Public License as published
10 by the Free Software Foundation; either version 2 of the License,
11 or (at your option) any later version.
13 PunBB is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston,
23 ************************************************************************/
26 // Tell header.php to use the admin template
27 define('PUN_ADMIN_CONSOLE', 1);
29 define('PUN_ROOT', './');
30 require PUN_ROOT
.'include/common.php';
31 require PUN_ROOT
.'include/common_admin.php';
34 if ($pun_user['g_id'] > PUN_ADMIN
)
35 message($lang_common['No permission']);
38 if (isset($_POST['form_sent']))
40 confirm_referrer('admin_permissions.php');
42 $form = array_map('intval', $_POST['form']);
44 while (list($key, $input) = @each
($form))
46 // Only update values that have changed
47 if (array_key_exists('p_'.$key, $pun_config) && $pun_config['p_'.$key] != $input)
48 $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());
51 // Regenerate the config cache
52 require_once PUN_ROOT
.'include/cache.php';
53 generate_config_cache();
55 redirect('admin_permissions.php', 'Permissions updated. Redirecting …');
59 $page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Permissions';
60 require PUN_ROOT
.'header.php';
61 generate_admin_menu('permissions');
64 <div
class="blockform">
65 <h2
><span
>Permissions
</span
></h2
>
67 <form method
="post" action
="admin_permissions.php">
68 <p
class="submittop"><input type
="submit" name
="save" value
="Save changes" /></p
>
70 <input type
="hidden" name
="form_sent" value
="1" />
72 <legend
>Posting
</legend
>
73 <div
class="infldset">
74 <table
class="aligntop" cellspacing
="0">
76 <th scope
="row">BBCode
</th
>
78 <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
>
79 <span
>Allow BBCode in
posts (recommended
).</span
>
83 <th scope
="row">Image tag
</th
>
85 <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
>
86 <span
>Allow the BBCode
[img
][/img
] tag in posts
.</span
>
90 <th scope
="row">All caps message
</th
>
92 <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
>
93 <span
>Allow a message to contain only capital letters
.</span
>
97 <th scope
="row">All caps subject
</th
>
99 <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
>
100 <span
>Allow a subject to contain only capital letters
.</span
>
104 <th scope
="row">Require guest e
-mail
</th
>
106 <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
>
107 <span
>Require guests to supply an e
-mail address when posting
.</span
>
116 <legend
>Signatures
</legend
>
117 <div
class="infldset">
118 <table
class="aligntop" cellspacing
="0">
120 <th scope
="row">BBCodes in signatures
</th
>
122 <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
>
123 <span
>Allow BBCodes in user signatures
.</span
>
127 <th scope
="row">Image tag in signatures
</th
>
129 <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
>
130 <span
>Allow the BBCode
[img
][/img
] tag in user
signatures (not recommended
).</span
>
134 <th scope
="row">All caps signature
</th
>
136 <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
>
137 <span
>Allow a signature to contain only capital letters
.</span
>
141 <th scope
="row">Maximum signature length
</th
>
143 <input type
="text" name
="form[sig_length]" size
="5" maxlength
="5" value
="<?php echo $pun_config['p_sig_length'] ?>" />
144 <span
>The maximum number of characters a user signature may contain
.</span
>
148 <th scope
="row">Maximum signature lines
</th
>
150 <input type
="text" name
="form[sig_lines]" size
="3" maxlength
="3" value
="<?php echo $pun_config['p_sig_lines'] ?>" />
151 <span
>The maximum number of lines a user signature may contain
.</span
>
160 <legend
>Moderators
</legend
>
161 <div
class="infldset">
162 <table
class="aligntop" cellspacing
="0">
164 <th scope
="row">Edit user profiles
</th
>
166 <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
>
167 <span
>Allow moderators to edit user profiles
.</span
>
171 <th scope
="row">Rename users
</th
>
173 <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
>
174 <span
>Allow moderators to rename users
. Other moderators
and administrators are excluded
.</span
>
178 <th scope
="row">Change user passwords
</th
>
180 <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
>
181 <span
>Allow moderators to change user passwords
. Other moderators
and administrators are excluded
.</span
>
185 <th scope
="row">Ban users
</th
>
187 <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
>
188 <span
>Allow moderators to ban
users (and edit
/remove current bans
).</span
>
197 <legend
>Registration
</legend
>
198 <div
class="infldset">
199 <table
class="aligntop" cellspacing
="0">
201 <th scope
="row">Allow banned e
-mail addresses
</th
>
203 <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
>
204 <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>
208 <th scope="row">Allow duplicate e-mail addresses</th>
210 <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>
211 <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>
218 <p class="submitend"><input type="submit" name="save" value="Save changes" /></p>
222 <div class="clearer"></div>
226 require PUN_ROOT.'footer
.php
';