aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/acp/acp_forums.php4
-rw-r--r--phpBB/includes/acp/acp_groups.php4
-rw-r--r--phpBB/includes/acp/acp_main.php20
-rw-r--r--phpBB/includes/functions.php3
-rw-r--r--phpBB/includes/functions_display.php78
-rw-r--r--phpBB/includes/functions_user.php3
-rw-r--r--phpBB/includes/session.php2
7 files changed, 45 insertions, 69 deletions
diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php
index 9a819d97e1..042f5c4e48 100644
--- a/phpBB/includes/acp/acp_forums.php
+++ b/phpBB/includes/acp/acp_forums.php
@@ -99,11 +99,11 @@ class acp_forums
'forum_link_track' => request_var('forum_link_track', false),
'forum_desc' => request_var('forum_desc', '', true),
'forum_desc_uid' => '',
- 'forum_desc_options' => 0,
+ 'forum_desc_options' => 7,
'forum_desc_bitfield' => '',
'forum_rules' => request_var('forum_rules', '', true),
'forum_rules_uid' => '',
- 'forum_rules_options' => 0,
+ 'forum_rules_options' => 7,
'forum_rules_bitfield' => '',
'forum_rules_link' => request_var('forum_rules_link', ''),
'forum_image' => request_var('forum_image', ''),
diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php
index 5fccc565da..600d596370 100644
--- a/phpBB/includes/acp/acp_groups.php
+++ b/phpBB/includes/acp/acp_groups.php
@@ -85,7 +85,7 @@ class acp_groups
break;
}
- group_update_listing($group_id);
+ group_update_listings($group_id);
trigger_error($user->lang[$message] . adm_back_link($this->u_action . '&action=list&g=' . $group_id));
break;
@@ -136,7 +136,7 @@ class acp_groups
group_user_attributes('default', $group_id, $mark_ary, false, $group_row['group_name'], $group_row);
}
- group_update_listing($group_id);
+ group_update_listings($group_id);
trigger_error($user->lang['GROUP_DEFS_UPDATED'] . adm_back_link($this->u_action . '&action=list&g=' . $group_id));
}
diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php
index b1331fa1ae..b0c12c7928 100644
--- a/phpBB/includes/acp/acp_main.php
+++ b/phpBB/includes/acp/acp_main.php
@@ -406,12 +406,19 @@ class acp_main
$files_per_day = $total_files;
}
- $sql = 'SELECT COUNT(attach_id) AS total_orphan
- FROM ' . ATTACHMENTS_TABLE . '
- WHERE is_orphan = 1';
- $result = $db->sql_query($sql);
- $total_orphan = (int) $db->sql_fetchfield('total_orphan');
- $db->sql_freeresult($result);
+ if ($config['allow_attachments'] || $config['allow_pm_attach'])
+ {
+ $sql = 'SELECT COUNT(attach_id) AS total_orphan
+ FROM ' . ATTACHMENTS_TABLE . '
+ WHERE is_orphan = 1';
+ $result = $db->sql_query($sql);
+ $total_orphan = (int) $db->sql_fetchfield('total_orphan');
+ $db->sql_freeresult($result);
+ }
+ else
+ {
+ $total_orphan = false;
+ }
$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'));
@@ -430,6 +437,7 @@ class acp_main
'DBSIZE' => $dbsize,
'UPLOAD_DIR_SIZE' => $upload_dir_size,
'TOTAL_ORPHAN' => $total_orphan,
+ 'S_TOTAL_ORPHAN' => ($total_orphan === false) ? false : true,
'GZIP_COMPRESSION' => ($config['gzip_compress']) ? $user->lang['ON'] : $user->lang['OFF'],
'DATABASE_INFO' => $db->sql_server_info(),
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index d7a594eeeb..4fa041bfd1 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -2236,8 +2236,7 @@ function generate_text_for_storage(&$text, &$uid, &$bitfield, &$flags, $allow_bb
{
global $phpbb_root_path, $phpEx;
- $uid = '';
- $bitfield = '';
+ $uid = $bitfield = '';
if (!$text)
{
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php
index 217befd5fa..2c82fda5ed 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -1018,24 +1018,11 @@ function display_user_activity(&$userdata)
global $auth, $template, $db, $user;
global $phpbb_root_path, $phpEx;
- // Init new auth class if user is different
- if ($user->data['user_id'] != $userdata['user_id'])
- {
- $auth2 = new auth();
- $auth2->acl($userdata);
-
- $post_count_ary = $auth2->acl_getf('!f_postcount');
- }
- else
- {
- $post_count_ary = $auth->acl_getf('!f_postcount');
- }
-
- $forum_read_ary = $auth->acl_getf('!f_read');
-
$forum_ary = array();
// Do not include those forums the user is not having read access to...
+ $forum_read_ary = $auth->acl_getf('!f_read');
+
foreach ($forum_read_ary as $forum_id => $not_allowed)
{
if ($not_allowed['f_read'])
@@ -1044,40 +1031,27 @@ function display_user_activity(&$userdata)
}
}
- // Now do not include those forums where the posts do not count...
- foreach ($post_count_ary as $forum_id => $not_counted)
- {
- if ($not_counted['f_postcount'])
- {
- $forum_ary[] = (int) $forum_id;
- }
- }
-
$forum_ary = array_unique($forum_ary);
- $post_count_sql = (sizeof($forum_ary)) ? 'AND ' . $db->sql_in_set('f.forum_id', $forum_ary, true) : '';
+ $forum_sql = (sizeof($forum_ary)) ? 'AND ' . $db->sql_in_set('forum_id', $forum_ary, true) : '';
+
+ // Obtain active forum
+ $sql = 'SELECT forum_id, COUNT(post_id) AS num_posts
+ FROM ' . POSTS_TABLE . '
+ WHERE poster_id = ' . $userdata['user_id'] . "
+ AND post_postcount = 1
+ $forum_sql
+ GROUP BY forum_id";
// Firebird does not support ORDER BY on aliased columns
// MySQL does not support ORDER BY on functions
switch (SQL_LAYER)
{
case 'firebird':
- $sql = 'SELECT f.forum_id, COUNT(p.post_id) AS num_posts
- FROM ' . POSTS_TABLE . ' p, ' . FORUMS_TABLE . ' f
- WHERE p.poster_id = ' . $userdata['user_id'] . "
- AND f.forum_id = p.forum_id
- $post_count_sql
- GROUP BY f.forum_id
- ORDER BY COUNT(p.post_id) DESC";
+ $sql .= ' ORDER BY COUNT(post_id) DESC';
break;
default:
- $sql = 'SELECT f.forum_id, COUNT(p.post_id) AS num_posts
- FROM ' . POSTS_TABLE . ' p, ' . FORUMS_TABLE . ' f
- WHERE p.poster_id = ' . $userdata['user_id'] . "
- AND f.forum_id = p.forum_id
- $post_count_sql
- GROUP BY f.forum_id
- ORDER BY num_posts DESC";
+ $sql .= ' ORDER BY num_posts DESC';
break;
}
@@ -1095,30 +1069,24 @@ function display_user_activity(&$userdata)
$db->sql_freeresult($result);
}
+ // Obtain active topic
+ $sql = 'SELECT topic_id, COUNT(post_id) AS num_posts
+ FROM ' . POSTS_TABLE . '
+ WHERE poster_id = ' . $userdata['user_id'] . "
+ AND post_postcount = 1
+ $forum_sql
+ GROUP BY topic_id";
+
// Firebird does not support ORDER BY on aliased columns
// MySQL does not support ORDER BY on functions
switch (SQL_LAYER)
{
case 'firebird':
- $sql = 'SELECT t.topic_id, COUNT(p.post_id) AS num_posts
- FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . ' f
- WHERE p.poster_id = ' . $userdata['user_id'] . "
- AND t.topic_id = p.topic_id
- AND f.forum_id = t.forum_id
- $post_count_sql
- GROUP BY t.topic_id
- ORDER BY COUNT(p.post_id) DESC";
+ $sql .= ' ORDER BY COUNT(post_id) DESC';
break;
default:
- $sql = 'SELECT t.topic_id, COUNT(p.post_id) AS num_posts
- FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . ' f
- WHERE p.poster_id = ' . $userdata['user_id'] . "
- AND t.topic_id = p.topic_id
- AND f.forum_id = t.forum_id
- $post_count_sql
- GROUP BY t.topic_id
- ORDER BY num_posts DESC";
+ $sql .= ' ORDER BY num_posts DESC';
break;
}
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index 8970b7865e..07701f27ac 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -156,6 +156,7 @@ function user_add($user_row, $cp_data = false)
'user_actkey' => '',
'user_ip' => '',
'user_regdate' => time(),
+ 'user_passchg' => time(),
'user_lastmark' => time(),
'user_lastvisit' => 0,
@@ -255,6 +256,7 @@ function user_add($user_row, $cp_data = false)
function user_delete($mode, $user_id, $post_username = false)
{
global $config, $db, $user, $auth;
+ global $phpbb_root_path, $phpEx;
$db->sql_transaction('begin');
@@ -286,7 +288,6 @@ function user_delete($mode, $user_id, $post_username = false)
if (!function_exists('delete_posts'))
{
- global $phpbb_root_path, $phpEx;
include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
}
diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php
index 458eb44b40..9af770e240 100644
--- a/phpBB/includes/session.php
+++ b/phpBB/includes/session.php
@@ -1202,7 +1202,7 @@ class user extends session
// Does the user need to change their password? If so, redirect to the
// ucp profile reg_details page ... of course do not redirect if we're already in the ucp
- if (!defined('IN_ADMIN') && $config['chg_passforce'] && $this->data['is_registered'] && $this->data['user_passchg'] < time() - ($config['chg_passforce'] * 86400))
+ if (!defined('IN_ADMIN') && !defined('ADMIN_START') && $config['chg_passforce'] && $this->data['is_registered'] && $this->data['user_passchg'] < time() - ($config['chg_passforce'] * 86400))
{
if (strpos($this->page['query_string'], 'mode=reg_details') === false && $this->page['page_name'] != "ucp.$phpEx")
{