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
RevLine 
[1]1<?php
2
[3]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 */
[1]8
9// Tell header.php to use the admin template
10define('PUN_ADMIN_CONSOLE', 1);
11
[3]12define('PUN_ROOT', dirname(__FILE__).'/');
[1]13require PUN_ROOT.'include/common.php';
14require PUN_ROOT.'include/common_admin.php';
15
16
[3]17if ($pun_user['g_id'] != PUN_ADMIN)
[1]18        message($lang_common['No permission']);
19
[3]20// Load the admin_permissions.php language file
21require PUN_ROOT.'lang/'.$admin_language.'/admin_permissions.php';
[1]22
23if (isset($_POST['form_sent']))
24{
25        confirm_referrer('admin_permissions.php');
26
27        $form = array_map('intval', $_POST['form']);
28
[3]29        foreach ($form as $key => $input)
[1]30        {
31                // Only update values that have changed
32                if (array_key_exists('p_'.$key, $pun_config) && $pun_config['p_'.$key] != $input)
[3]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());
[1]34        }
35
36        // Regenerate the config cache
[3]37        if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
38                require PUN_ROOT.'include/cache.php';
39
[1]40        generate_config_cache();
41
[3]42        redirect('admin_permissions.php', $lang_admin_permissions['Perms updated redirect']);
[1]43}
44
[3]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';
[1]48
49generate_admin_menu('permissions');
50
51?>
52        <div class="blockform">
[3]53                <h2><span><?php echo $lang_admin_permissions['Permissions head'] ?></span></h2>
[1]54                <div class="box">
55                        <form method="post" action="admin_permissions.php">
[3]56                                <p class="submittop"><input type="submit" name="save" value="<?php echo $lang_admin_common['Save changes'] ?>" /></p>
[1]57                                <div class="inform">
[3]58                                        <input type="hidden" name="form_sent" value="1" />
[1]59                                        <fieldset>
[3]60                                                <legend><?php echo $lang_admin_permissions['Posting subhead'] ?></legend>
[1]61                                                <div class="infldset">
62                                                        <table class="aligntop" cellspacing="0">
63                                                                <tr>
[3]64                                                                        <th scope="row"><?php echo $lang_admin_permissions['BBCode label'] ?></th>
[1]65                                                                        <td>
[3]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>
[1]68                                                                        </td>
69                                                                </tr>
70                                                                <tr>
[3]71                                                                        <th scope="row"><?php echo $lang_admin_permissions['Image tag label'] ?></th>
[1]72                                                                        <td>
[3]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>
[1]75                                                                        </td>
76                                                                </tr>
77                                                                <tr>
[3]78                                                                        <th scope="row"><?php echo $lang_admin_permissions['All caps message label'] ?></th>
[1]79                                                                        <td>
[3]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>
[1]82                                                                        </td>
83                                                                </tr>
84                                                                <tr>
[3]85                                                                        <th scope="row"><?php echo $lang_admin_permissions['All caps subject label'] ?></th>
[1]86                                                                        <td>
[3]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>
[1]89                                                                        </td>
90                                                                </tr>
91                                                                <tr>
[3]92                                                                        <th scope="row"><?php echo $lang_admin_permissions['Require e-mail label'] ?></th>
[1]93                                                                        <td>
[3]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>
[1]96                                                                        </td>
97                                                                </tr>
98                                                        </table>
99                                                </div>
100                                        </fieldset>
101                                </div>
102                                <div class="inform">
103                                        <fieldset>
[3]104                                                <legend><?php echo $lang_admin_permissions['Signatures subhead'] ?></legend>
[1]105                                                <div class="infldset">
106                                                        <table class="aligntop" cellspacing="0">
107                                                                <tr>
[3]108                                                                        <th scope="row"><?php echo $lang_admin_permissions['BBCode sigs label'] ?></th>
[1]109                                                                        <td>
[3]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>
[1]112                                                                        </td>
113                                                                </tr>
114                                                                <tr>
[3]115                                                                        <th scope="row"><?php echo $lang_admin_permissions['Image tag sigs label'] ?></th>
[1]116                                                                        <td>
[3]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>
[1]119                                                                        </td>
120                                                                </tr>
121                                                                <tr>
[3]122                                                                        <th scope="row"><?php echo $lang_admin_permissions['All caps sigs label'] ?></th>
[1]123                                                                        <td>
[3]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>
[1]126                                                                        </td>
127                                                                </tr>
128                                                                <tr>
[3]129                                                                        <th scope="row"><?php echo $lang_admin_permissions['Max sig length label'] ?></th>
[1]130                                                                        <td>
131                                                                                <input type="text" name="form[sig_length]" size="5" maxlength="5" value="<?php echo $pun_config['p_sig_length'] ?>" />
[3]132                                                                                <span><?php echo $lang_admin_permissions['Max sig length help'] ?></span>
[1]133                                                                        </td>
134                                                                </tr>
135                                                                <tr>
[3]136                                                                        <th scope="row"><?php echo $lang_admin_permissions['Max sig lines label'] ?></th>
[1]137                                                                        <td>
138                                                                                <input type="text" name="form[sig_lines]" size="3" maxlength="3" value="<?php echo $pun_config['p_sig_lines'] ?>" />
[3]139                                                                                <span><?php echo $lang_admin_permissions['Max sig lines help'] ?></span>
[1]140                                                                        </td>
141                                                                </tr>
142                                                        </table>
143                                                </div>
144                                        </fieldset>
145                                </div>
146                                <div class="inform">
147                                        <fieldset>
[3]148                                                <legend><?php echo $lang_admin_permissions['Registration subhead'] ?></legend>
[1]149                                                <div class="infldset">
150                                                        <table class="aligntop" cellspacing="0">
151                                                                <tr>
[3]152                                                                        <th scope="row"><?php echo $lang_admin_permissions['Banned e-mail label'] ?></th>
[1]153                                                                        <td>
[3]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>
[1]156                                                                        </td>
157                                                                </tr>
158                                                                <tr>
[3]159                                                                        <th scope="row"><?php echo $lang_admin_permissions['Duplicate e-mail label'] ?></th>
[1]160                                                                        <td>
[3]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>
[1]163                                                                        </td>
164                                                                </tr>
165                                                        </table>
166                                                </div>
167                                        </fieldset>
168                                </div>
[3]169                                <p class="submitend"><input type="submit" name="save" value="<?php echo $lang_admin_common['Save changes'] ?>" /></p>
[1]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.