aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2007-02-08 22:11:14 +0000
committerNils Adermann <naderman@naderman.de>2007-02-08 22:11:14 +0000
commit56a93bdfdddde618fe826c23c9151086f9540860 (patch)
tree5badf493ac976a48e8de22411610affa6019e6b3
parent766e311ff35b486a2f01b1cb2cf4fef3df290825 (diff)
downloadforums-56a93bdfdddde618fe826c23c9151086f9540860.tar
forums-56a93bdfdddde618fe826c23c9151086f9540860.tar.gz
forums-56a93bdfdddde618fe826c23c9151086f9540860.tar.bz2
forums-56a93bdfdddde618fe826c23c9151086f9540860.tar.xz
forums-56a93bdfdddde618fe826c23c9151086f9540860.zip
- Pruning doesn't lower user post counts anymore [Bug #7676]
- Better resync explanations in ACP - relative link to board shouldn't result in an empty link [Bug #7762] - allow spaces to define multiple classes [Bug #7700] - forgot addslashes for password conversion [Bug #7530] - adjusted get_post_data call in mcp_post to retrieve read tracking info [Bug #7538] - fixed sorting in reports/queue by properly generating the pagination links [Bug #7666] - send UTF-8 charset header in database_update.php [Bug #7564] git-svn-id: file:///svn/phpbb/trunk@6974 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r--phpBB/adm/style/acp_main.html48
-rw-r--r--phpBB/adm/style/admin.css1
-rw-r--r--phpBB/includes/acp/acp_main.php55
-rw-r--r--phpBB/includes/acp/acp_styles.php5
-rw-r--r--phpBB/includes/auth/auth_db.php4
-rw-r--r--phpBB/includes/functions.php2
-rw-r--r--phpBB/includes/functions_admin.php12
-rw-r--r--phpBB/includes/mcp/mcp_queue.php2
-rwxr-xr-xphpBB/includes/mcp/mcp_reports.php2
-rw-r--r--phpBB/install/database_update.php2
-rw-r--r--phpBB/language/en/acp/common.php44
11 files changed, 131 insertions, 46 deletions
diff --git a/phpBB/adm/style/acp_main.html b/phpBB/adm/style/acp_main.html
index 41d00a3b41..85a1c4a225 100644
--- a/phpBB/adm/style/acp_main.html
+++ b/phpBB/adm/style/acp_main.html
@@ -89,13 +89,49 @@
</table>
<!-- IF S_ACTION_OPTIONS -->
- <form id="stats" method="post" action="{U_ACTION}">
- <fieldset class="quick">
- <select name="action">{S_ACTION_OPTIONS}</select>
-
- <input class="button2" type="submit" name="submit" value="{L_SUBMIT}" />
+ <fieldset>
+ <legend>{L_STATISTIC_RESYNC_OPTIONS}</legend>
+
+ <form id="action_online_form" method="post" action="{U_ACTION}">
+ <dl>
+ <dt><label for="action_online">{L_RESET_ONLINE}</label></dt>
+ <dd><input class="button2" type="submit" id="action_online" name="action_online" value="{L_RUN}" /></dd>
+ </dl>
+ <input type="hidden" name="action" value="online"/>
+ </form>
+
+ <form id="action_date_form" method="post" action="{U_ACTION}">
+ <dl>
+ <dt><label for="action_date">{L_RESET_DATE}</label></dt>
+ <dd><input class="button2" type="submit" id="action_date" name="action_date" value="{L_RUN}" /></dd>
+ </dl>
+ <input type="hidden" name="action" value="date"/>
+ </form>
+
+ <form id="action_stats_form" method="post" action="{U_ACTION}">
+ <dl>
+ <dt><label for="action_stats">{L_RESYNC_STATS}</label><br /><span>{L_RESYNC_STATS_EXPLAIN}</span></dt>
+ <dd><input class="button2" type="submit" id="action_stats" name="action_stats" value="{L_RUN}" /></dd>
+ </dl>
+ <input type="hidden" name="action" value="stats"/>
+ </form>
+
+ <form id="action_user_form" method="post" action="{U_ACTION}">
+ <dl>
+ <dt><label for="action_user">{L_RESYNC_POSTCOUNTS}</label><br /><span>{L_RESYNC_POSTCOUNTS_EXPLAIN}</span></dt>
+ <dd><input class="button2" type="submit" id="action_user" name="action_user" value="{L_RUN}" /></dd>
+ </dl>
+ <input type="hidden" name="action" value="user"/>
+ </form>
+
+ <form id="action_db_track_form" method="post" action="{U_ACTION}">
+ <dl>
+ <dt><label for="action_db_track">{L_RESYNC_POST_MARKING}</label><br /><span>{L_RESYNC_POST_MARKING_EXPLAIN}</span></dt>
+ <dd><input class="button2" type="submit" id="action_db_track" name="action_db_track" value="{L_RUN}" /></dd>
+ </dl>
+ <input type="hidden" name="action" value="db_track"/>
+ </form>
</fieldset>
- </form>
<!-- ENDIF -->
<!-- IF .log -->
diff --git a/phpBB/adm/style/admin.css b/phpBB/adm/style/admin.css
index 3f655663a0..b081230ee2 100644
--- a/phpBB/adm/style/admin.css
+++ b/phpBB/adm/style/admin.css
@@ -637,6 +637,7 @@ dt label {
}
dd label {
+ font-size:100%;
white-space: nowrap;
margin: 0 10px 0 0;
}
diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php
index bf958ba319..14f6571177 100644
--- a/phpBB/includes/acp/acp_main.php
+++ b/phpBB/includes/acp/acp_main.php
@@ -51,6 +51,46 @@ class acp_main
$action = request_var('action', '');
+ if ($action && !confirm_box(true))
+ {
+ switch ($action)
+ {
+ case 'online':
+ $confirm = true;
+ $confirm_lang = 'RESET_ONLINE_CONFIRM';
+ break;
+ case 'stats':
+ $confirm = true;
+ $confirm_lang = 'RESYNC_STATS_CONFIRM';
+ break;
+ case 'user':
+ $confirm = true;
+ $confirm_lang = 'RESYNC_POSTCOUNTS_CONFIRM';
+ break;
+ case 'date':
+ $confirm = true;
+ $confirm_lang = 'RESET_DATE_CONFIRM';
+ break;
+ case 'db_track':
+ $confirm = true;
+ $confirm_lang = 'RESYNC_POST_MARKING_CONFIRM';
+ break;
+
+ default:
+ $confirm = true;
+ $confirm_lang = 'CONFIRM_OPERATION';
+ }
+
+ if ($confirm)
+ {
+ confirm_box(false, $user->lang[$confirm_lang], build_hidden_fields(array(
+ 'i' => $id,
+ 'mode' => $mode,
+ 'action' => $action,
+ )));
+ }
+ }
+
switch ($action)
{
case 'online':
@@ -74,29 +114,23 @@ class acp_main
FROM ' . POSTS_TABLE . '
WHERE post_approved = 1';
$result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
+ set_config('num_posts', (int) $db->sql_fetchfield('stat'), true);
$db->sql_freeresult($result);
- set_config('num_posts', (int) $row['stat'], true);
-
$sql = 'SELECT COUNT(topic_id) AS stat
FROM ' . TOPICS_TABLE . '
WHERE topic_approved = 1';
$result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
+ set_config('num_topics', (int) $db->sql_fetchfield('stat'), true);
$db->sql_freeresult($result);
- set_config('num_topics', (int) $row['stat'], true);
-
$sql = 'SELECT COUNT(user_id) AS stat
FROM ' . USERS_TABLE . '
WHERE user_type IN (' . USER_NORMAL . ',' . USER_FOUNDER . ')';
$result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
+ set_config('num_users', (int) $db->sql_fetchfield('stat'), true);
$db->sql_freeresult($result);
- set_config('num_users', (int) $row['stat'], true);
-
$sql = 'SELECT COUNT(attach_id) as stat
FROM ' . ATTACHMENTS_TABLE . '
WHERE is_orphan = 0';
@@ -296,7 +330,6 @@ class acp_main
}
$dbsize = get_database_size();
- $s_action_options = build_select(array('online' => 'RESET_ONLINE', 'date' => 'RESET_DATE', 'stats' => 'RESYNC_STATS', 'user' => 'RESYNC_POSTCOUNTS', 'db_track' => 'RESYNC_POST_MARKING'));
$template->assign_vars(array(
'TOTAL_POSTS' => $total_posts,
@@ -320,7 +353,7 @@ class acp_main
'U_ADMIN_LOG' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=logs&amp;mode=admin'),
'U_INACTIVE_USERS' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=inactive&amp;mode=list'),
- 'S_ACTION_OPTIONS' => ($auth->acl_get('a_board')) ? $s_action_options : '',
+ 'S_ACTION_OPTIONS' => ($auth->acl_get('a_board')) ? true : false,
)
);
diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php
index ec69944f5e..2a7b993cd9 100644
--- a/phpBB/includes/acp/acp_styles.php
+++ b/phpBB/includes/acp/acp_styles.php
@@ -939,6 +939,9 @@ parse_css_file = {PARSE_CSS_FILE}
$add_custom = isset($_POST['add_custom']) ? true : false;
$matches = array();
+ // no curly brackets inside a CSS block please
+ $css_data = str_replace(array('{', '}'), '', $css_data);
+
// Retrieve some information about the theme
$sql = 'SELECT theme_storedb, theme_path, theme_name, theme_data
FROM ' . STYLES_THEME_TABLE . "
@@ -1266,7 +1269,7 @@ parse_css_file = {PARSE_CSS_FILE}
else
{
// check whether the custom class name is valid
- if (!preg_match('/^[a-z0-9\.,:#_\->*]+$/i', $custom_class))
+ if (!preg_match('/^[a-z0-9\.,:#_\ \t->*]+$/i', $custom_class))
{
trigger_error($user->lang['THEME_ERR_CLASS_CHARS'] . adm_back_link($this->u_action . "&amp;action=edit&amp;id=$theme_id&amp;text_rows=$text_rows"), E_USER_WARNING);
}
diff --git a/phpBB/includes/auth/auth_db.php b/phpBB/includes/auth/auth_db.php
index 3be896cfd6..baf193ecdb 100644
--- a/phpBB/includes/auth/auth_db.php
+++ b/phpBB/includes/auth/auth_db.php
@@ -98,9 +98,9 @@ function login_db(&$username, &$password)
// If the password convert flag is set we need to convert it
if ($row['user_pass_convert'])
{
- // in phpBB2 passwords were used exactly as they were sent
+ // in phpBB2 passwords were used exactly as they were sent, with addslashes applied
$password_old_format = isset($_REQUEST['password']) ? (string) $_REQUEST['password'] : '';
- $password_old_format = (STRIP) ? stripslashes($password_old_format) : $password_old_format;
+ $password_old_format = (!STRIP) ? addslashes($password_old_format) : $password_old_format;
$password_new_format = '';
set_var($password_new_format, $password_old_format, 'string');
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 7e1a7ac679..8639df6ab0 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -2398,7 +2398,7 @@ function make_clickable($text, $server_url = false)
// relative urls for this board
$magic_url_match[] = '#(^|[\n\t (])(' . preg_quote($server_url, '#') . ')/(' . get_preg_expression('relative_url_inline') . ')#ie';
- $magic_url_replace[] = "'\$1<!-- l --><a href=\"\$2/' . preg_replace('/(&amp;|\?)sid=[0-9a-f]{32}/', '\\\\1', '\$3') . '\">' . preg_replace('/(&amp;|\?)sid=[0-9a-f]{32}/', '\\\\1', '\$3') . '</a><!-- l -->'";
+ $magic_url_replace[] = "'\$1<!-- l --><a href=\"\$2/' . preg_replace('/(&amp;|\?)sid=[0-9a-f]{32}/', '\\\\1', '\$3') . '\">' . ((strlen('\$3')) ? preg_replace('/(&amp;|\?)sid=[0-9a-f]{32}/', '\\\\1', '\$3') : '\$2/') . '</a><!-- l -->'";
// matches a xxxx://aaaaa.bbb.cccc. ...
$magic_url_match[] = '#(^|[\n\t (])(' . get_preg_expression('url_inline') . ')#ie';
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php
index e0b7b8a554..f319873e2c 100644
--- a/phpBB/includes/functions_admin.php
+++ b/phpBB/includes/functions_admin.php
@@ -495,7 +495,7 @@ function move_posts($post_ids, $topic_id, $auto_sync = true)
/**
* Remove topic(s)
*/
-function delete_topics($where_type, $where_ids, $auto_sync = true)
+function delete_topics($where_type, $where_ids, $auto_sync = true, $post_count_sync = true)
{
global $db, $config;
@@ -517,7 +517,7 @@ function delete_topics($where_type, $where_ids, $auto_sync = true)
}
$return = array(
- 'posts' => delete_posts($where_type, $where_ids, false, true)
+ 'posts' => delete_posts($where_type, $where_ids, false, true, $post_count_sync)
);
$sql = 'SELECT topic_id, forum_id, topic_approved
@@ -579,7 +579,7 @@ function delete_topics($where_type, $where_ids, $auto_sync = true)
/**
* Remove post(s)
*/
-function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync = true)
+function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync = true, $post_count_sync = true)
{
global $db, $config, $phpbb_root_path, $phpEx;
@@ -612,7 +612,7 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync =
$topic_ids[] = $row['topic_id'];
$forum_ids[] = $row['forum_id'];
- if ($row['post_postcount'])
+ if ($row['post_postcount'] && $post_count_sync)
{
$post_counts[$row['poster_id']] = (!empty($post_counts[$row['poster_id']])) ? $post_counts[$row['poster_id']] + 1 : 1;
}
@@ -642,7 +642,7 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync =
unset($table_ary);
// Adjust users post counts
- if (sizeof($post_counts))
+ if (sizeof($post_counts) && $post_count_sync)
{
foreach ($post_counts as $poster_id => $substract)
{
@@ -1896,7 +1896,7 @@ function prune($forum_id, $prune_mode, $prune_date, $prune_flags = 0, $auto_sync
$topic_list = array_unique($topic_list);
}
- return delete_topics('topic_id', $topic_list, $auto_sync);
+ return delete_topics('topic_id', $topic_list, $auto_sync, false);
}
/**
diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php
index 6378295191..6733a73a7e 100644
--- a/phpBB/includes/mcp/mcp_queue.php
+++ b/phpBB/includes/mcp/mcp_queue.php
@@ -379,7 +379,7 @@ class mcp_queue
'S_MCP_ACTION' => build_url(array('t', 'f', 'sd', 'st', 'sk')),
'S_TOPICS' => ($mode == 'unapproved_posts') ? false : true,
- 'PAGINATION' => generate_pagination($this->u_action . "&amp;f=$forum_id", $total, $config['topics_per_page'], $start),
+ 'PAGINATION' => generate_pagination($this->u_action . "&amp;f=$forum_id&amp;st=$sort_days&amp;sk=$sort_key&amp;sd=$sort_dir", $total, $config['topics_per_page'], $start),
'PAGE_NUMBER' => on_page($total, $config['topics_per_page'], $start),
'TOPIC_ID' => $topic_id,
'TOTAL' => $total)
diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php
index a57dadb301..a4cd1dd5d1 100755
--- a/phpBB/includes/mcp/mcp_reports.php
+++ b/phpBB/includes/mcp/mcp_reports.php
@@ -353,7 +353,7 @@ class mcp_reports
'S_FORUM_OPTIONS' => $forum_options,
'S_CLOSED' => ($mode == 'reports_closed') ? true : false,
- 'PAGINATION' => generate_pagination($this->u_action . "&amp;f=$forum_id&amp;t=$topic_id", $total, $config['topics_per_page'], $start),
+ 'PAGINATION' => generate_pagination($this->u_action . "&amp;f=$forum_id&amp;t=$topic_id&amp;st=$sort_days&amp;sk=$sort_key&amp;sd=$sort_dir", $total, $config['topics_per_page'], $start),
'PAGE_NUMBER' => on_page($total, $config['topics_per_page'], $start),
'TOPIC_ID' => $topic_id,
'TOTAL' => $total,
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 0e4b0381f0..2d19b46245 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -378,6 +378,8 @@ switch ($db->sql_layer)
$error_ary = array();
$errored = false;
+header('Content-type: text/html; charset=UTF-8');
+
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="<?php echo $lang['DIRECTION']; ?>" lang="<?php echo $lang['USER_LANG']; ?>" xml:lang="<?php echo $lang['USER_LANG']; ?>">
diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php
index a35e239a81..27e0e7afa3 100644
--- a/phpBB/language/en/acp/common.php
+++ b/phpBB/language/en/acp/common.php
@@ -317,13 +317,23 @@ $lang = array_merge($lang, array(
'POSTS_PER_DAY' => 'Posts per day',
- 'RESET_DATE' => 'Reset date',
- 'RESET_ONLINE' => 'Reset online',
- 'RESYNC_POSTCOUNTS' => 'Resynchronise post counts',
- 'RESYNC_POST_MARKING' => 'Resynchronise dotted topics',
- 'RESYNC_STATS' => 'Resynchronise statistics',
-
- 'STATISTIC' => 'Statistic',
+ 'RESET_DATE' => 'Reset board’s start date',
+ 'RESET_DATE_CONFIRM' => 'Are you sure you wish to reset the board’s start date?',
+ 'RESET_ONLINE' => 'Reset most users ever online',
+ 'RESET_ONLINE_CONFIRM' => 'Are you sure you wish to reset the most users ever online counter?',
+ 'RESYNC_POSTCOUNTS' => 'Resynchronise post counts',
+ 'RESYNC_POSTCOUNTS_EXPLAIN' => 'Only existing posts will be taken into consideration. Pruned posts will not be counted.',
+ 'RESYNC_POSTCOUNTS_CONFIRM' => 'Are you sure you wish to resynchronise post counts?',
+ 'RESYNC_POST_MARKING' => 'Resynchronise dotted topics',
+ 'RESYNC_POST_MARKING_CONFIRM' => 'Are you sure you wish to resynchronise dotted topics?',
+ 'RESYNC_POST_MARKING_EXPLAIN' => 'First unmarks all topics and then correctly marks topics that have seen any activity during the past six months',
+ 'RESYNC_STATS' => 'Resynchronise statistics',
+ 'RESYNC_STATS_CONFIRM' => 'Are you sure you wish to resynchronise statistics?',
+ 'RESYNC_STATS_EXPLAIN' => 'Recalculates the total number of posts, topics, users and files.',
+ 'RUN' => 'Run now',
+
+ 'STATISTIC' => 'Statistic',
+ 'STATISTIC_RESYNC_OPTIONS' => 'Resynchronise or reset statistics',
'TOPICS_PER_DAY' => 'Topics per day',
@@ -362,20 +372,20 @@ $lang = array_merge($lang, array(
// Log Entries
$lang = array_merge($lang, array(
- 'LOG_ACL_ADD_USER_GLOBAL_U_' => '<strong>Added or edited users user permissions</strong><br />» %s',
- 'LOG_ACL_ADD_GROUP_GLOBAL_U_' => '<strong>Added or edited groups user permissions</strong><br />» %s',
- 'LOG_ACL_ADD_USER_GLOBAL_M_' => '<strong>Added or edited users global moderator permissions</strong><br />» %s',
- 'LOG_ACL_ADD_GROUP_GLOBAL_M_' => '<strong>Added or edited groups global moderator permissions</strong><br />» %s',
- 'LOG_ACL_ADD_USER_GLOBAL_A_' => '<strong>Added or edited users administrator permissions</strong><br />» %s',
- 'LOG_ACL_ADD_GROUP_GLOBAL_A_' => '<strong>Added or edited groups administrator permissions</strong><br />» %s',
+ 'LOG_ACL_ADD_USER_GLOBAL_U_' => '<strong>Added or edited users’ user permissions</strong><br />» %s',
+ 'LOG_ACL_ADD_GROUP_GLOBAL_U_' => '<strong>Added or edited groups’ user permissions</strong><br />» %s',
+ 'LOG_ACL_ADD_USER_GLOBAL_M_' => '<strong>Added or edited users’ global moderator permissions</strong><br />» %s',
+ 'LOG_ACL_ADD_GROUP_GLOBAL_M_' => '<strong>Added or edited groups’ global moderator permissions</strong><br />» %s',
+ 'LOG_ACL_ADD_USER_GLOBAL_A_' => '<strong>Added or edited users’ administrator permissions</strong><br />» %s',
+ 'LOG_ACL_ADD_GROUP_GLOBAL_A_' => '<strong>Added or edited groups’ administrator permissions</strong><br />» %s',
'LOG_ACL_ADD_ADMIN_GLOBAL_A_' => '<strong>Added or edited Administrators</strong><br />» %s',
'LOG_ACL_ADD_MOD_GLOBAL_M_' => '<strong>Added or edited Global Moderators</strong><br />» %s',
- 'LOG_ACL_ADD_USER_LOCAL_F_' => '<strong>Added or edited users forum access</strong> from %1$s<br />» %2$s',
- 'LOG_ACL_ADD_USER_LOCAL_M_' => '<strong>Added or edited users forum moderator access</strong> from %1$s<br />» %2$s',
- 'LOG_ACL_ADD_GROUP_LOCAL_F_' => '<strong>Added or edited groups forum access</strong> from %1$s<br />» %2$s',
- 'LOG_ACL_ADD_GROUP_LOCAL_M_' => '<strong>Added or edited groups forum moderator access</strong> from %1$s<br />» %2$s',
+ 'LOG_ACL_ADD_USER_LOCAL_F_' => '<strong>Added or edited users’ forum access</strong> from %1$s<br />» %2$s',
+ 'LOG_ACL_ADD_USER_LOCAL_M_' => '<strong>Added or edited users’ forum moderator access</strong> from %1$s<br />» %2$s',
+ 'LOG_ACL_ADD_GROUP_LOCAL_F_' => '<strong>Added or edited groups’ forum access</strong> from %1$s<br />» %2$s',
+ 'LOG_ACL_ADD_GROUP_LOCAL_M_' => '<strong>Added or edited groups’ forum moderator access</strong> from %1$s<br />» %2$s',
'LOG_ACL_ADD_MOD_LOCAL_M_' => '<strong>Added or edited Moderators</strong> from %1$s<br />» %2$s',
'LOG_ACL_ADD_FORUM_LOCAL_F_' => '<strong>Added or edited forum permissions</strong> from %1$s<br />» %2$s',