source: branches/rsr.v5.1.1/web/punbb/admin_permissions.php @ 4

Last change on this file since 4 was 4, checked in by dj3c1t, 12 years ago

passage en v5.1.1

File size: 10.0 KB
Line 
1<?php
2
3/**
4 * Copyright (C) 2008-2011 FluxBB
5 * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
6 * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
7 */
8
9// Tell header.php to use the admin template
10define('PUN_ADMIN_CONSOLE', 1);
11
12define('PUN_ROOT', dirname(__FILE__).'/');
13require PUN_ROOT.'include/common.php';
14require PUN_ROOT.'include/common_admin.php';
15
16
17if ($pun_user['g_id'] != PUN_ADMIN)
18        message($lang_common['No permission']);
19
20// Load the admin_permissions.php language file
21require PUN_ROOT.'lang/'.$admin_language.'/admin_permissions.php';
22
23if (isset($_POST['form_sent']))
24{
25        confirm_referrer('admin_permissions.php');
26
27        $form = array_map('intval', $_POST['form']);
28
29        foreach ($form as $key => $input)
30        {
31                // Only update values that have changed
32                if (array_key_exists('p_'.$key, $pun_config) && $pun_config['p_'.$key] != $input)
33                        $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());
34        }
35
36        // Regenerate the config cache
37        if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
38                require PUN_ROOT.'include/cache.php';
39
40        generate_config_cache();
41
42        redirect('admin_permissions.php', $lang_admin_permissions['Perms updated redirect']);
43}
44
45$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['Permissions']);
46define('PUN_ACTIVE_PAGE', 'admin');
47require PUN_ROOT.'header.php';
48
49generate_admin_menu('permissions');
50
51?>
52        <div class="blockform">
53                <h2><span><?php echo $lang_admin_permissions['Permissions head'] ?></span></h2>
54                <div class="box">
55                        <form method="post" action="admin_permissions.php">
56                                <p class="submittop"><input type="submit" name="save" value="<?php echo $lang_admin_common['Save changes'] ?>" /></p>
57                                <div class="inform">
58                                        <input type="hidden" name="form_sent" value="1" />
59                                        <fieldset>
60                                                <legend><?php echo $lang_admin_permissions['Posting subhead'] ?></legend>
61                                                <div class="infldset">
62                                                        <table class="aligntop" cellspacing="0">
63                                                                <tr>
64                                                                        <th scope="row"><?php echo $lang_admin_permissions['BBCode label'] ?></th>
65                                                                        <td>
66                                                                                <input type="radio" name="form[message_bbcode]" value="1"<?php if ($pun_config['p_message_bbcode'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[message_bbcode]" value="0"<?php if ($pun_config['p_message_bbcode'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
67                                                                                <span><?php echo $lang_admin_permissions['BBCode help'] ?></span>
68                                                                        </td>
69                                                                </tr>
70                                                                <tr>
71                                                                        <th scope="row"><?php echo $lang_admin_permissions['Image tag label'] ?></th>
72                                                                        <td>
73                                                                                <input type="radio" name="form[message_img_tag]" value="1"<?php if ($pun_config['p_message_img_tag'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[message_img_tag]" value="0"<?php if ($pun_config['p_message_img_tag'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
74                                                                                <span><?php echo $lang_admin_permissions['Image tag help'] ?></span>
75                                                                        </td>
76                                                                </tr>
77                                                                <tr>
78                                                                        <th scope="row"><?php echo $lang_admin_permissions['All caps message label'] ?></th>
79                                                                        <td>
80                                                                                <input type="radio" name="form[message_all_caps]" value="1"<?php if ($pun_config['p_message_all_caps'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[message_all_caps]" value="0"<?php if ($pun_config['p_message_all_caps'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
81                                                                                <span><?php echo $lang_admin_permissions['All caps message help'] ?></span>
82                                                                        </td>
83                                                                </tr>
84                                                                <tr>
85                                                                        <th scope="row"><?php echo $lang_admin_permissions['All caps subject label'] ?></th>
86                                                                        <td>
87                                                                                <input type="radio" name="form[subject_all_caps]" value="1"<?php if ($pun_config['p_subject_all_caps'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[subject_all_caps]" value="0"<?php if ($pun_config['p_subject_all_caps'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
88                                                                                <span><?php echo $lang_admin_permissions['All caps subject help'] ?></span>
89                                                                        </td>
90                                                                </tr>
91                                                                <tr>
92                                                                        <th scope="row"><?php echo $lang_admin_permissions['Require e-mail label'] ?></th>
93                                                                        <td>
94                                                                                <input type="radio" name="form[force_guest_email]" value="1"<?php if ($pun_config['p_force_guest_email'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[force_guest_email]" value="0"<?php if ($pun_config['p_force_guest_email'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
95                                                                                <span><?php echo $lang_admin_permissions['Require e-mail help'] ?></span>
96                                                                        </td>
97                                                                </tr>
98                                                        </table>
99                                                </div>
100                                        </fieldset>
101                                </div>
102                                <div class="inform">
103                                        <fieldset>
104                                                <legend><?php echo $lang_admin_permissions['Signatures subhead'] ?></legend>
105                                                <div class="infldset">
106                                                        <table class="aligntop" cellspacing="0">
107                                                                <tr>
108                                                                        <th scope="row"><?php echo $lang_admin_permissions['BBCode sigs label'] ?></th>
109                                                                        <td>
110                                                                                <input type="radio" name="form[sig_bbcode]" value="1"<?php if ($pun_config['p_sig_bbcode'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[sig_bbcode]" value="0"<?php if ($pun_config['p_sig_bbcode'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
111                                                                                <span><?php echo $lang_admin_permissions['BBCode sigs help'] ?></span>
112                                                                        </td>
113                                                                </tr>
114                                                                <tr>
115                                                                        <th scope="row"><?php echo $lang_admin_permissions['Image tag sigs label'] ?></th>
116                                                                        <td>
117                                                                                <input type="radio" name="form[sig_img_tag]" value="1"<?php if ($pun_config['p_sig_img_tag'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[sig_img_tag]" value="0"<?php if ($pun_config['p_sig_img_tag'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
118                                                                                <span><?php echo $lang_admin_permissions['Image tag sigs help'] ?></span>
119                                                                        </td>
120                                                                </tr>
121                                                                <tr>
122                                                                        <th scope="row"><?php echo $lang_admin_permissions['All caps sigs label'] ?></th>
123                                                                        <td>
124                                                                                <input type="radio" name="form[sig_all_caps]" value="1"<?php if ($pun_config['p_sig_all_caps'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[sig_all_caps]" value="0"<?php if ($pun_config['p_sig_all_caps'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
125                                                                                <span><?php echo $lang_admin_permissions['All caps sigs help'] ?></span>
126                                                                        </td>
127                                                                </tr>
128                                                                <tr>
129                                                                        <th scope="row"><?php echo $lang_admin_permissions['Max sig length label'] ?></th>
130                                                                        <td>
131                                                                                <input type="text" name="form[sig_length]" size="5" maxlength="5" value="<?php echo $pun_config['p_sig_length'] ?>" />
132                                                                                <span><?php echo $lang_admin_permissions['Max sig length help'] ?></span>
133                                                                        </td>
134                                                                </tr>
135                                                                <tr>
136                                                                        <th scope="row"><?php echo $lang_admin_permissions['Max sig lines label'] ?></th>
137                                                                        <td>
138                                                                                <input type="text" name="form[sig_lines]" size="3" maxlength="3" value="<?php echo $pun_config['p_sig_lines'] ?>" />
139                                                                                <span><?php echo $lang_admin_permissions['Max sig lines help'] ?></span>
140                                                                        </td>
141                                                                </tr>
142                                                        </table>
143                                                </div>
144                                        </fieldset>
145                                </div>
146                                <div class="inform">
147                                        <fieldset>
148                                                <legend><?php echo $lang_admin_permissions['Registration subhead'] ?></legend>
149                                                <div class="infldset">
150                                                        <table class="aligntop" cellspacing="0">
151                                                                <tr>
152                                                                        <th scope="row"><?php echo $lang_admin_permissions['Banned e-mail label'] ?></th>
153                                                                        <td>
154                                                                                <input type="radio" name="form[allow_banned_email]" value="1"<?php if ($pun_config['p_allow_banned_email'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[allow_banned_email]" value="0"<?php if ($pun_config['p_allow_banned_email'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
155                                                                                <span><?php echo $lang_admin_permissions['Banned e-mail help'] ?></span>
156                                                                        </td>
157                                                                </tr>
158                                                                <tr>
159                                                                        <th scope="row"><?php echo $lang_admin_permissions['Duplicate e-mail label'] ?></th>
160                                                                        <td>
161                                                                                <input type="radio" name="form[allow_dupe_email]" value="1"<?php if ($pun_config['p_allow_dupe_email'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[allow_dupe_email]" value="0"<?php if ($pun_config['p_allow_dupe_email'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
162                                                                                <span><?php echo $lang_admin_permissions['Duplicate e-mail help'] ?></span>
163                                                                        </td>
164                                                                </tr>
165                                                        </table>
166                                                </div>
167                                        </fieldset>
168                                </div>
169                                <p class="submitend"><input type="submit" name="save" value="<?php echo $lang_admin_common['Save changes'] ?>" /></p>
170                        </form>
171                </div>
172        </div>
173        <div class="clearer"></div>
174</div>
175<?php
176
177require PUN_ROOT.'footer.php';
Note: See TracBrowser for help on using the repository browser.