diff options
author | Paul S. Owen <psotfx@users.sourceforge.net> | 2002-08-03 23:52:33 +0000 |
---|---|---|
committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2002-08-03 23:52:33 +0000 |
commit | ca716517676cff9e66ebd301bf771891d0cb0962 (patch) | |
tree | 17560847b65989326f26d395f4b4aa363f4e4053 /phpBB/admin | |
parent | 66295f4bdae6eb6c0dd2f6d165d0faf3f9d7f10d (diff) | |
download | forums-ca716517676cff9e66ebd301bf771891d0cb0962.tar forums-ca716517676cff9e66ebd301bf771891d0cb0962.tar.gz forums-ca716517676cff9e66ebd301bf771891d0cb0962.tar.bz2 forums-ca716517676cff9e66ebd301bf771891d0cb0962.tar.xz forums-ca716517676cff9e66ebd301bf771891d0cb0962.zip |
Various updates
git-svn-id: file:///svn/phpbb/trunk@2816 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/admin')
-rw-r--r-- | phpBB/admin/admin_database.php | 142 | ||||
-rw-r--r-- | phpBB/admin/admin_email.php | 10 | ||||
-rw-r--r-- | phpBB/admin/admin_forums.php | 448 | ||||
-rw-r--r-- | phpBB/admin/admin_permissions.php | 47 | ||||
-rw-r--r-- | phpBB/admin/admin_prune.php | 10 | ||||
-rw-r--r-- | phpBB/admin/admin_prune_users.php | 6 | ||||
-rw-r--r-- | phpBB/admin/admin_search.php | 6 | ||||
-rw-r--r-- | phpBB/admin/admin_smilies.php | 42 | ||||
-rw-r--r-- | phpBB/admin/admin_styles.php | 52 | ||||
-rw-r--r-- | phpBB/admin/admin_users.php | 46 | ||||
-rw-r--r-- | phpBB/admin/admin_viewlogs.php | 4 | ||||
-rw-r--r-- | phpBB/admin/admin_words.php | 30 |
12 files changed, 421 insertions, 422 deletions
diff --git a/phpBB/admin/admin_database.php b/phpBB/admin/admin_database.php index 2a5c36ab82..2fde6824d9 100644 --- a/phpBB/admin/admin_database.php +++ b/phpBB/admin/admin_database.php @@ -18,17 +18,9 @@ * (at your option) any later version. * ***************************************************************************/ - -/*************************************************************************** -* We will attempt to create a file based backup of all of the data in the -* users phpBB database. The resulting file should be able to be imported by -* the db_restore.php function, or by using the mysql command_line -* -* Some functions are adapted from the upgrade_20.php script and others -* adapted from the unoficial phpMyAdmin 2.2.0. -***************************************************************************/ - -define('IN_PHPBB', 1); +// +// Some functions are adapted phpMyAdmin 2.2.0. +// if ( !empty($setmodules) ) { @@ -38,26 +30,29 @@ if ( !empty($setmodules) ) } $filename = basename(__FILE__); - $module['DB']['DB_Backup'] = $filename . "$SID&perform=backup"; + $module['DB']['DB_Backup'] = $filename . "$SID&mode=backup"; $file_uploads = @ini_get('file_uploads'); if( ( $file_uploads != 0 || empty($file_uploads) ) && strtolower($file_uploads) != 'off' && @phpversion() != '4.0.4pl1' ) { - $module['DB']['DB_Restore'] = $filename . "$SID&perform=restore"; + $module['DB']['DB_Restore'] = $filename . "$SID&mode=restore"; } return; } +define('IN_PHPBB', 1); // // Load default header // -$no_page_header = TRUE; -$phpbb_root_path = "../"; +$phpbb_root_path = '../'; require($phpbb_root_path . 'extension.inc'); require('pagestart.' . $phpEx); include($phpbb_root_path . 'includes/functions_admin.'.$phpEx); +// +// +// if ( !$acl->get_acl_admin('general') ) { message_die(MESSAGE, $lang['No_admin']); @@ -73,11 +68,11 @@ if ( !$acl->get_acl_admin('general') ) // Begin program proper // -if ( isset($HTTP_GET_VARS['perform']) || isset($HTTP_POST_VARS['perform']) ) +if ( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) ) { - $perform = ( isset($HTTP_POST_VARS['perform']) ) ? $HTTP_POST_VARS['perform'] : $HTTP_GET_VARS['perform']; + $mode = ( isset($HTTP_POST_VARS['mode']) ) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode']; - switch($perform) + switch($mode) { case 'backup': @@ -96,77 +91,73 @@ if ( isset($HTTP_GET_VARS['perform']) || isset($HTTP_POST_VARS['perform']) ) break; } - include('page_header_admin.'.$phpEx); - - $template->assign_vars(array( - "MESSAGE_TITLE" => $lang['Information'], - "MESSAGE_TEXT" => $lang['Backups_not_supported']) - ); - + message_die(MESSAGE, $lang['Backups_not_supported']); break; } - $tables = array('auth_access', 'banlist', 'categories', 'config', 'disallow', 'forums', 'forum_prune', 'groups', 'posts', 'posts_text', 'privmsgs', 'privmsgs_text', 'ranks', 'search_results', 'search_results', 'search_wordlist', 'search_wordmatch', 'sessions', 'smilies', 'themes', 'themes_name', 'topics', 'topics_watch', 'user_group', 'users', 'vote_desc', 'vote_results', 'vote_voters', 'words'); + $tables = array('search_wordlist', 'search_wordmatch', 'auth_access', 'banlist', 'categories', 'config', 'disallow', 'forums', 'forum_prune', 'groups', 'posts', 'posts_text', 'privmsgs', 'privmsgs_text', 'ranks', 'search_results', 'search_results', 'sessions', 'smilies', 'themes', 'themes_name', 'topics', 'topics_watch', 'user_group', 'users', 'vote_desc', 'vote_results', 'vote_voters', 'words'); + + $additional_tables = ( isset($HTTP_POST_VARS['additional_tables']) ) ? $HTTP_POST_VARS['additional_tables'] : ( ( isset($HTTP_GET_VARS['additional_tables']) ) ? $HTTP_GET_VARS['additional_tables'] : '' ); - $additional_tables = (isset($HTTP_POST_VARS['additional_tables'])) ? $HTTP_POST_VARS['additional_tables'] : ( ( isset($HTTP_GET_VARS['additional_tables']) ) ? $HTTP_GET_VARS['additional_tables'] : "" ); + $backup_type = ( isset($HTTP_POST_VARS['backup_type']) ) ? $HTTP_POST_VARS['backup_type'] : ( ( isset($HTTP_GET_VARS['backup_type']) ) ? $HTTP_GET_VARS['backup_type'] : '' ); - $backup_type = (isset($HTTP_POST_VARS['backup_type'])) ? $HTTP_POST_VARS['backup_type'] : ( ( isset($HTTP_GET_VARS['backup_type']) ) ? $HTTP_GET_VARS['backup_type'] : "" ); + $ignoresearch = ( !empty($HTTP_POST_VARS['ignoresearch']) ) ? $HTTP_POST_VARS['ignoresearch'] : ( ( !empty($HTTP_GET_VARS['ignoresearch']) ) ? $HTTP_GET_VARS['ignoresearch'] : 0 ); - $gzipcompress = (!empty($HTTP_POST_VARS['gzipcompress'])) ? $HTTP_POST_VARS['gzipcompress'] : ( ( !empty($HTTP_GET_VARS['gzipcompress']) ) ? $HTTP_GET_VARS['gzipcompress'] : 0 ); + $gzipcompress = ( !empty($HTTP_POST_VARS['gzipcompress']) ) ? $HTTP_POST_VARS['gzipcompress'] : ( ( !empty($HTTP_GET_VARS['gzipcompress']) ) ? $HTTP_GET_VARS['gzipcompress'] : 0 ); if ( !empty($additional_tables) ) { - if ( ereg(",", $additional_tables)) - { - $additional_tables = split(",", $additional_tables); + $additional_tables = explode(', ', $additional_tables); - for($i = 0; $i < count($additional_tables); $i++) - { - $tables[] = trim($additional_tables[$i]); - } - - } - else + for($i = 0; $i < count($additional_tables); $i++) { - $tables[] = trim($additional_tables); + $tables[] = trim($additional_tables[$i]); } + unset($additional_tables); } if ( !isset($HTTP_POST_VARS['backupstart']) && !isset($HTTP_GET_VARS['backupstart'])) { - $s_hidden_fields = '<input type="hidden" name="perform" value="backup" /><input type="hidden" name="drop" value="1" /><input type="hidden" name="perform" value="$perform" />'; + $s_hidden_fields = '<input type="hidden" name="mode" value="backup" /><input type="hidden" name="drop" value="1" /><input type="hidden" name="mode" value="$mode" />'; - page_header($lang['DB']); + page_header($lang['DB_Backup']); ?> <h1><?php echo $lang['DB_Backup']; ?></h1> <p><?php echo $lang['Backup_explain']; ?></p> -<form method="post" action="<?php echo "admin_db_utilities.$phpEx$SID"; ?>"><table cellspacing="1" cellpadding="4" border="0" align="center" bgcolor="#98AAB1"> +<form method="post" action="<?php echo "admin_db_utilities.$phpEx$SID&mode=$mode"; ?>"><table class="bg" width="80%" cellspacing="1" cellpadding="4" border="0" align="center"> <tr> <th colspan="2"><?php echo $lang['Backup_options']; ?></th> </tr> <tr> - <td class="row2"><?php echo $lang['Full_backup']; ?></td> - <td class="row2"><input type="radio" name="backup_type" value="full" checked /></td> + <td class="row1"><?php echo $lang['Backup_type']; ?></td> + <td class="row2"><input type="radio" name="backup_type" value="full" checked="checked" /> <?php echo $lang['Full_backup']; ?> <input type="radio" name="backup_type" value="structure" /> <?php echo $lang['Structure_only']; ?> <input type="radio" name="backup_type" value="data" /> <?php echo $lang['Data_only']; ?></td> </tr> <tr> - <td class="row1"><?php echo $lang['Structure_backup']; ?></td> - <td class="row1"><input type="radio" name="backup_type" value="structure" /></td> + <td class="row1"><?php echo $lang['Include_search_index']; ?><br /><span class="gensmall"><?php echo $lang['Include_search_index_explain']; ?></span></td> + <td class="row2"><input type="radio" name="ignoresearch" value="0" /> <?php echo $lang['No']; ?> <input type="radio" name="ignoresearch" value="1" checked="checked" /> <?php echo $lang['Yes']; ?></td> </tr> <tr> - <td class="row2"><?php echo $lang['Data_backup']; ?></td> - <td class="row2"><input type="radio" name="backup_type" value="data" /></td> - </tr> - <tr> - <td class="row1"><?php echo $lang['Additional_tables']; ?></td> - <td class="row1"><input type="text" name="additional_tables" /></td> + <td class="row1"><?php echo $lang['Additional_tables']; ?><br /><span class="gensmall"><?php echo $lang['Additional_tables_explain']; ?></span></td> + <td class="row2"><input type="text" name="additional_tables" size="40" /></td> </tr> +<?php + + if ( extension_loaded('zlib') ) + { + +?> <tr> <td class="row1"><?php echo $lang['Gzip_compress']; ?></td> - <td class="row1"><?php echo $lang['No']; ?> <input type="radio" name="gzipcompress" value="0" checked /> <?php echo $lang['Yes']; ?> <input type="radio" name="gzipcompress" value="1" /></td> + <td class="row2"><input type="radio" name="gzipcompress" value="0" checked="checked" /> <?php echo $lang['No']; ?> <input type="radio" name="gzipcompress" value="1" /> <?php echo $lang['Yes']; ?></td> </tr> +<?php + + } + +?> <tr> <td class="cat" colspan="2" align="center"><?php echo $s_hidden_fields; ?><input type="submit" name="backupstart" value="<?php echo $lang['Start_backup']; ?>" class="mainoption" /></td> </tr> @@ -180,7 +171,7 @@ if ( isset($HTTP_GET_VARS['perform']) || isset($HTTP_POST_VARS['perform']) ) else if ( !isset($HTTP_POST_VARS['startdownload']) && !isset($HTTP_GET_VARS['startdownload']) ) { $template->assign_vars(array( - "META" => "<meta http-equiv=\"refresh\" content=\"0;url=admin_db_utilities.$phpEx?perform=backup&additional_tables=" . quotemeta($additional_tables) . "&backup_type=$backup_type&drop=1&backupstart=1&gzipcompress=$gzipcompress&startdownload=1\">", + "META" => "<meta http-equiv=\"refresh\" content=\"0;url=admin_db_utilities.$phpEx?mode=backup&additional_tables=" . quotemeta($additional_tables) . "&backup_type=$backup_type&drop=1&backupstart=1&gzipcompress=$gzipcompress&startdownload=1\">", "MESSAGE_TITLE" => $lang['Database_Utilities'] . " : " . $lang['Backup'], "MESSAGE_TEXT" => $lang['Backup_download']) @@ -229,14 +220,15 @@ if ( isset($HTTP_GET_VARS['perform']) || isset($HTTP_POST_VARS['perform']) ) echo "#\n# DATE : " . gmdate("d-m-Y H:i:s", time()) . " GMT\n"; echo "#\n"; - if(SQL_LAYER == 'postgresql') + if ( SQL_LAYER == 'postgresql' ) { echo "\n" . pg_get_sequences("\n", $backup_type); } + for($i = 0; $i < count($tables); $i++) { $table_name = $tables[$i]; - if(SQL_LAYER != 'mysql4') + if ( SQL_LAYER != 'mysql4' ) { $table_def_function = "get_table_def_" . SQL_LAYER; $table_content_function = "get_table_content_" . SQL_LAYER; @@ -247,19 +239,19 @@ if ( isset($HTTP_GET_VARS['perform']) || isset($HTTP_POST_VARS['perform']) ) $table_content_function = "get_table_content_mysql"; } - if($backup_type != 'data') + if ( $backup_type != 'data' ) { echo "#\n# TABLE: " . $table_prefix . $table_name . "\n#\n"; echo $table_def_function($table_prefix . $table_name, "\n") . "\n"; } - if($backup_type != 'structure') + if ( $backup_type != 'structure' ) { $table_content_function($table_prefix . $table_name, "output_table_content"); } } - if($do_gzip_compress) + if ( $do_gzip_compress ) { $Size = ob_get_length(); $Crc = crc32(ob_get_contents()); @@ -275,9 +267,9 @@ if ( isset($HTTP_GET_VARS['perform']) || isset($HTTP_POST_VARS['perform']) ) if ( !isset($restore_start) ) { - $s_hidden_fields = '<input type="hidden" name="perform" value="restore" /><input type="hidden" name="perform" value="$perform" />'; + $s_hidden_fields = '<input type="hidden" name="mode" value="restore" /><input type="hidden" name="mode" value="$mode" />'; - page_header($lang['DB']); + page_header($lang['DB_Restore']); ?> @@ -285,14 +277,21 @@ if ( isset($HTTP_GET_VARS['perform']) || isset($HTTP_POST_VARS['perform']) ) <p><?php echo $lang['Restore_explain']; ?></p> -<form enctype="multipart/form-data" method="post" action="<?php echo "admin_db_utilities.$phpEx$SID"; ?>"><table cellspacing="1" cellpadding="4" border="0" align="center" bgcolor="#98AAB1"> +<form enctype="multipart/form-data" method="post" action="<?php echo "admin_db_utilities.$phpEx$SID&mode=$mode"; ?>"><table class="bg" width="80%" cellspacing="1" cellpadding="4" border="0" align="center"> + <th colspan="2"><?php echo $lang['Select_file']; ?></th> + </tr> <tr> - <th class="th"><?php echo $lang['Select_file']; ?></th> + <td class="row1"><?php echo $lang['Upload_file']; ?>: </td> + <td class="row2"><input type="file" name="backup_file" /></td> </tr> <tr> - <td class="row1" align="center"><?php echo $s_hidden_fields; ?> <input type="file" name="backup_file"> <input type="submit" name="restore_start" value="<?php echo $lang['Start_Restore']; ?>" class="mainoption" /> </td> + <td class="row1"><?php echo $lang['Local_backup_file']; ?>: <br /><span class="gensmall"><?php echo $lang['Local_backup_file_explain']; ?></span></td> + <td class="row2"><input type="text" name="local_file" size="40" /></td> </tr> -</table></form> + <tr> + <td class="cat" colspan="2" align="center"><input type="submit" name="restore_start" value="<?php echo $lang['Start_Restore']; ?>" class="mainoption" /></td> + </trs> +</table><?php echo $s_hidden_fields; ?></form> <?php @@ -417,17 +416,10 @@ if ( isset($HTTP_GET_VARS['perform']) || isset($HTTP_POST_VARS['perform']) ) } } -?> - - </td> - </tr> -</table> - -<?php page_footer(); -// ----------------------- +// ----------------------------------------------- // The following functions are adapted from phpMyAdmin and upgrade_20.php // function gzip_PrintFourChars($Val) @@ -1016,6 +1008,6 @@ function output_table_content($content) } // // End Functions -// ------------- +// ----------------------------------------------- ?>
\ No newline at end of file diff --git a/phpBB/admin/admin_email.php b/phpBB/admin/admin_email.php index 6c99d61fe1..e1e6af523d 100644 --- a/phpBB/admin/admin_email.php +++ b/phpBB/admin/admin_email.php @@ -116,7 +116,7 @@ if ( isset($HTTP_POST_VARS['submit']) ) $email_headers .= 'X-AntiAbuse: Board servername - ' . $server_name . "\n"; $email_headers .= 'X-AntiAbuse: User_id - ' . $userdata['user_id'] . "\n"; $email_headers .= 'X-AntiAbuse: Username - ' . $userdata['username'] . "\n"; - $email_headers .= 'X-AntiAbuse: User IP - ' . $user_ip . "\r\n"; + $email_headers .= 'X-AntiAbuse: User IP - ' . $user_ip . "\n"; $emailer->use_template('admin_send_email'); $emailer->email_address($board_config['board_email']); @@ -132,9 +132,7 @@ if ( isset($HTTP_POST_VARS['submit']) ) $emailer->send(); $emailer->reset(); - $message = $lang['Email_sent'] . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . "index.$phpEx$SID?pane=right" . '">', '</a>'); - - message_die(MESSAGE, $message); + message_die(MESSAGE, $lang['Email_sent']); } } @@ -157,11 +155,11 @@ if ( $row = $db->sql_fetchrow($result) ) } $select_list .= '</select>'; -page_header($lang['Users']); +page_header($lang['Mass_Email']); ?> -<h1><?php echo $lang['Email']; ?></h1> +<h1><?php echo $lang['Mass_Email']; ?></h1> <p><?php echo $lang['Mass_email_explain']; ?></p> diff --git a/phpBB/admin/admin_forums.php b/phpBB/admin/admin_forums.php index 644bd7ebfb..ce5ad24541 100644 --- a/phpBB/admin/admin_forums.php +++ b/phpBB/admin/admin_forums.php @@ -1,6 +1,6 @@ <?php /*************************************************************************** - * admin_forums.php + * admin_forums.php * ------------------- * begin : Thursday, Jul 12, 2001 * copyright : (C) 2001 The phpBB Group @@ -8,7 +8,6 @@ * * $Id$ * - * ***************************************************************************/ /*************************************************************************** @@ -20,213 +19,51 @@ * ***************************************************************************/ -define('IN_PHPBB', 1); - -if( !empty($setmodules) ) +if ( !empty($setmodules) ) { + if ( !$acl->get_acl_admin('forum') ) + { + return; + } + $file = basename(__FILE__); $module['Forums']['Manage'] = $file . $SID; return; } +define('IN_PHPBB', 1); // -// Load default header +// Include files // -$phpbb_root_path = "../"; +$phpbb_root_path = '../'; require($phpbb_root_path . 'extension.inc'); require('pagestart.' . $phpEx); include($phpbb_root_path . 'includes/functions_admin.'.$phpEx); -$forum_auth_ary = array( - "auth_view" => AUTH_ALL, - "auth_read" => AUTH_ALL, - "auth_post" => AUTH_ALL, - "auth_reply" => AUTH_ALL, - "auth_edit" => AUTH_REG, - "auth_delete" => AUTH_REG, - "auth_sticky" => AUTH_REG, - "auth_announce" => AUTH_MOD, - "auth_vote" => AUTH_REG, - "auth_pollcreate" => AUTH_REG -); - // -// Mode setting +// Do we have forum admin permissions? // -if( isset($HTTP_POST_VARS['mode']) || isset($HTTP_GET_VARS['mode']) ) -{ - $mode = ( isset($HTTP_POST_VARS['mode']) ) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode']; -} -else +if ( !$acl->get_acl_admin('forum') ) { - $mode = ""; + message_die(MESSAGE, $lang['No_admin']); } -// ------------------ -// Begin function block // -function get_info($mode, $id) -{ - global $db; - - switch($mode) - { - case 'category': - $table = CATEGORIES_TABLE; - $idfield = 'cat_id'; - $namefield = 'cat_title'; - break; - - case 'forum': - $table = FORUMS_TABLE; - $idfield = 'forum_id'; - $namefield = 'forum_name'; - break; - - default: - message_die(GENERAL_ERROR, "Wrong mode for generating select list", "", __LINE__, __FILE__); - break; - } - $sql = "SELECT count(*) as total - FROM $table"; - if( !$result = $db->sql_query($sql) ) - { - message_die(GENERAL_ERROR, "Couldn't get Forum/Category information", "", __LINE__, __FILE__, $sql); - } - $count = $db->sql_fetchrow($result); - $count = $count['total']; - - $sql = "SELECT * - FROM $table - WHERE $idfield = $id"; - - if( !$result = $db->sql_query($sql) ) - { - message_die(GENERAL_ERROR, "Couldn't get Forum/Category information", "", __LINE__, __FILE__, $sql); - } - - if( $db->sql_numrows($result) != 1 ) - { - message_die(GENERAL_ERROR, "Forum/Category doesn't exist or multiple forums/categories with ID $id", "", __LINE__, __FILE__); - } - - $return = $db->sql_fetchrow($result); - $return['number'] = $count; - return $return; -} - -function get_list($mode, $id, $select) +// Mode setting +// +if ( isset($HTTP_POST_VARS['mode']) || isset($HTTP_GET_VARS['mode']) ) { - global $db; - - switch($mode) - { - case 'category': - $table = CATEGORIES_TABLE; - $idfield = 'cat_id'; - $namefield = 'cat_title'; - break; - - case 'forum': - $table = FORUMS_TABLE; - $idfield = 'forum_id'; - $namefield = 'forum_name'; - break; - - default: - message_die(GENERAL_ERROR, "Wrong mode for generating select list", "", __LINE__, __FILE__); - break; - } - - $sql = "SELECT * - FROM $table"; - if( $select == 0 ) - { - $sql .= " WHERE $idfield <> $id"; - } - - if( !$result = $db->sql_query($sql) ) - { - message_die(GENERAL_ERROR, "Couldn't get list of Categories/Forums", "", __LINE__, __FILE__, $sql); - } - - $cat_list = ""; - - while( $row = $db->sql_fetchrow($result) ) - { - $s = ""; - if ($row[$idfield] == $id) - { - $s = " selected=\"selected\""; - } - $catlist .= "<option value=\"$row[$idfield]\"$s>" . $row[$namefield] . "</option>\n"; - } - - return($catlist); + $mode = ( isset($HTTP_POST_VARS['mode']) ) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode']; } - -function renumber_order($mode, $cat = 0) +else { - global $db; - - switch($mode) - { - case 'category': - $table = CATEGORIES_TABLE; - $idfield = 'cat_id'; - $orderfield = 'cat_order'; - $cat = 0; - break; - - case 'forum': - $table = FORUMS_TABLE; - $idfield = 'forum_id'; - $orderfield = 'forum_order'; - $catfield = 'cat_id'; - break; - - default: - message_die(GENERAL_ERROR, "Wrong mode for generating select list", "", __LINE__, __FILE__); - break; - } - - $sql = "SELECT * FROM $table"; - if( $cat != 0) - { - $sql .= " WHERE $catfield = $cat"; - } - $sql .= " ORDER BY $orderfield ASC"; - - - if( !$result = $db->sql_query($sql) ) - { - message_die(GENERAL_ERROR, "Couldn't get list of Categories", "", __LINE__, __FILE__, $sql); - } - - $i = 10; - $inc = 10; - - while( $row = $db->sql_fetchrow($result) ) - { - $sql = "UPDATE $table - SET $orderfield = $i - WHERE $idfield = " . $row[$idfield]; - if( !$db->sql_query($sql) ) - { - message_die(GENERAL_ERROR, "Couldn't update order fields", "", __LINE__, __FILE__, $sql); - } - $i += 10; - } - + $mode = ''; } -// -// End function block -// ------------------ // // Begin program proper // -if( isset($HTTP_POST_VARS['addforum']) || isset($HTTP_POST_VARS['addcategory']) ) +if ( isset($HTTP_POST_VARS['addforum']) || isset($HTTP_POST_VARS['addcategory']) ) { $mode = ( isset($HTTP_POST_VARS['addforum']) ) ? "addforum" : "addcat"; @@ -240,7 +77,7 @@ if( isset($HTTP_POST_VARS['addforum']) || isset($HTTP_POST_VARS['addcategory']) } } -if( !empty($mode) ) +if ( !empty($mode) ) { switch($mode) { @@ -831,6 +668,41 @@ if( !empty($mode) ) } } +page_header($lang['Manage']); + + +?> + +<h1>Manage</h1> + +<p>Here you can add, edit, delete, lock, unlock individual forums as well as set certain additional controls. If your posts and topics have got out of sync you can also resynchronise a forum. In phpBB 2.2 there are no categories, everything is forum based. Each forum can have an unlimited number of sub-forums and you can determine whether each may be posted to or not (i.e. whether it acts like an old category).</p> + +<form method="post" action=""><table class="bg" width="95%" cellspacing="1" cellpadding="4" border="0" align="center"> + <tr> + <th colspan="2">Forum Name</th> + <th> </th> + <th> </th> + <th> </th> + </tr> + <tr> + <td class="row1" width="20"><img src="images/forum.gif" /></td> + <td class="row2" width="100%"> </td> + <td class="row1"> </td> + <td class="row2"> </td> + <td class="row1" width="20"><img src="images/delete.gif" width="19" height="18" alt="" title="" /></td> + </tr> + <tr> + <td class="row2" width="20"><img src="images/forum_locked.gif" /></td> + <td class="row1"></td> + <td class="row2"> </td> + <td class="row1"> </td> + <td class="row2" width="20" align="center"><img src="images/delete.gif" width="19" height="18" alt="" title="" /></td> + </tr> +</table></form> + +<?php + + // // Start page proper // @@ -839,7 +711,7 @@ $template->set_filenames(array( ); $template->assign_vars(array( - 'S_FORUM_ACTION' => append_sid("admin_forums.$phpEx"), + 'S_FORUM_ACTION' => "admin_forums.$phpEx$SID", 'L_FORUM_TITLE' => $lang['Forum_admin'], 'L_FORUM_EXPLAIN' => $lang['Forum_admin_explain'], 'L_CREATE_FORUM' => $lang['Create_forum'], @@ -854,22 +726,15 @@ $template->assign_vars(array( $sql = "SELECT cat_id, cat_title, cat_order FROM " . CATEGORIES_TABLE . " ORDER BY cat_order"; -if( !$q_categories = $db->sql_query($sql) ) -{ - message_die(GENERAL_ERROR, "Could not query categories list", "", __LINE__, __FILE__, $sql); -} +$q_categories = $db->sql_query($sql); -if( $total_categories = $db->sql_numrows($q_categories) ) +if ( $category_rows = $db->sql_fetchrowset($q_categories) ) { - $category_rows = $db->sql_fetchrowset($q_categories); $sql = "SELECT * FROM " . FORUMS_TABLE . " ORDER BY cat_id, forum_order"; - if(!$q_forums = $db->sql_query($sql)) - { - message_die(GENERAL_ERROR, "Could not query forums information", "", __LINE__, __FILE__, $sql); - } + $q_forums = $db->sql_query($sql); if( $total_forums = $db->sql_numrows($q_forums) ) { @@ -892,18 +757,18 @@ if( $total_categories = $db->sql_numrows($q_categories) ) 'CAT_ID' => $cat_id, 'CAT_DESC' => $category_rows[$i]['cat_title'], - 'U_CAT_EDIT' => append_sid("admin_forums.$phpEx?mode=editcat&" . POST_CAT_URL . "=$cat_id"), - 'U_CAT_DELETE' => append_sid("admin_forums.$phpEx?mode=deletecat&" . POST_CAT_URL . "=$cat_id"), - 'U_CAT_MOVE_UP' => append_sid("admin_forums.$phpEx?mode=cat_order&move=-15&" . POST_CAT_URL . "=$cat_id"), - 'U_CAT_MOVE_DOWN' => append_sid("admin_forums.$phpEx?mode=cat_order&move=15&" . POST_CAT_URL . "=$cat_id"), - 'U_VIEWCAT' => append_sid($phpbb_root_path."index.$phpEx?" . POST_CAT_URL . "=$cat_id")) + 'U_CAT_EDIT' => "admin_forums.$phpEx$SID&mode=editcat&c=$cat_id", + 'U_CAT_DELETE' => "admin_forums.$phpEx$SID&mode=deletecat&c=$cat_id", + 'U_CAT_MOVE_UP' => "admin_forums.$phpEx$SID&mode=cat_order&move=-15&c=$cat_id", + 'U_CAT_MOVE_DOWN' => "admin_forums.$phpEx$SID&mode=cat_order&move=15&c=$cat_id", + 'U_VIEWCAT' => $phpbb_root_path."index.$phpEx$SID&c=$cat_id") ); for($j = 0; $j < $total_forums; $j++) { $forum_id = $forum_rows[$j]['forum_id']; - if ($forum_rows[$j]['cat_id'] == $cat_id) + if ( $forum_rows[$j]['cat_id'] == $cat_id ) { $template->assign_block_vars("catrow.forumrow", array( @@ -913,12 +778,12 @@ if( $total_categories = $db->sql_numrows($q_categories) ) 'NUM_TOPICS' => $forum_rows[$j]['forum_topics'], 'NUM_POSTS' => $forum_rows[$j]['forum_posts'], - 'U_VIEWFORUM' => append_sid($phpbb_root_path."viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id"), - 'U_FORUM_EDIT' => append_sid("admin_forums.$phpEx?mode=editforum&" . POST_FORUM_URL . "=$forum_id"), - 'U_FORUM_DELETE' => append_sid("admin_forums.$phpEx?mode=deleteforum&" . POST_FORUM_URL . "=$forum_id"), - 'U_FORUM_MOVE_UP' => append_sid("admin_forums.$phpEx?mode=forum_order&move=-15&" . POST_FORUM_URL . "=$forum_id"), - 'U_FORUM_MOVE_DOWN' => append_sid("admin_forums.$phpEx?mode=forum_order&move=15&" . POST_FORUM_URL . "=$forum_id"), - 'U_FORUM_RESYNC' => append_sid("admin_forums.$phpEx?mode=forum_sync&" . POST_FORUM_URL . "=$forum_id")) + 'U_VIEWFORUM' => $phpbb_root_path."viewforum.$phpEx$SID&f=$forum_id", + 'U_FORUM_EDIT' => "admin_forums.$$SID&mode=editforum&f=$forum_id", + 'U_FORUM_DELETE' => "admin_forums.$phpEx$SID&mode=deleteforum&f=$forum_id", + 'U_FORUM_MOVE_UP' => "admin_forums.$phpEx$SID&mode=forum_order&move=-15&f=$forum_id", + 'U_FORUM_MOVE_DOWN' => "admin_forums.$phpEx$SID&mode=forum_order&move=15&f=$forum_id", + 'U_FORUM_RESYNC' => "admin_forums.$phpEx$SID&mode=forum_sync&f=$forum_id") ); }// if ... forumid == catid @@ -929,8 +794,171 @@ if( $total_categories = $db->sql_numrows($q_categories) ) }// if ... total_categories -$template->pparse("body"); +page_footer(); + +// +// END +// -include('page_footer_admin.'.$phpEx); +// ------------------ +// Begin function block +// +function get_info($mode, $id) +{ + global $db; -?> + switch($mode) + { + case 'category': + $table = CATEGORIES_TABLE; + $idfield = 'cat_id'; + $namefield = 'cat_title'; + break; + + case 'forum': + $table = FORUMS_TABLE; + $idfield = 'forum_id'; + $namefield = 'forum_name'; + break; + + default: + message_die(GENERAL_ERROR, "Wrong mode for generating select list", "", __LINE__, __FILE__); + break; + } + $sql = "SELECT count(*) as total + FROM $table"; + if( !$result = $db->sql_query($sql) ) + { + message_die(GENERAL_ERROR, "Couldn't get Forum/Category information", "", __LINE__, __FILE__, $sql); + } + $count = $db->sql_fetchrow($result); + $count = $count['total']; + + $sql = "SELECT * + FROM $table + WHERE $idfield = $id"; + + if( !$result = $db->sql_query($sql) ) + { + message_die(GENERAL_ERROR, "Couldn't get Forum/Category information", "", __LINE__, __FILE__, $sql); + } + + if( $db->sql_numrows($result) != 1 ) + { + message_die(GENERAL_ERROR, "Forum/Category doesn't exist or multiple forums/categories with ID $id", "", __LINE__, __FILE__); + } + + $return = $db->sql_fetchrow($result); + $return['number'] = $count; + return $return; +} + +function get_list($mode, $id, $select) +{ + global $db; + + switch($mode) + { + case 'category': + $table = CATEGORIES_TABLE; + $idfield = 'cat_id'; + $namefield = 'cat_title'; + break; + + case 'forum': + $table = FORUMS_TABLE; + $idfield = 'forum_id'; + $namefield = 'forum_name'; + break; + + default: + message_die(GENERAL_ERROR, "Wrong mode for generating select list", "", __LINE__, __FILE__); + break; + } + + $sql = "SELECT * + FROM $table"; + if( $select == 0 ) + { + $sql .= " WHERE $idfield <> $id"; + } + + if( !$result = $db->sql_query($sql) ) + { + message_die(GENERAL_ERROR, "Couldn't get list of Categories/Forums", "", __LINE__, __FILE__, $sql); + } + + $cat_list = ""; + + while( $row = $db->sql_fetchrow($result) ) + { + $s = ""; + if ($row[$idfield] == $id) + { + $s = " selected=\"selected\""; + } + $catlist .= "<option value=\"$row[$idfield]\"$s>" . $row[$namefield] . "</option>\n"; + } + + return($catlist); +} + +function renumber_order($mode, $cat = 0) +{ + global $db; + + switch($mode) + { + case 'category': + $table = CATEGORIES_TABLE; + $idfield = 'cat_id'; + $orderfield = 'cat_order'; + $cat = 0; + break; + + case 'forum': + $table = FORUMS_TABLE; + $idfield = 'forum_id'; + $orderfield = 'forum_order'; + $catfield = 'cat_id'; + break; + + default: + message_die(GENERAL_ERROR, "Wrong mode for generating select list", "", __LINE__, __FILE__); + break; + } + + $sql = "SELECT * FROM $table"; + if( $cat != 0) + { + $sql .= " WHERE $catfield = $cat"; + } + $sql .= " ORDER BY $orderfield ASC"; + + + if( !$result = $db->sql_query($sql) ) + { + message_die(GENERAL_ERROR, "Couldn't get list of Categories", "", __LINE__, __FILE__, $sql); + } + + $i = 10; + $inc = 10; + + while( $row = $db->sql_fetchrow($result) ) + { + $sql = "UPDATE $table + SET $orderfield = $i + WHERE $idfield = " . $row[$idfield]; + if( !$db->sql_query($sql) ) + { + message_die(GENERAL_ERROR, "Couldn't update order fields", "", __LINE__, __FILE__, $sql); + } + $i += 10; + } + +} +// +// End function block +// ------------------ + +?>
\ No newline at end of file diff --git a/phpBB/admin/admin_permissions.php b/phpBB/admin/admin_permissions.php index 96b5ab711f..9230f63828 100644 --- a/phpBB/admin/admin_permissions.php +++ b/phpBB/admin/admin_permissions.php @@ -29,6 +29,7 @@ if ( !empty($setmodules) ) $filename = basename(__FILE__); $module['Forums']['Permissions'] = $filename . $SID . '&mode=forums'; $module['Forums']['Moderators'] = $filename . $SID . '&mode=moderators'; + $module['Forums']['Super_Moderators'] = $filename . $SID . '&mode=supermoderators'; $module['General']['Administrators'] = $filename . $SID . '&mode=administrators'; return; @@ -60,7 +61,7 @@ if ( isset($HTTP_GET_VARS['f']) || isset($HTTP_POST_VARS['f']) ) } else { - unset($forum_id); + $forum_id = 0; $forum_sql = ''; } @@ -81,6 +82,11 @@ switch ( $mode ) $l_title_explain = $lang['Moderators_explain']; $l_can = '_can'; break; + case 'supermoderators': + $l_title = $lang['Super_Moderators']; + $l_title_explain = $lang['Super_Moderators_explain']; + $l_can = '_can'; + break; case 'administrators': $l_title = $lang['Administrators']; $l_title_explain = $lang['Administrators_explain']; @@ -93,12 +99,15 @@ if ( isset($HTTP_POST_VARS['update']) ) switch ( $HTTP_POST_VARS['type'] ) { case 'group': - $acl->set_acl(15, false, 7530, $HTTP_POST_VARS['option']); + foreach ( $HTTP_POST_VARS['entries'] as $group_id ) + { + $acl->set_acl($forum_id, false, $group_id, $HTTP_POST_VARS['option']); + } break; case 'user': foreach ( $HTTP_POST_VARS['entries'] as $user_id ) { - $acl->set_acl(intval($HTTP_POST_VARS['f']), $user_id, false, $HTTP_POST_VARS['option']); + $acl->set_acl($forum_id, $user_id, false, $HTTP_POST_VARS['option']); } break; } @@ -109,7 +118,7 @@ if ( isset($HTTP_POST_VARS['update']) ) // no id was specified or just the requsted if it // was // -if ( !empty($forum_id) || $mode == 'administrators' ) +if ( !empty($forum_id) || $mode == 'administrators' || $mode == 'supermoderators' ) { // // Clear some vars, grab some info if relevant ... @@ -139,29 +148,30 @@ if ( !empty($forum_id) || $mode == 'administrators' ) <p><?php echo $l_title_explain; ?></p> +<p><?php echo $lang['Permissions_extra_explain']; ?></p> + <?php switch ( $mode ) { case 'forums': - $type_sql = 'forum'; $forum_sql = "AND a.forum_id = $forum_id"; - break; case 'moderators': - $type_sql = 'mod'; $forum_sql = "AND a.forum_id = $forum_id"; + break; + case 'supermoderators': + $type_sql = 'mod'; + $forum_sql = "AND a.forum_id = $forum_id"; break; case 'administrators': - $type_sql = 'admin'; $forum_sql = ''; - break; } @@ -173,7 +183,7 @@ if ( !empty($forum_id) || $mode == 'administrators' ) $group_list = ''; while ( $row = $db->sql_fetchrow($result) ) { - $group_list .= '<option value="' . $row['group_id'] . '">' . $row['group_name'] . '</option>'; + $group_list .= '<option value="' . $row['group_id'] . '">' . ( ( !empty($lang[$row['group_name']]) ) ? $lang[$row['group_name']] : $row['group_name'] ) . '</option>'; } $db->sql_freeresult($result); @@ -189,7 +199,7 @@ if ( !empty($forum_id) || $mode == 'administrators' ) </tr> <tr> - <td><form method="post" name="adminusers" action="<?php echo "admin_permissions.$phpEx$SID&mode=$mode"; ?>"><table width="90%" class="bg" cellspacing="1" cellpadding="4" border="0" align="center"> + <td><form method="post" action="<?php echo "admin_permissions.$phpEx$SID&mode=$mode"; ?>"><table width="90%" class="bg" cellspacing="1" cellpadding="4" border="0" align="center"> <?php $sql = "SELECT DISTINCT u.user_id, u.username @@ -235,7 +245,7 @@ if ( !empty($forum_id) || $mode == 'administrators' ) $groups = ''; while ( $row = $db->sql_fetchrow($result) ) { - $groups .= '<option value="' . $row['group_id'] . '">' . ( ( $row['group_name'] == 'ADMINISTRATORS' ) ? $lang['Admin_group'] : $row['group_name'] ) . '</option>'; + $groups .= '<option value="' . $row['group_id'] . '">' . ( ( !empty($lang[$row['group_name']]) ) ? $lang[$row['group_name']] : $row['group_name'] ) . '</option>'; } $db->sql_freeresult($result); @@ -287,7 +297,7 @@ if ( !empty($forum_id) || $mode == 'administrators' ) else { - $sql = "SELECT auth_option + $sql = "SELECT auth_option_id, auth_option FROM " . ACL_OPTIONS_TABLE . " WHERE auth_type LIKE '$type_sql'"; $result = $db->sql_query($sql); @@ -332,10 +342,11 @@ if ( !empty($forum_id) || $mode == 'administrators' ) $auth = array(); while ( $row = $db->sql_fetchrow($result) ) { - $ug_test = ( $row['name'] == 'ADMINISTRATORS' ) ? $lang['Admin_group'] : $row['name']; + $ug_test = ( !empty($lang[$row['name']]) ) ? $lang[$row['name']] : $row['name']; $ug .= ( !strstr($ug, $ug_test) ) ? $ug_test . "\n" : ''; + $ug_test = '<input type="hidden" name="entries[]" value="' . $row['id'] . '" />'; - $ug_hidden = ( !strstr($ug_hidden, $ug_test) ) ? $ug_test : ''; + $ug_hidden .= ( !strstr($ug_hidden, $ug_test) ) ? $ug_test : ''; $auth[$row['auth_option']] = ( isset($auth_group[$row['auth_option']]) ) ? min($auth_group[$row['auth_option']], $row['auth_allow_deny']) : $row['auth_allow_deny']; } @@ -363,8 +374,8 @@ if ( !empty($forum_id) || $mode == 'administrators' ) ?> <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 $type_sql; ?>][<?php echo $auth_options[$i]['auth_option']; ?>]" value="1"<?php echo $can_type; ?> /></td> - <td class="<?php echo $row_class; ?>" align="center"><input type="radio" name="option[<?php echo $type_sql; ?>][<?php echo $auth_options[$i]['auth_option']; ?>]" value="0"<?php echo $cannot_type; ?> /></td> + <td class="<?php echo $row_class; ?>" align="center"><input type="radio" name="option[<?php echo $type_sql; ?>][<?php echo $auth_options[$i]['auth_option_id']; ?>]" value="1"<?php echo $can_type; ?> /></td> + <td class="<?php echo $row_class; ?>" align="center"><input type="radio" name="option[<?php echo $type_sql; ?>][<?php echo $auth_options[$i]['auth_option_id']; ?>]" value="0"<?php echo $cannot_type; ?> /></td> </tr> <?php @@ -409,6 +420,8 @@ else <p><?php echo $l_title_explain ?></p> +<p><?php echo $lang['Permissions_extra_explain']; ?></p> + <form method="post" action="<?php echo "admin_permissions.$phpEx$SID&mode=$mode"; ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center"> <tr> <th align="center"><?php echo $lang['Select_a_Forum']; ?></th> diff --git a/phpBB/admin/admin_prune.php b/phpBB/admin/admin_prune.php index 1660749a1f..f1b531cb7d 100644 --- a/phpBB/admin/admin_prune.php +++ b/phpBB/admin/admin_prune.php @@ -122,7 +122,7 @@ if ( isset($HTTP_POST_VARS['doprune']) ) } else { - page_header($lang['Forums']); + page_header($lang['Prune']); // // If they haven't selected a forum for pruning yet then @@ -145,7 +145,7 @@ else <p><?php echo $lang['Forum_Prune_explain']; ?></p> -<form method="post" action="<?php echo "admin_prune.$phpEx$SID"; ?>"><table cellspacing="1" cellpadding="4" border="0" align="center" bgcolor="#98AAB1"> +<form method="post" action="<?php echo "admin_prune.$phpEx$SID"; ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center"> <tr> <th align="center"><?php echo $lang['Select_a_Forum']; ?></th> </tr> @@ -174,7 +174,7 @@ else <h2><?php echo $lang['Forum'] . ': ' . $forum_name; ?></h2> -<form method="post" action="<?php echo "admin_prune.$phpEx$SID"; ?>"><table cellspacing="1" cellpadding="4" border="0" align="center" bgcolor="#98AAB1"> +<form method="post" action="<?php echo "admin_prune.$phpEx$SID"; ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center"> <tr> <th class="th"><?php echo $lang['Forum_Prune']; ?></th> </tr> @@ -191,10 +191,6 @@ else } } -// -// Actually output the page here. -// - page_footer(); ?>
\ No newline at end of file diff --git a/phpBB/admin/admin_prune_users.php b/phpBB/admin/admin_prune_users.php index 211288083b..1169c4415d 100644 --- a/phpBB/admin/admin_prune_users.php +++ b/phpBB/admin/admin_prune_users.php @@ -69,7 +69,7 @@ if ( isset($HTTP_POST_VARS['prune']) ) { $values = array('prune', 'deactivate', 'delete', 'users', 'username', 'email', 'joined_select', 'active_select', 'count_select', 'joined', 'active', 'count', 'deleteposts'); - $l_message = '<form method="post" action="admin_prune_users.' . $phpEx . $SID . '">' . $lang['Confirm_prune_users'] . '<br /><br /><input class="liteoption" type="submit" name="yes" value="' . $lang['Yes'] . '" /> <input class="liteoption" type="submit" name="no" value="' . $lang['No'] . '" /><input type="hidden" name="confirm" value="1" />'; + $l_message = '<form method="post" action="admin_prune_users.' . $phpEx . $SID . '">' . $lang['Confirm_prune_users'] . '<br /><br /><input class="liteoption" type="submit" name="confirm" value="' . $lang['Yes'] . '" /> <input class="liteoption" type="submit" name="cancel" value="' . $lang['No'] . '" />'; foreach ( $values as $field ) { @@ -92,7 +92,7 @@ if ( isset($HTTP_POST_VARS['prune']) ) page_footer(); } - else if ( isset($HTTP_POST_VARS['yes']) ) + else if ( isset($HTTP_POST_VARS['confirm']) ) { if ( !empty($HTTP_POST_VARS['users']) ) { @@ -192,7 +192,7 @@ if ( isset($HTTP_POST_VARS['prune']) ) unset($user_ids); unset($usernames); - } + } message_die(MESSAGE, $lang['Success_user_prune']); } diff --git a/phpBB/admin/admin_search.php b/phpBB/admin/admin_search.php index 998955d401..9adfa2cae4 100644 --- a/phpBB/admin/admin_search.php +++ b/phpBB/admin/admin_search.php @@ -295,7 +295,7 @@ if ( isset($HTTP_POST_VARS['start']) || isset($HTTP_GET_VARS['batchstart']) ) WHERE config_name = 'board_disable'"; $db->sql_query($sql); - page_header($lang['DB']); + page_header($lang['Search_indexing']); ?> @@ -319,7 +319,7 @@ else if ( isset($HTTP_POST_VARS['cancel']) ) WHERE config_name = 'board_disable'"; $db->sql_query($sql); - page_header($lang['DB']); + page_header($lang['Search_indexing']); ?> @@ -334,7 +334,7 @@ else if ( isset($HTTP_POST_VARS['cancel']) ) } else { - page_header($lang['DB']); + page_header($lang['Search_indexing']); ?> diff --git a/phpBB/admin/admin_smilies.php b/phpBB/admin/admin_smilies.php index 7f212425a3..c930c3edc8 100644 --- a/phpBB/admin/admin_smilies.php +++ b/phpBB/admin/admin_smilies.php @@ -19,9 +19,6 @@ * ***************************************************************************/ -// -// First we do the setmodules stuff for the admin cp. -// if ( !empty($setmodules) ) { if ( !$acl->get_acl_admin('general') ) @@ -30,25 +27,27 @@ if ( !empty($setmodules) ) } $filename = basename(__FILE__); - $module['General']['Emoticons'] = $filename . $SID . "&mode=emoticons"; + $module['General']['Emoticons'] = $filename . $SID . '&mode=emoticons'; return; } define('IN_PHPBB', 1); +// +// Include files +// $phpbb_root_path = '../'; require($phpbb_root_path . 'extension.inc'); require('pagestart.' . $phpEx); // -// +// Do we have general permissions? // if ( !$acl->get_acl_admin('general') ) { message_die(MESSAGE, $lang['No_admin']); } - // // Check to see what mode we should operate in. // @@ -70,11 +69,11 @@ $dir = @opendir($phpbb_root_path . $board_config['smilies_path']); while( $file = @readdir($dir) ) { - if ( !is_dir($phpbb_root_path . $board_config['smilies_path'] . '/' . $file) ) + if ( is_file($phpbb_root_path . $board_config['smilies_path'] . '/' . $file) ) { $img_size = @getimagesize($phpbb_root_path . $board_config['smilies_path'] . '/' . $file); - if( $img_size[0] && $img_size[1] ) + if ( $img_size[0] && $img_size[1] ) { $smiley_images[] = $file; } @@ -97,14 +96,14 @@ if ( isset($HTTP_GET_VARS['import_pack']) || isset($HTTP_POST_VARS['import_pack' // $smile_pak = ( isset($HTTP_POST_VARS['smile_pak']) ) ? $HTTP_POST_VARS['smile_pak'] : $HTTP_GET_VARS['smile_pak']; $clear_current = ( isset($HTTP_POST_VARS['clear_current']) ) ? $HTTP_POST_VARS['clear_current'] : $HTTP_GET_VARS['clear_current']; - $replace_existing = ( isset($HTTP_POST_VARS['replace']) ) ? $HTTP_POST_VARS['replace'] : $HTTP_GET_VARS['replace']; + $replace_existing = ( isset($HTTP_POST_VARS['replace']) ) ? intval($HTTP_POST_VARS['replace']) : intval($HTTP_GET_VARS['replace']); if ( !empty($smile_pak) ) { // // The user has already selected a smile_pak file.. Import it. // - if( !empty($clear_current) ) + if ( !empty($clear_current) ) { $sql = "DELETE FROM " . SMILIES_TABLE; @@ -141,13 +140,12 @@ if ( isset($HTTP_GET_VARS['import_pack']) || isset($HTTP_POST_VARS['import_pack' // // Replace > and < with the proper html_entities for matching. // - $smile_data[$j] = str_replace("<", "<", $smile_data[$j]); - $smile_data[$j] = str_replace(">", ">", $smile_data[$j]); + $smile_data[$j] = htmlentities($smile_data[$j]); $k = $smile_data[$j]; - if( $smiles[$k] == 1 ) + if ( $smiles[$k] == 1 ) { - if( !empty($replace_existing) ) + if ( !empty($replace_existing) ) { $sql = "UPDATE " . SMILIES_TABLE . " SET smile_url = '" . str_replace("\'", "''", $smile_data[0]) . "', emoticon = '" . str_replace("\'", "''", $smile_data[1]) . "' @@ -171,7 +169,7 @@ if ( isset($HTTP_GET_VARS['import_pack']) || isset($HTTP_POST_VARS['import_pack' } } - message_die(GENERAL_MESSAGE, $lang['smiley_import_success']); + message_die(MESSAGE, $lang['smiley_import_success']); } else @@ -180,7 +178,8 @@ if ( isset($HTTP_GET_VARS['import_pack']) || isset($HTTP_POST_VARS['import_pack' // Display the script to get the smile_pak cfg file... // $smile_paks_select = "<select name='smile_pak'><option value=''>" . $lang['Select_pak'] . "</option>"; - while( list($key, $value) = @each($smiley_paks) ) + + foreach ( $smiley_paks as $key => $value ) { if ( !empty($value) ) { @@ -214,7 +213,7 @@ if ( isset($HTTP_GET_VARS['import_pack']) || isset($HTTP_POST_VARS['import_pack' $template->pparse("body"); } } -else if( isset($HTTP_POST_VARS['export_pack']) || isset($HTTP_GET_VARS['export_pack']) ) +else if ( isset($HTTP_POST_VARS['export_pack']) || isset($HTTP_GET_VARS['export_pack']) ) { // // Export our smiley config as a smiley pak... @@ -243,7 +242,7 @@ else if( isset($HTTP_POST_VARS['export_pack']) || isset($HTTP_GET_VARS['export_p exit; } - message_die(GENERAL_MESSAGE, sprintf($lang['export_smiles'], '<a href="' . "admin_smilies.$phpEx$SID&export_pack=send" . '">', '</a>')); + message_die(MESSAGE, sprintf($lang['export_smiles'], '<a href="' . "admin_smilies.$phpEx$SID&export_pack=send" . '">', '</a>')); } else if( isset($HTTP_POST_VARS['add']) ) @@ -315,6 +314,7 @@ switch( $mode ) $filename_list = ""; for( $i = 0; $i < count($smiley_images); $i++ ) { +// $selected = if( $smiley_images[$i] == $smile_data['smile_url'] ) { $smiley_selected = "selected=\"selected\""; @@ -379,7 +379,7 @@ switch( $mode ) WHERE smilies_id = $smile_id"; $db->sql_query($sql); - message_die(GENERAL_MESSAGE, $lang['smiley_edit_success']); + message_die(MESSAGE, $lang['smiley_edit_success']); break; case 'savenew': @@ -401,7 +401,7 @@ switch( $mode ) VALUES ('" . str_replace("\'", "''", $smile_code) . "', '" . str_replace("\'", "''", $smile_url) . "', '" . str_replace("\'", "''", $smile_emotion) . "')"; $db->sql_query($sql); - message_die(GENERAL_MESSAGE, $lang['smiley_add_success']); + message_die(MESSAGE, $lang['smiley_add_success']); break; default: @@ -436,7 +436,7 @@ switch( $mode ) ?> <tr> <td class="<?php echo $row_class; ?>" align="center"><?php echo htmlspecialchars($row['code']); ?></td> - <td class="<?php echo $row_class; ?>" align="center"><img src="<?php echo './../' . $board_config['smilies_path'] . '/' . $row['smile_url']; ?>" alt="<?php echo htmlspecialchars($row['code']); ?>" /></td> + <td class="<?php echo $row_class; ?>" align="center"><img src="<?php echo './../' . $board_config['smilies_path'] . '/' . $row['smile_url']; ?>" width="<?php echo $row['smile_width']; ?>" height="<?php echo $row['smile_height']; ?>" alt="<?php echo htmlspecialchars($row['code']); ?>" /></td> <td class="<?php echo $row_class; ?>" align="center"><?php echo $row['emoticon']; ?></td> <td class="<?php echo $row_class; ?>" align="center"><a href="<?php echo "admin_smilies.$phpEx$SID&mode=edit&id=" . $row['smilies_id']; ?>"><?php echo $lang['Edit']; ?></a></td> <td class="<?php echo $row_class; ?>" align="center"><a href="<?php echo "admin_smilies.$phpEx$SID&mode=delete&id=" . $row['smilies_id']; ?>"><?php echo $lang['Delete']; ?></a></td> diff --git a/phpBB/admin/admin_styles.php b/phpBB/admin/admin_styles.php index d46f61fedd..afe37454c4 100644 --- a/phpBB/admin/admin_styles.php +++ b/phpBB/admin/admin_styles.php @@ -197,7 +197,7 @@ switch ( $mode ) { $tpl = substr($file, 0, strpos($file, '.')); $selected = ( $tplname == $tpl ) ? ' selected="selected"' : ''; - $tplname_options .= '<option name="' . $tpl . '"' . $selected . '>' . $tpl . '</option>'; + $tplname_options .= '<option value="' . $tpl . '"' . $selected . '>' . $tpl . '</option>'; } } closedir($dp); @@ -217,7 +217,7 @@ switch ( $mode ) <p><?php echo $lang['Select_template']; ?>: <select name="tplroot"><?php echo $tplroot_options; ?></select> <input class="liteoption" type="submit" name="tpl_root" value="Select" /></p> -<table class="bg" cellspacing="1" cellpadding="0" border="0" align="center"><!-- bgcolor="#98AAB1" --> +<table class="bg" width="95%" cellspacing="1" cellpadding="0" border="0" align="center"> <tr> <td class="cat"><table width="100%" cellspacing="0" cellpadding="0" border="0"> <tr> @@ -242,7 +242,7 @@ switch ( $mode ) case 'edittheme': - $theme_id = ( isset($HTTP_POST_VARS['theme_id']) ) ? $HTTP_POST_VARS['theme_id'] : ''; + $theme_id = ( isset($HTTP_POST_VARS['themeroot']) ) ? $HTTP_POST_VARS['themeroot'] : ''; if ( isset($HTTP_POST_VARS['update']) ) { @@ -256,9 +256,9 @@ switch ( $mode ) $theme_name = $row['theme_name']; $css_data = ( !empty($HTTP_POST_VARS['css_data']) ) ? htmlentities($HTTP_POST_VARS['css_data']) : ''; - $css_external = ( !empty($HTTP_POST_VARS['css_external']) ) ? $HTTP_POST_VARS['css_external'] : ''; + $css_external = ( !empty($HTTP_POST_VARS['css_data']) ) ? $HTTP_POST_VARS['css_data'] : ''; - $sql = "UPDATE " . STYLES_CSS_TABLE . " + $sql = "UPDATE " > STYLES_CSS_TABLE . " SET css_data = '$css_data', css_external = '$css_external' WHERE theme_id = $theme_id"; $db->sql_query($sql); @@ -285,24 +285,9 @@ switch ( $mode ) while ( $row = $db->sql_fetchrow($result) ); } $db->sql_freeresult($result); - -?> - -<form method="post" action="<?php echo "admin_styles.$phpEx$SID&mode=$mode"; ?>"> - -<h2><?php echo $lang['Edit_theme']; ?></h2> - -<p><?php echo $lang['Edit_theme_explain']; ?></p> - -<table class="bg" width="95%" cellspacing="1" cellpadding="4" border="0" align="center"> - <tr> - <th colspan="2"><?php echo $lang['Edit_theme']; ?></th> - </tr> - <tr> - <td class="cat" colspan="2" align="center"><?php echo $lang['Select_theme']; ?>: <select name="theme_id"><?php echo $theme_options; ?></select> <input class="liteoption" type="submit" name="tpl_root" value="<?php echo $lang['Select']; ?>" /></td> - </tr> -<?php + $css_data = ''; + $css_external = ''; if ( $theme_id ) { $sql = "SELECT css_data, css_external @@ -314,8 +299,21 @@ switch ( $mode ) { $css_data = preg_replace('/\t{1,}/i', ' ', $row['css_data']); $css_external = $row['css_external']; + } + } ?> + +<form method="post" action="<?php echo "admin_styles.$phpEx$SID&mode=$mode"; ?>"> + +<h2><?php echo $lang['Edit_theme']; ?></h2> + +<p><?php echo $lang['Edit_theme_explain']; ?></p> + +<table class="bg" width="95%" cellspacing="1" cellpadding="4" border="0" align="center"> + <tr> + <td class="cat" colspan="2" align="center"><?php echo $lang['Select_theme']; ?>: <select name="themeroot"><?php echo $theme_options; ?></select> <input class="liteoption" type="submit" name="tpl_root" value="<?php echo $lang['Select']; ?>" /></td> + </tr> <tr> <td class="row1"><?php echo $lang['CSS_data']; ?>: <br /><span class="gensmall"><?php echo $lang['CSS_data_explain']; ?></td> <td class="row2"><textarea class="edit" cols="65" rows="15" name="css_data"><?php echo htmlentities($css_data); ?></textarea></td> @@ -331,14 +329,6 @@ switch ( $mode ) <?php - } - } - -?> - -</form> -<?php - page_footer(); break; @@ -361,7 +351,7 @@ function get_templates($tplroot = '') while ( $row = $db->sql_fetchrow($result) ) { $selected = ( $tplroot == $row['template_path'] ) ? ' selected="selected"' : ''; - $tplroot_options .= '<option name="' . $row['template_path'] . '"' . $selected . '>' . $row['template_path'] . '</option>'; + $tplroot_options .= '<option value="' . $row['template_path'] . '"' . $selected . '>' . $row['template_path'] . '</option>'; } return $tplroot_options; diff --git a/phpBB/admin/admin_users.php b/phpBB/admin/admin_users.php index 1562c65476..378636dbd9 100644 --- a/phpBB/admin/admin_users.php +++ b/phpBB/admin/admin_users.php @@ -1012,42 +1012,28 @@ if ( $mode == 'edit' || $mode == 'save' && ( isset($HTTP_POST_VARS['username']) } else { - // - // Default user selection box - // - $sql = "SELECT user_id, username - FROM " . USERS_TABLE . " - WHERE user_id <> " . ANONYMOUS ." - ORDER BY username"; - $result = $db->sql_query($sql); - - $select_list = '<select name="u">'; - while( $row = $db->sql_fetchrow($result) ) - { - $select_list .= '<option value="' . $row['user_id'] . '">' . $row['username'] . '</option>'; - } - $select_list .= '</select>'; - $template->set_filenames(array( - 'body' => 'admin/user_select_body.tpl') - ); + page_header($lang['Manage']); - $template->assign_vars(array( - 'L_USER_TITLE' => $lang['User_admin'], - 'L_USER_EXPLAIN' => $lang['User_admin_explain'], - 'L_USER_SELECT' => $lang['Select_a_User'], - 'L_LOOK_UP' => $lang['Look_up_user'], - 'L_FIND_USERNAME' => $lang['Find_username'], +?> - 'U_SEARCH_USER' => "../search.$phpEx$SID&mode=searchuser", +<h1><?php echo $lang['User_admin']; ?></h1> - 'S_USER_ACTION' => "admin_users.$phpEx$SID", - 'S_USER_SELECT' => $select_list) - ); - $template->display('body'); +<p><?php echo $lang['User_admin_explain']; ?></p> + +<form method="post" name="post" action="<?php echo "admin_users.$phpEx$SID"; ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center"> + <tr> + <th align="center"><?php echo $lang['Select_a_User']; ?></th> + </tr> + <tr> + <td class="row1" align="center"><input type="text" class="post" name="username" maxlength="50" size="20" /> <input type="hidden" name="mode" value="edit" /><input type="submit" name="submituser" value="<?php echo $lang['Look_up_user']; ?>" class="mainoption" /> <input type="submit" name="usersubmit" value="<?php echo $lang['Find_username']; ?>" class="liteoption" onClick="window.open('<?php echo "../search.$phpEx$SID&mode=searchuser&field=username"; ?>', '_phpbbsearch', 'HEIGHT=500,resizable=yes,scrollbars=yes,WIDTH=650');return false;" /></td> + </tr> +</table></form> + +<?php } -include('page_footer_admin.'.$phpEx); +page_footer(); ?>
\ No newline at end of file diff --git a/phpBB/admin/admin_viewlogs.php b/phpBB/admin/admin_viewlogs.php index c31e04fa47..e09a98030f 100644 --- a/phpBB/admin/admin_viewlogs.php +++ b/phpBB/admin/admin_viewlogs.php @@ -181,7 +181,7 @@ page_header($l_title); <p><?php echo $l_title_explain; ?></p> -<form method="post" name="log" action="<?php echo "admin_viewlogs.$phpEx$SID&mode=$mode"; ?>"> +<form method="post" action="<?php echo "admin_viewlogs.$phpEx$SID&mode=$mode"; ?>"> <?php if ( $mode == 'mod' ) @@ -190,7 +190,7 @@ if ( $mode == 'mod' ) ?> <table width="100%" cellpadding="1" cellspacing="1" border="0"> <tr> - <td align="right"><?php echo $lang['Select_forum']; ?>: <select name="f"><?php echo $forum_options; ?></select> <input class="liteoption" type="submit" value="<?php echo $lang['Go']; ?>" /></td> + <td align="right"><?php echo $lang['Select_forum']; ?>: <select name="f" onchange="this.form.submit()"><?php echo $forum_options; ?></select> <input class="liteoption" type="submit" value="<?php echo $lang['Go']; ?>" /></td> </tr> </table> <?php diff --git a/phpBB/admin/admin_words.php b/phpBB/admin/admin_words.php index b71885a464..384c83fd3c 100644 --- a/phpBB/admin/admin_words.php +++ b/phpBB/admin/admin_words.php @@ -79,7 +79,7 @@ if( $mode != '' ) { case 'edit': case 'add': - $word_id = ( isset($HTTP_GET_VARS['id']) ) ? $HTTP_GET_VARS['id'] : 0; + $word_id = ( isset($HTTP_GET_VARS['id']) ) ? intval($HTTP_GET_VARS['id']) : 0; $s_hidden_fields = ''; if ( $mode == 'edit' ) @@ -98,7 +98,7 @@ if( $mode != '' ) $s_hidden_fields .= '<input type="hidden" name="id" value="' . $word_id . '" />'; } - page_header($lang['General']); + page_header($lang['Words_title']); ?> @@ -106,7 +106,7 @@ if( $mode != '' ) <p><?php echo $lang['Words_explain']; ?></p> -<form method="post" action="<?php echo "admin_words.$phpEx$SID"; ?>"><table cellspacing="1" cellpadding="4" border="0" align="center" bgcolor="#98AAB1"> +<form method="post" action="<?php echo "admin_words.$phpEx$SID"; ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center"> <tr> <th colspan="2"><?php echo $lang['Edit_word_censor']; ?></th> </tr> @@ -128,7 +128,7 @@ if( $mode != '' ) break; case 'save': - $word_id = ( isset($HTTP_POST_VARS['id']) ) ? $HTTP_POST_VARS['id'] : 0; + $word_id = ( isset($HTTP_POST_VARS['id']) ) ? intval($HTTP_POST_VARS['id']) : 0; $word = ( isset($HTTP_POST_VARS['word']) ) ? trim($HTTP_POST_VARS['word']) : ''; $replacement = ( isset($HTTP_POST_VARS['replacement']) ) ? trim($HTTP_POST_VARS['replacement']) : ''; @@ -144,8 +144,6 @@ if( $mode != '' ) add_admin_log($log_action, stripslashes($word)); $message = ( $word_id ) ? $lang['Word_updated'] : $lang['Word_added']; - $message .= '<br /><br />' . sprintf($lang['Click_return_wordadmin'], '<a href="' . "admin_words.$phpEx$SID" . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . "index.$phpEx$SID&pane=right" . '">', '</a>'); - message_die(MESSAGE, $message); break; @@ -153,7 +151,7 @@ if( $mode != '' ) if ( isset($HTTP_POST_VARS['id']) || isset($HTTP_GET_VARS['id']) ) { - $word_id = ( isset($HTTP_POST_VARS['id']) ) ? $HTTP_POST_VARS['id'] : $HTTP_GET_VARS['id']; + $word_id = ( isset($HTTP_POST_VARS['id']) ) ? intval($HTTP_POST_VARS['id']) : intval($HTTP_GET_VARS['id']); } else { @@ -166,9 +164,7 @@ if( $mode != '' ) add_admin_log('log_delete_word'); - $message = $lang['Word_removed'] . '<br /><br />' . sprintf($lang['Click_return_wordadmin'], '<a href="' . "admin_words.$phpEx$SID" . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . "index.$phpEx$SID&pane=right" . '">', '</a>'); - - message_die(MESSAGE, $message); + message_die(MESSAGE, $lang['Word_removed']); break; } @@ -176,7 +172,7 @@ if( $mode != '' ) else { - page_header($lang['General']); + page_header($lang['Words_title']); ?> @@ -184,7 +180,7 @@ else <p><?php echo $lang['Words_explain']; ?></p> -<form method="post" action="<?php echo "admin_words.$phpEx$SID"; ?>"><table cellspacing="1" cellpadding="4" border="0" align="center" bgcolor="#98AAB1"> +<form method="post" action="<?php echo "admin_words.$phpEx$SID"; ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center"> <tr> <th><?php echo $lang['Word']; ?></th> <th><?php echo $lang['Replacement']; ?></th> @@ -202,14 +198,14 @@ else { do { - $cell_bg = ( $cell_bg == 'row1' ) ? 'row2' : 'row1'; + $row_class = ( $row_class == 'row1' ) ? 'row2' : 'row1'; ?> <tr> - <td class="<?php echo $cell_bg; ?>" align="center"><?php echo $row['word']; ?></td> - <td class="<?php echo $cell_bg; ?>" align="center"><?php echo $row['replacement']; ?></td> - <td class="<?php echo $cell_bg; ?>"> <a href="<?php echo "admin_words.$phpEx$SID&mode=edit&id=" . $row['word_id']; ?>"><?php echo $lang['Edit']; ?></a> </td> - <td class="<?php echo $cell_bg; ?>"> <a href="<?php echo "admin_words.$phpEx$SID&mode=delete&id=" . $row['word_id']; ?>"><?php echo $lang['Delete']; ?></a> </td> + <td class="<?php echo $row_class; ?>" align="center"><?php echo $row['word']; ?></td> + <td class="<?php echo $row_class; ?>" align="center"><?php echo $row['replacement']; ?></td> + <td class="<?php echo $row_class; ?>"> <a href="<?php echo "admin_words.$phpEx$SID&mode=edit&id=" . $row['word_id']; ?>"><?php echo $lang['Edit']; ?></a> </td> + <td class="<?php echo $row_class; ?>"> <a href="<?php echo "admin_words.$phpEx$SID&mode=delete&id=" . $row['word_id']; ?>"><?php echo $lang['Delete']; ?></a> </td> </tr> <?php |