diff options
author | Paul S. Owen <psotfx@users.sourceforge.net> | 2002-10-26 12:36:38 +0000 |
---|---|---|
committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2002-10-26 12:36:38 +0000 |
commit | 1edc9d362f316c5f8149743f585f301703a966d8 (patch) | |
tree | 4c65dd50a681e6f6014d892f750e6aa139cb48a1 | |
parent | a7d186fd9127db566ec2ad0a66aaeabe2d569004 (diff) | |
download | forums-1edc9d362f316c5f8149743f585f301703a966d8.tar forums-1edc9d362f316c5f8149743f585f301703a966d8.tar.gz forums-1edc9d362f316c5f8149743f585f301703a966d8.tar.bz2 forums-1edc9d362f316c5f8149743f585f301703a966d8.tar.xz forums-1edc9d362f316c5f8149743f585f301703a966d8.zip |
Preliminary 'freeze' on permissions awaiting developer feedback, testing, etc. Caching of non-dynmaic config and acl option elements.
git-svn-id: file:///svn/phpbb/trunk@2970 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r-- | phpBB/admin/admin_ban.php | 16 | ||||
-rw-r--r-- | phpBB/admin/admin_board.php | 8 | ||||
-rw-r--r-- | phpBB/admin/admin_permissions.php | 22 | ||||
-rw-r--r-- | phpBB/admin/index.php | 4 | ||||
-rw-r--r-- | phpBB/common.php | 51 | ||||
-rw-r--r-- | phpBB/install/schemas/mysql_basic.sql | 137 | ||||
-rw-r--r-- | phpBB/install/schemas/mysql_schema.sql | 22 |
7 files changed, 136 insertions, 124 deletions
diff --git a/phpBB/admin/admin_ban.php b/phpBB/admin/admin_ban.php index fa672a935a..bd4c9775d1 100644 --- a/phpBB/admin/admin_ban.php +++ b/phpBB/admin/admin_ban.php @@ -41,17 +41,13 @@ $phpbb_root_path = '../'; require($phpbb_root_path . 'extension.inc'); require('pagestart.' . $phpEx); -// // Do we have ban permissions? -// if ( !$auth->acl_get('a_ban') ) { return; } -// // Mode setting -// if ( isset($_POST['mode']) || isset($_GET['mode']) ) { $mode = ( isset($_POST['mode']) ) ? $_POST['mode'] : $_GET['mode']; @@ -63,15 +59,15 @@ else $current_time = time(); -// // Start program -// -if ( isset($_POST['bansubmit']) ) +if ( isset($_POST['bansubmit']) || isset($_GET['bansubmit']) ) { - $ban_reason = ( isset($_POST['banreason']) ) ? $_POST['banreason'] : ''; - $ban_list = array_unique(explode("\n", $_POST['ban'])); + $ban = ( !empty($_POST['ban']) ) ? $_POST['ban'] : $_GET['ban']; + $ban_list = array_unique(explode("\n", $ban)); $ban_list_log = implode(', ', $ban_list); + $ban_reason = ( isset($_POST['banreason']) ) ? $_POST['banreason'] : ''; + if ( !empty($_POST['banlength']) ) { if ( $_POST['banlength'] != -1 || empty($_POST['banlengthother']) ) @@ -207,11 +203,9 @@ if ( isset($_POST['bansubmit']) ) for($i = 0; $i < count($ban_list); $i++) { - // // This ereg match is based on one by php@unreelpro.com // contained in the annotated php manual at php.com (ereg // section) - // if ( eregi('^(([[:alnum:]\*]+([-_.][[:alnum:]\*]+)*\.?)|(\*))@([[:alnum:]]+([-_]?[[:alnum:]]+)*\.){1,3}([[:alnum:]]{2,6})$', trim($ban_list[$i])) ) { $banlist[] = '\'' . trim($ban_list[$i]) . '\''; diff --git a/phpBB/admin/admin_board.php b/phpBB/admin/admin_board.php index 6f26eb934b..fb0b54997c 100644 --- a/phpBB/admin/admin_board.php +++ b/phpBB/admin/admin_board.php @@ -42,11 +42,12 @@ define('IN_PHPBB', 1); $phpbb_root_path = '../'; require($phpbb_root_path . 'extension.inc'); require('pagestart.' . $phpEx); +require($phpbb_root_path . 'includes/functions_admin.' . $phpEx); // Are we authed? if ( !$auth->acl_get('a_general') ) { - message_die(MESSAGE, $user->lang['No_admin']); + trigger_error($user->lang['No_admin']); } // Get mod @@ -83,8 +84,11 @@ while ( $row = $db->sql_fetchrow($result) ) if ( isset($_POST['submit']) ) { + // Re-cache config data + config_config($new); + add_admin_log('log_' . $mode . '_config'); - message_die(MESSAGE, $user->lang['Config_updated']); + trigger_error($user->lang['Config_updated']); } // diff --git a/phpBB/admin/admin_permissions.php b/phpBB/admin/admin_permissions.php index d1bbf440e9..05d83d9139 100644 --- a/phpBB/admin/admin_permissions.php +++ b/phpBB/admin/admin_permissions.php @@ -46,7 +46,7 @@ require($phpbb_root_path . 'includes/functions_admin.'.$phpEx); // Do we have forum admin permissions? if ( !$auth->acl_get('a_auth') ) { - message_die(MESSAGE, $user->lang['No_admin']); + trigger_error($user->lang['No_admin']); } // Define some vars @@ -78,16 +78,19 @@ switch ( $mode ) $l_title_explain = $user->lang['Permissions_explain']; $l_can = '_can'; break; + case 'moderators': $l_title = $user->lang['Moderators']; $l_title_explain = $user->lang['Moderators_explain']; $l_can = '_can'; break; + case 'supermoderators': $l_title = $user->lang['Super_Moderators']; $l_title_explain = $user->lang['Super_Moderators_explain']; $l_can = '_can'; break; + case 'administrators': $l_title = $user->lang['Administrators']; $l_title_explain = $user->lang['Administrators_explain']; @@ -147,12 +150,10 @@ else if ( isset($_POST['delete']) ) trigger_error('Permissions updated successfully'); } -// Get required information, either all forums if -// no id was specified or just the requsted if it -// was +// Get required information, either all forums if no id was +// specified or just the requsted if it was if ( !empty($forum_id) || $mode == 'administrators' || $mode == 'supermoderators' ) { -// // Clear some vars, grab some info if relevant ... $s_hidden_fields = ''; @@ -394,8 +395,8 @@ if ( !empty($forum_id) || $mode == 'administrators' || $mode == 'supermoderators // NEEDS COMPLETING ... OR SCRAPPING :D quick_options = new Array(); quick_options['basic'] = new Array(); - quick_options['basic']['allow'] = '34, 36,'; - quick_options['basic']['deny'] = '35,'; + quick_options['basic']['allow'] = ''; + quick_options['basic']['deny'] = ''; quick_options['basic']['inherit'] = ''; quick_options['advanced'] = new Array(); @@ -412,6 +413,7 @@ if ( !empty($forum_id) || $mode == 'administrators' || $mode == 'supermoderators { if (option) { + document.acl.set.selectedIndex = 0; var expr = new RegExp(/\d+/); for (i = 0; i < document.acl.length; i++) { @@ -478,9 +480,9 @@ if ( !empty($forum_id) || $mode == 'administrators' || $mode == 'supermoderators ?> <tr> <td class="<?php echo $row_class; ?>"><?php echo $l_can_cell; ?></td> - <td class="<?php echo $row_class; ?>" align="center"><input type="radio" name="option[<?php echo $auth_options[$i]['auth_option_id']; ?>]" value="<?php echo ACL_ALLOW; ?>"<?php echo $allow_type; ?> /></td> - <td class="<?php echo $row_class; ?>" align="center"><input type="radio" name="option[<?php echo $auth_options[$i]['auth_option_id']; ?>]" value="<?php echo ACL_DENY; ?>"<?php echo $deny_type; ?> /></td> - <td class="<?php echo $row_class; ?>" align="center"><input type="radio" name="option[<?php echo $auth_options[$i]['auth_option_id']; ?>]" value="<?php echo ACL_INHERIT; ?>"<?php echo $inherit_type; ?> /></td> + <td class="<?php echo $row_class; ?>" align="center"><input type="radio" name="option[<?php echo $auth_options[$i]['auth_value']; ?>]" value="<?php echo ACL_ALLOW; ?>"<?php echo $allow_type; ?> /></td> + <td class="<?php echo $row_class; ?>" align="center"><input type="radio" name="option[<?php echo $auth_options[$i]['auth_value']; ?>]" value="<?php echo ACL_DENY; ?>"<?php echo $deny_type; ?> /></td> + <td class="<?php echo $row_class; ?>" align="center"><input type="radio" name="option[<?php echo $auth_options[$i]['auth_value']; ?>]" value="<?php echo ACL_INHERIT; ?>"<?php echo $inherit_type; ?> /></td> </tr> <?php diff --git a/phpBB/admin/index.php b/phpBB/admin/index.php index 25a8b95ce9..e8a6c1d134 100644 --- a/phpBB/admin/index.php +++ b/phpBB/admin/index.php @@ -174,8 +174,8 @@ elseif ( isset($_GET['pane']) && $_GET['pane'] == 'right' ) } // Get forum statistics - $total_posts = get_db_stat('postcount'); - $total_topics = get_db_stat('topiccount'); + $total_posts = $board_config['num_posts']; + $total_topics = $board_config['num_topics']; $total_users = $board_config['num_users']; $start_date = $user->format_date($board_config['board_startdate']); diff --git a/phpBB/common.php b/phpBB/common.php index 2e527dcb87..e871afb8ed 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -37,6 +37,7 @@ if ( !get_magic_quotes_gpc() ) } require($phpbb_root_path . 'config.'.$phpEx); +require($phpbb_root_path . 'config_cache.'.$phpEx); if ( !defined('PHPBB_INSTALLED') ) { @@ -44,13 +45,11 @@ if ( !defined('PHPBB_INSTALLED') ) exit; } -// Set PHP error handler to ours -set_error_handler('msg_handler'); - -// Define some constants/variables -$board_config = array(); -$theme = array(); -$lang = array(); +// Include files +require($phpbb_root_path . 'includes/template.'.$phpEx); +require($phpbb_root_path . 'includes/session.'.$phpEx); +require($phpbb_root_path . 'includes/functions.'.$phpEx); +require($phpbb_root_path . 'db/' . $dbms . '.'.$phpEx); // User related define('ANONYMOUS', 0); @@ -135,22 +134,23 @@ define('VOTE_DESC_TABLE', $table_prefix.'vote_desc'); define('VOTE_RESULTS_TABLE', $table_prefix.'vote_results'); define('VOTE_USERS_TABLE', $table_prefix.'vote_voters'); -// Include files -require($phpbb_root_path . 'includes/template.'.$phpEx); -require($phpbb_root_path . 'includes/session.'.$phpEx); -require($phpbb_root_path . 'includes/functions.'.$phpEx); -require($phpbb_root_path . 'db/' . $dbms . '.'.$phpEx); -require($phpbb_root_path . 'config_cache.'.$phpEx); +// Set PHP error handler to ours +set_error_handler('msg_handler'); -// Instantiate some basic classes -$user = new user(); -$auth = new auth(); +// Need these here so instantiate them now $template = new Template(); $db = new sql_db($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false); -// Obtain boardwide default config +// Obtain boardwide default config (rebuilding cache if reqd) +if ( empty($board_config) ) +{ + require_once($phpbb_root_path . 'includes/functions_admin.'.$phpEx); + $board_config = config_config(); +} + $sql = "SELECT * - FROM " . CONFIG_TABLE; + FROM " . CONFIG_TABLE . " + WHERE is_dynamic = 1"; $result = $db->sql_query($sql, false); while ( $row = $db->sql_fetchrow($result) ) @@ -158,12 +158,23 @@ while ( $row = $db->sql_fetchrow($result) ) $board_config[$row['config_name']] = $row['config_value']; } +// Re-cache acl options if reqd +if ( empty($acl_options) ) +{ + require_once($phpbb_root_path . 'includes/functions_admin.'.$phpEx); + $auth_admin = new auth_admin(); + $acl_options = $auth_admin->acl_cache_options(); +} + +// Instantiate some basic classes +$user = new user(); +$auth = new auth(); + // Show 'Board is disabled' message if ( $board_config['board_disable'] && !defined('IN_ADMIN') && !defined('IN_LOGIN') ) { $message = ( !empty($board_config['board_disable_msg']) ) ? $board_config['board_disable_msg'] : 'Board_disable'; - message_die(MESSAGE, $message, 'Information'); - //trigger_error($message); + trigger_error($message); } // addslashes to vars if magic_quotes_gpc is off diff --git a/phpBB/install/schemas/mysql_basic.sql b/phpBB/install/schemas/mysql_basic.sql index 8c62c70d88..3c1d3fe8cf 100644 --- a/phpBB/install/schemas/mysql_basic.sql +++ b/phpBB/install/schemas/mysql_basic.sql @@ -41,20 +41,12 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('prune_enable','1') INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_enable','1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('privmsg_disable','0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('gzip_compress','0'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('record_online_users', '0'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('record_online_date', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('server_name', ''); INSERT INTO phpbb_config (config_name, config_value) VALUES ('server_port', ''); INSERT INTO phpbb_config (config_name, config_value) VALUES ('script_path', ''); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('newest_user_id', '1'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('newest_username', ''); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('num_users', '1'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('num_posts', '1'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('num_topics', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('limit_load', '2.0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('active_sessions', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('session_gc', '3600'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('session_last_gc', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('ip_check', '4'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '2.1.0 [20021004]'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_post_chars', '0'); @@ -84,58 +76,82 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('auth_method','db') INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_server', ''); INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_base_dn', ''); INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_uid', ''); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('record_online_users', '0', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('record_online_date', '0', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('newest_user_id', '1', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('newest_username', '', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('num_users', '1', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('num_posts', '1', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('num_topics', '1', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('session_last_gc', '0', 1); # -- auth options -INSERT INTO phpbb_auth_options (auth_value) VALUES ('f_'); -INSERT INTO phpbb_auth_options (auth_value) VALUES ('m_'); -INSERT INTO phpbb_auth_options (auth_value) VALUES ('a_'); - -INSERT INTO phpbb_auth_options (auth_value) VALUES ('f_list'); -INSERT INTO phpbb_auth_options (auth_value) VALUES ('f_read'); -INSERT INTO phpbb_auth_options (auth_value) VALUES ('f_post'); -INSERT INTO phpbb_auth_options (auth_value) VALUES ('f_reply'); -INSERT INTO phpbb_auth_options (auth_value) VALUES ('f_edit'); -INSERT INTO phpbb_auth_options (auth_value) VALUES ('f_delete'); -INSERT INTO phpbb_auth_options (auth_value) VALUES ('f_poll'); -INSERT INTO phpbb_auth_options (auth_value) VALUES ('f_vote'); -INSERT INTO phpbb_auth_options (auth_value) VALUES ('f_announce'); -INSERT INTO phpbb_auth_options (auth_value) VALUES ('f_sticky'); -INSERT INTO phpbb_auth_options (auth_value) VALUES ('f_attach'); -INSERT INTO phpbb_auth_options (auth_value) VALUES ('f_download'); -INSERT INTO phpbb_auth_options (auth_value) VALUES ('f_html'); -INSERT INTO phpbb_auth_options (auth_value) VALUES ('f_bbcode'); -INSERT INTO phpbb_auth_options (auth_value) VALUES ('f_smilies'); -INSERT INTO phpbb_auth_options (auth_value) VALUES ('f_img'); -INSERT INTO phpbb_auth_options (auth_value) VALUES ('f_flash'); -INSERT INTO phpbb_auth_options (auth_value) VALUES ('f_sigs'); -INSERT INTO phpbb_auth_options (auth_value) VALUES ('f_search'); -INSERT INTO phpbb_auth_options (auth_value) VALUES ('f_email'); -INSERT INTO phpbb_auth_options (auth_value) VALUES ('f_rate'); -INSERT INTO phpbb_auth_options (auth_value) VALUES ('f_print'); -INSERT INTO phpbb_auth_options (auth_value) VALUES ('f_ignoreflood'); -INSERT INTO phpbb_auth_options (auth_value) VALUES ('f_ignorequeue'); - -INSERT INTO phpbb_auth_options (auth_value) VALUES ('m_edit'); -INSERT INTO phpbb_auth_options (auth_value) VALUES ('m_delete'); -INSERT INTO phpbb_auth_options (auth_value) VALUES ('m_move'); -INSERT INTO phpbb_auth_options (auth_value) VALUES ('m_lock'); -INSERT INTO phpbb_auth_options (auth_value) VALUES ('m_split'); -INSERT INTO phpbb_auth_options (auth_value) VALUES ('m_merge'); -INSERT INTO phpbb_auth_options (auth_value) VALUES ('m_approve'); -INSERT INTO phpbb_auth_options (auth_value) VALUES ('m_unrate'); -INSERT INTO phpbb_auth_options (auth_value) VALUES ('m_auth'); - -INSERT INTO phpbb_auth_options (auth_value) VALUES ('a_general'); -INSERT INTO phpbb_auth_options (auth_value) VALUES ('a_user'); -INSERT INTO phpbb_auth_options (auth_value) VALUES ('a_group'); -INSERT INTO phpbb_auth_options (auth_value) VALUES ('a_forum'); -INSERT INTO phpbb_auth_options (auth_value) VALUES ('a_post'); -INSERT INTO phpbb_auth_options (auth_value) VALUES ('a_ban'); -INSERT INTO phpbb_auth_options (auth_value) VALUES ('a_auth'); -INSERT INTO phpbb_auth_options (auth_value) VALUES ('a_email'); -INSERT INTO phpbb_auth_options (auth_value) VALUES ('a_styles'); -INSERT INTO phpbb_auth_options (auth_value) VALUES ('a_backup'); -INSERT INTO phpbb_auth_options (auth_value) VALUES ('a_clearlogs'); +INSERT INTO phpbb_auth_options (auth_value, is_local) VALUES ('f_', 1); +INSERT INTO phpbb_auth_options (auth_value, is_local) VALUES ('f_list', 1); +INSERT INTO phpbb_auth_options (auth_value, is_local) VALUES ('f_read', 1); +INSERT INTO phpbb_auth_options (auth_value, is_local) VALUES ('f_post', 1); +INSERT INTO phpbb_auth_options (auth_value, is_local) VALUES ('f_reply', 1); +INSERT INTO phpbb_auth_options (auth_value, is_local) VALUES ('f_edit', 1); +INSERT INTO phpbb_auth_options (auth_value, is_local) VALUES ('f_delete', 1); +INSERT INTO phpbb_auth_options (auth_value, is_local) VALUES ('f_poll', 1); +INSERT INTO phpbb_auth_options (auth_value, is_local) VALUES ('f_vote', 1); +INSERT INTO phpbb_auth_options (auth_value, is_local) VALUES ('f_announce', 1); +INSERT INTO phpbb_auth_options (auth_value, is_local) VALUES ('f_sticky', 1); +INSERT INTO phpbb_auth_options (auth_value, is_local) VALUES ('f_attach', 1); +INSERT INTO phpbb_auth_options (auth_value, is_local) VALUES ('f_download', 1); +INSERT INTO phpbb_auth_options (auth_value, is_local) VALUES ('f_html', 1); +INSERT INTO phpbb_auth_options (auth_value, is_local) VALUES ('f_bbcode', 1); +INSERT INTO phpbb_auth_options (auth_value, is_local) VALUES ('f_smilies', 1); +INSERT INTO phpbb_auth_options (auth_value, is_local) VALUES ('f_img', 1); +INSERT INTO phpbb_auth_options (auth_value, is_local) VALUES ('f_flash', 1); +INSERT INTO phpbb_auth_options (auth_value, is_local) VALUES ('f_sigs', 1); +INSERT INTO phpbb_auth_options (auth_value, is_local) VALUES ('f_search', 1); +INSERT INTO phpbb_auth_options (auth_value, is_local) VALUES ('f_email', 1); +INSERT INTO phpbb_auth_options (auth_value, is_local) VALUES ('f_rate', 1); +INSERT INTO phpbb_auth_options (auth_value, is_local) VALUES ('f_print', 1); +INSERT INTO phpbb_auth_options (auth_value, is_local) VALUES ('f_ignoreflood', 1); +INSERT INTO phpbb_auth_options (auth_value, is_local) VALUES ('f_ignorequeue', 1); + +INSERT INTO phpbb_auth_options (auth_value, is_local, is_global) VALUES ('m_', 1, 1); +INSERT INTO phpbb_auth_options (auth_value, is_local, is_global) VALUES ('m_edit', 1, 1); +INSERT INTO phpbb_auth_options (auth_value, is_local, is_global) VALUES ('m_delete', 1, 1); +INSERT INTO phpbb_auth_options (auth_value, is_local, is_global) VALUES ('m_move', 1, 1); +INSERT INTO phpbb_auth_options (auth_value, is_local, is_global) VALUES ('m_lock', 1, 1); +INSERT INTO phpbb_auth_options (auth_value, is_local, is_global) VALUES ('m_split', 1, 1); +INSERT INTO phpbb_auth_options (auth_value, is_local, is_global) VALUES ('m_merge', 1, 1); +INSERT INTO phpbb_auth_options (auth_value, is_local, is_global) VALUES ('m_approve', 1, 1); +INSERT INTO phpbb_auth_options (auth_value, is_local, is_global) VALUES ('m_unrate', 1, 1); +INSERT INTO phpbb_auth_options (auth_value, is_local, is_global) VALUES ('m_auth', 1, 1); + +INSERT INTO phpbb_auth_options (auth_value, is_global) VALUES ('a_', 1); +INSERT INTO phpbb_auth_options (auth_value, is_global) VALUES ('a_confserver', 1); +INSERT INTO phpbb_auth_options (auth_value, is_global) VALUES ('a_confdefaults', 1); +INSERT INTO phpbb_auth_options (auth_value, is_global) VALUES ('a_user', 1); +INSERT INTO phpbb_auth_options (auth_value, is_global) VALUES ('a_useradd', 1); +INSERT INTO phpbb_auth_options (auth_value, is_global) VALUES ('a_userdel', 1); +INSERT INTO phpbb_auth_options (auth_value, is_global) VALUES ('a_names', 1); +INSERT INTO phpbb_auth_options (auth_value, is_global) VALUES ('a_group', 1); +INSERT INTO phpbb_auth_options (auth_value, is_global) VALUES ('a_groupadd', 1); +INSERT INTO phpbb_auth_options (auth_value, is_global) VALUES ('a_groupdel', 1); +INSERT INTO phpbb_auth_options (auth_value, is_global) VALUES ('a_forum', 1); +INSERT INTO phpbb_auth_options (auth_value, is_global) VALUES ('a_forumadd', 1); +INSERT INTO phpbb_auth_options (auth_value, is_global) VALUES ('a_forumdel', 1); +INSERT INTO phpbb_auth_options (auth_value, is_global) VALUES ('a_posts', 1); +INSERT INTO phpbb_auth_options (auth_value, is_global) VALUES ('a_ban', 1); +INSERT INTO phpbb_auth_options (auth_value, is_global) VALUES ('a_authforums', 1); +INSERT INTO phpbb_auth_options (auth_value, is_global) VALUES ('a_authmods', 1); +INSERT INTO phpbb_auth_options (auth_value, is_global) VALUES ('a_authadmins', 1); +INSERT INTO phpbb_auth_options (auth_value, is_global) VALUES ('a_email', 1); +INSERT INTO phpbb_auth_options (auth_value, is_global) VALUES ('a_styles', 1); +INSERT INTO phpbb_auth_options (auth_value, is_global) VALUES ('a_backup', 1); +INSERT INTO phpbb_auth_options (auth_value, is_global) VALUES ('a_restore', 1); +INSERT INTO phpbb_auth_options (auth_value, is_global) VALUES ('a_search', 1); +INSERT INTO phpbb_auth_options (auth_value, is_global) VALUES ('a_clearlogs', 1); + +INSERT INTO phpbb_auth_options (auth_value, is_global) VALUES ('u_', 1); +INSERT INTO phpbb_auth_options (auth_value, is_global) VALUES ('u_email', 1); +INSERT INTO phpbb_auth_options (auth_value, is_global) VALUES ('u_pm', 1); +INSERT INTO phpbb_auth_options (auth_value, is_global) VALUES ('u_avatar', 1); # -- phpbb_styles @@ -188,11 +204,6 @@ INSERT INTO phpbb_auth_groups (group_id, forum_id, auth_option_id, auth_allow_de INSERT INTO phpbb_auth_groups (group_id, forum_id, auth_option_id, auth_allow_deny) SELECT 2, 1, auth_option_id, 8 FROM phpbb_auth_options WHERE auth_value LIKE 'f_%'; INSERT INTO phpbb_auth_groups (group_id, forum_id, auth_option_id, auth_allow_deny) SELECT 5, 0, auth_option_id, 8 FROM phpbb_auth_options WHERE auth_value LIKE 'a_%'; -# -- Prefetch auth -INSERT INTO phpbb_auth_prefetch (user_id, forum_id, auth_option_id, auth_allow_deny) SELECT 0, 1, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_value IN ('f_list', 'f_read', 'f_post', 'f_reply'); -INSERT INTO phpbb_auth_prefetch (user_id, forum_id, auth_option_id, auth_allow_deny) SELECT 2, 0, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_value LIKE 'a_%'; -INSERT INTO phpbb_auth_prefetch (user_id, forum_id, auth_option_id, auth_allow_deny) SELECT 2, 1, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_value LIKE 'm_%'; - # -- Demo Topic INSERT INTO phpbb_topics (topic_id, topic_title, topic_poster, topic_time, topic_views, topic_replies, forum_id, topic_status, topic_type, topic_first_post_id, topic_last_post_id, topic_last_poster_id, topic_last_post_time) VALUES (1, 'Welcome to phpBB 2', 2, '972086460', 0, 0, 1, 0, 0, 1, 1, 2, 972086460); diff --git a/phpBB/install/schemas/mysql_schema.sql b/phpBB/install/schemas/mysql_schema.sql index 5e1be1b64d..cc28ace201 100644 --- a/phpBB/install/schemas/mysql_schema.sql +++ b/phpBB/install/schemas/mysql_schema.sql @@ -40,6 +40,8 @@ CREATE TABLE phpbb_auth_groups ( CREATE TABLE phpbb_auth_options ( auth_option_id tinyint(4) NOT NULL auto_increment, auth_value char(20) NOT NULL, + is_global tinyint(1) DEFAULT '0' NOT NULL, + is_local tinyint(1) DEFAULT '0' NOT NULL, founder_only tinyint(1) DEFAULT '0' NOT NULL, PRIMARY KEY (auth_option_id), KEY auth_value (auth_value) @@ -48,20 +50,6 @@ CREATE TABLE phpbb_auth_options ( # -------------------------------------------------------- # -# Table structure for table `phpbb_auth_prefetch` -# -CREATE TABLE phpbb_auth_prefetch ( - user_id mediumint(8) UNSIGNED NOT NULL default '0', - forum_id mediumint(8) unsigned NOT NULL default '0', - auth_option_id smallint(5) unsigned NOT NULL default '0', - auth_allow_deny tinyint(4) NOT NULL default '1', - KEY user_id (user_id), - KEY auth_option_id (auth_option_id) -); - - -# -------------------------------------------------------- -# # Table structure for table `phpbb_auth_users` # CREATE TABLE phpbb_auth_users ( @@ -99,7 +87,9 @@ CREATE TABLE phpbb_banlist ( CREATE TABLE phpbb_config ( config_name varchar(255) NOT NULL, config_value varchar(255) NOT NULL, - PRIMARY KEY (config_name) + is_dynamic DEFAULT '0' NOT NULL, + PRIMARY KEY (config_name), + KEY is_dynamic (is_dynamic) ); @@ -136,6 +126,7 @@ CREATE TABLE phpbb_forums ( forum_last_poster_name varchar(30), display_on_index tinyint(1) DEFAULT '1' NOT NULL, post_count_inc tinyint(1) DEFAULT '1' NOT NULL, + moderated tinyint(1) DEFAULT '0' NOT NULL, prune_enable tinyint(1) DEFAULT '0' NOT NULL, prune_next int(11) UNSIGNED, prune_days tinyint(4) UNSIGNED NOT NULL, @@ -144,7 +135,6 @@ CREATE TABLE phpbb_forums ( KEY left_id (left_id), KEY forum_last_post_id (forum_last_post_id) ); -# forum_last_topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, # -------------------------------------------------------- # |