From 4553293053ba5ccdd369a181adda30e6ee0159eb Mon Sep 17 00:00:00 2001 From: Graham Eames Date: Mon, 21 Aug 2006 15:58:48 +0000 Subject: Initial batch of colourization changes. This includes: - schema changes for first post and last post - display in viewforum, search and ucp of first post - update of database on posting Still outstanding - display of last post git-svn-id: file:///svn/phpbb/trunk@6309 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_admin.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'phpBB/includes/functions_admin.php') diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 307044b9a0..ffcf91b2bb 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -1638,7 +1638,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, unset($delete_topics); } - $sql = 'SELECT p.post_id, p.topic_id, p.post_approved, p.poster_id, p.post_username, p.post_time, u.username + $sql = 'SELECT p.post_id, p.topic_id, p.post_approved, p.poster_id, p.post_username, p.post_time, u.username, u.user_colour FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u WHERE ' . $db->sql_in_set('p.post_id', $post_ids) . ' AND u.user_id = p.poster_id'; @@ -1658,6 +1658,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, $topic_data[$topic_id]['time'] = $row['post_time']; $topic_data[$topic_id]['poster'] = $row['poster_id']; $topic_data[$topic_id]['first_poster_name'] = ($row['poster_id'] == ANONYMOUS) ? $row['post_username'] : $row['username']; + $topic_data[$topic_id]['first_poster_colour'] = $row['user_colour']; } if ($row['post_id'] == $topic_data[$topic_id]['last_post_id']) @@ -1665,6 +1666,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, $topic_data[$topic_id]['last_poster_id'] = $row['poster_id']; $topic_data[$topic_id]['last_post_time'] = $row['post_time']; $topic_data[$topic_id]['last_poster_name'] = ($row['poster_id'] == ANONYMOUS) ? $row['post_username'] : $row['username']; + $topic_data[$topic_id]['last_poster_colour'] = $row['user_colour']; } } $db->sql_freeresult($result); -- cgit v1.2.1 From 1d42d1b9817050974c8bc8b91bc34a6c3cfbfef8 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 22 Aug 2006 21:26:06 +0000 Subject: some updates. Also adjusted the utf tools and normalizer more to our coding guidelines. git-svn-id: file:///svn/phpbb/trunk@6312 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_admin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes/functions_admin.php') diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index ffcf91b2bb..85ed30db18 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -2467,7 +2467,7 @@ function get_remote_file($host, $directory, $filename, &$errstr, &$errno, $port } else if (strpos($line, '404 Not Found') !== false) { - $errstr = $user->lang['FILE_NOT_FOUND']; + $errstr = $user->lang['FILE_NOT_FOUND'] . ': ' . $filename; return false; } } -- cgit v1.2.1 From e6e1be982771f9604c4316cffaa7ccea5a9010f7 Mon Sep 17 00:00:00 2001 From: Graham Eames Date: Wed, 23 Aug 2006 14:59:52 +0000 Subject: Fix some minor bugs arising from yesterday. Nils - I haven't looked into the other related pages yet git-svn-id: file:///svn/phpbb/trunk@6315 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_admin.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'phpBB/includes/functions_admin.php') diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 85ed30db18..73022aa2a3 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -1378,6 +1378,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, $forum_data[$forum_id]['last_post_time'] = 0; $forum_data[$forum_id]['last_poster_id'] = 0; $forum_data[$forum_id]['last_poster_name'] = ''; + $forum_data[$forum_id]['last_poster_colour'] = ''; } $db->sql_freeresult($result); @@ -1427,7 +1428,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, // 4: Retrieve last_post infos if (sizeof($post_ids)) { - $sql = 'SELECT p.post_id, p.poster_id, p.post_time, p.post_username, u.username + $sql = 'SELECT p.post_id, p.poster_id, p.post_time, p.post_username, u.username, u.user_colour FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u WHERE ' . $db->sql_in_set('p.post_id', $post_ids) . ' AND p.poster_id = u.user_id'; @@ -1448,6 +1449,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, $forum_data[$forum_id]['last_post_time'] = $post_info[$data['last_post_id']]['post_time']; $forum_data[$forum_id]['last_poster_id'] = $post_info[$data['last_post_id']]['poster_id']; $forum_data[$forum_id]['last_poster_name'] = ($post_info[$data['last_post_id']]['poster_id'] != ANONYMOUS) ? $post_info[$data['last_post_id']]['username'] : $post_info[$data['last_post_id']]['post_username']; + $forum_data[$forum_id]['last_poster_colour'] = $post_info[$data['last_post_id']]['user_colour']; } else { @@ -1456,6 +1458,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, $forum_data[$forum_id]['last_post_time'] = 0; $forum_data[$forum_id]['last_poster_id'] = 0; $forum_data[$forum_id]['last_poster_name'] = ''; + $forum_data[$forum_id]['last_poster_colour'] = ''; } } } @@ -1463,7 +1466,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, } // 5: Now do that thing - $fieldnames = array('posts', 'topics', 'topics_real', 'last_post_id', 'last_post_time', 'last_poster_id', 'last_poster_name'); + $fieldnames = array('posts', 'topics', 'topics_real', 'last_post_id', 'last_post_time', 'last_poster_id', 'last_poster_name', 'last_poster_colour'); foreach ($forum_data as $forum_id => $row) { @@ -1497,7 +1500,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, case 'topic': $topic_data = $post_ids = $approved_unapproved_ids = $resync_forums = $delete_topics = $delete_posts = $moved_topics = array(); - $sql = 'SELECT t.topic_id, t.forum_id, t.topic_moved_id, t.topic_approved, ' . (($sync_extra) ? 't.topic_attachment, t.topic_reported, ' : '') . 't.topic_poster, t.topic_time, t.topic_replies, t.topic_replies_real, t.topic_first_post_id, t.topic_first_poster_name, t.topic_last_post_id, t.topic_last_poster_id, t.topic_last_poster_name, t.topic_last_post_time + $sql = 'SELECT t.topic_id, t.forum_id, t.topic_moved_id, t.topic_approved, ' . (($sync_extra) ? 't.topic_attachment, t.topic_reported, ' : '') . 't.topic_poster, t.topic_time, t.topic_replies, t.topic_replies_real, t.topic_first_post_id, t.topic_first_poster_name, t.topic_first_poster_colour, t.topic_last_post_id, t.topic_last_poster_id, t.topic_last_poster_name, t.topic_last_poster_colour, t.topic_last_post_time FROM ' . TOPICS_TABLE . " t $where_sql"; $result = $db->sql_query($sql); @@ -1682,7 +1685,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, unset($approved_unapproved_ids); // These are fields that will be synchronised - $fieldnames = array('time', 'replies', 'replies_real', 'poster', 'first_post_id', 'first_poster_name', 'last_post_id', 'last_post_time', 'last_poster_id', 'last_poster_name'); + $fieldnames = array('time', 'replies', 'replies_real', 'poster', 'first_post_id', 'first_poster_name', 'first_poster_colour', 'last_post_id', 'last_post_time', 'last_poster_id', 'last_poster_name', 'last_poster_colour'); if ($sync_extra) { -- cgit v1.2.1 From d1ae8c52a4fc4ab88f34347962ac667a0365f8a9 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 23 Aug 2006 15:46:10 +0000 Subject: colour is a string. :) git-svn-id: file:///svn/phpbb/trunk@6316 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_admin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes/functions_admin.php') diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 73022aa2a3..bb889eae12 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -1476,7 +1476,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, { if ($row['forum_' . $fieldname] != $row[$fieldname]) { - if (preg_match('#name$#', $fieldname)) + if (preg_match('#(name|colour)$#', $fieldname)) { $sql_ary['forum_' . $fieldname] = (string) $row[$fieldname]; } -- cgit v1.2.1 From 3ea2d53cb2b2554e944beb96fb98ea5c4c3aa23e Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 2 Sep 2006 13:33:06 +0000 Subject: some changes/fixes git-svn-id: file:///svn/phpbb/trunk@6345 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_admin.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'phpBB/includes/functions_admin.php') diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index bb889eae12..822d17367c 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -511,7 +511,7 @@ function delete_topics($where_type, $where_ids, $auto_sync = true) $forum_ids[] = $row['forum_id']; $topic_ids[] = $row['topic_id']; } - $db->sql_freeresult(); + $db->sql_freeresult($result); $return['topics'] = sizeof($topic_ids); @@ -628,7 +628,7 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync = trigger_error('NO_SUCH_SEARCH_MODULE'); } - require("{$phpbb_root_path}includes/search/$search_type.$phpEx"); + include_once("{$phpbb_root_path}includes/search/$search_type.$phpEx"); $error = false; $search = new $search_type($error); @@ -1142,7 +1142,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, { $topic_ids[] = $row['topic_id']; } - $db->sql_freeresult(); + $db->sql_freeresult($result); if (!sizeof($topic_ids)) { @@ -1728,7 +1728,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, foreach ($fieldnames as $fieldname) { - if ($row['topic_' . $fieldname] != $row[$fieldname]) + if (isset($row[$fieldname]) && isset($row['topic_' . $fieldname]) && $row['topic_' . $fieldname] != $row[$fieldname]) { $sql_ary['topic_' . $fieldname] = $row[$fieldname]; } -- cgit v1.2.1 From 5ea461108e2ddf10b72acbc1a79df01af5ec5d81 Mon Sep 17 00:00:00 2001 From: Graham Eames Date: Sat, 2 Sep 2006 15:36:45 +0000 Subject: - Fix warning removal, x - 0 = x ;-) - Make sure that the cached colour information is updated when altering groups - Also consolidate some related code at the same time git-svn-id: file:///svn/phpbb/trunk@6350 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_admin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes/functions_admin.php') diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 822d17367c..414e72ca89 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -2514,7 +2514,7 @@ function tidy_warnings() while ($row = $db->sql_fetchrow($result)) { $warning_list[] = $row['warning_id']; - $user_list[$row['user_id']] = isset($user_list[$row['user_id']]) ? $user_list[$row['user_id']]++ : 0; + $user_list[$row['user_id']] = isset($user_list[$row['user_id']]) ? $user_list[$row['user_id']]++ : 1; } $db->sql_freeresult($result); -- cgit v1.2.1 From 6568ab756c636490ce74c5beb63b53a353e49fbe Mon Sep 17 00:00:00 2001 From: Graham Eames Date: Fri, 8 Sep 2006 18:00:38 +0000 Subject: Next phase of last post changes + a few minor bugs Note: This template variable is available but will not be used by default git-svn-id: file:///svn/phpbb/trunk@6360 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_admin.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'phpBB/includes/functions_admin.php') diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 414e72ca89..26133786b3 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -1375,6 +1375,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, $forum_data[$forum_id]['topics'] = 0; $forum_data[$forum_id]['topics_real'] = 0; $forum_data[$forum_id]['last_post_id'] = 0; + $forum_data[$forum_id]['last_post_subject'] = ''; $forum_data[$forum_id]['last_post_time'] = 0; $forum_data[$forum_id]['last_poster_id'] = 0; $forum_data[$forum_id]['last_poster_name'] = ''; @@ -1428,7 +1429,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, // 4: Retrieve last_post infos if (sizeof($post_ids)) { - $sql = 'SELECT p.post_id, p.poster_id, p.post_time, p.post_username, u.username, u.user_colour + $sql = 'SELECT p.post_id, p.poster_id, p.post_subject, p.post_time, p.post_username, u.username, u.user_colour FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u WHERE ' . $db->sql_in_set('p.post_id', $post_ids) . ' AND p.poster_id = u.user_id'; @@ -1446,6 +1447,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, { if (isset($post_info[$data['last_post_id']])) { + $forum_data[$forum_id]['last_post_subject'] = $post_info[$data['last_post_id']]['post_subject']; $forum_data[$forum_id]['last_post_time'] = $post_info[$data['last_post_id']]['post_time']; $forum_data[$forum_id]['last_poster_id'] = $post_info[$data['last_post_id']]['poster_id']; $forum_data[$forum_id]['last_poster_name'] = ($post_info[$data['last_post_id']]['poster_id'] != ANONYMOUS) ? $post_info[$data['last_post_id']]['username'] : $post_info[$data['last_post_id']]['post_username']; @@ -1455,6 +1457,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, { // For some reason we did not find the post in the db $forum_data[$forum_id]['last_post_id'] = 0; + $forum_data[$forum_id]['last_post_subject'] = ''; $forum_data[$forum_id]['last_post_time'] = 0; $forum_data[$forum_id]['last_poster_id'] = 0; $forum_data[$forum_id]['last_poster_name'] = ''; @@ -1466,7 +1469,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, } // 5: Now do that thing - $fieldnames = array('posts', 'topics', 'topics_real', 'last_post_id', 'last_post_time', 'last_poster_id', 'last_poster_name', 'last_poster_colour'); + $fieldnames = array('posts', 'topics', 'topics_real', 'last_post_id', 'last_post_subject', 'last_post_time', 'last_poster_id', 'last_poster_name', 'last_poster_colour'); foreach ($forum_data as $forum_id => $row) { @@ -1476,7 +1479,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, { if ($row['forum_' . $fieldname] != $row[$fieldname]) { - if (preg_match('#(name|colour)$#', $fieldname)) + if (preg_match('#(name|colour|subject)$#', $fieldname)) { $sql_ary['forum_' . $fieldname] = (string) $row[$fieldname]; } @@ -1500,7 +1503,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, case 'topic': $topic_data = $post_ids = $approved_unapproved_ids = $resync_forums = $delete_topics = $delete_posts = $moved_topics = array(); - $sql = 'SELECT t.topic_id, t.forum_id, t.topic_moved_id, t.topic_approved, ' . (($sync_extra) ? 't.topic_attachment, t.topic_reported, ' : '') . 't.topic_poster, t.topic_time, t.topic_replies, t.topic_replies_real, t.topic_first_post_id, t.topic_first_poster_name, t.topic_first_poster_colour, t.topic_last_post_id, t.topic_last_poster_id, t.topic_last_poster_name, t.topic_last_poster_colour, t.topic_last_post_time + $sql = 'SELECT t.topic_id, t.forum_id, t.topic_moved_id, t.topic_approved, ' . (($sync_extra) ? 't.topic_attachment, t.topic_reported, ' : '') . 't.topic_poster, t.topic_time, t.topic_replies, t.topic_replies_real, t.topic_first_post_id, t.topic_first_poster_name, t.topic_first_poster_colour, t.topic_last_post_id, t.topic_last_post_subject, t.topic_last_poster_id, t.topic_last_poster_name, t.topic_last_poster_colour, t.topic_last_post_time FROM ' . TOPICS_TABLE . " t $where_sql"; $result = $db->sql_query($sql); @@ -1641,7 +1644,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, unset($delete_topics); } - $sql = 'SELECT p.post_id, p.topic_id, p.post_approved, p.poster_id, p.post_username, p.post_time, u.username, u.user_colour + $sql = 'SELECT p.post_id, p.topic_id, p.post_approved, p.poster_id, p.post_subject, p.post_username, p.post_time, u.username, u.user_colour FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u WHERE ' . $db->sql_in_set('p.post_id', $post_ids) . ' AND u.user_id = p.poster_id'; @@ -1667,6 +1670,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, if ($row['post_id'] == $topic_data[$topic_id]['last_post_id']) { $topic_data[$topic_id]['last_poster_id'] = $row['poster_id']; + $topic_data[$topic_id]['last_post_subject'] = $row['post_subject']; $topic_data[$topic_id]['last_post_time'] = $row['post_time']; $topic_data[$topic_id]['last_poster_name'] = ($row['poster_id'] == ANONYMOUS) ? $row['post_username'] : $row['username']; $topic_data[$topic_id]['last_poster_colour'] = $row['user_colour']; @@ -1685,7 +1689,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, unset($approved_unapproved_ids); // These are fields that will be synchronised - $fieldnames = array('time', 'replies', 'replies_real', 'poster', 'first_post_id', 'first_poster_name', 'first_poster_colour', 'last_post_id', 'last_post_time', 'last_poster_id', 'last_poster_name', 'last_poster_colour'); + $fieldnames = array('time', 'replies', 'replies_real', 'poster', 'first_post_id', 'first_poster_name', 'first_poster_colour', 'last_post_id', 'last_post_subject', 'last_post_time', 'last_poster_id', 'last_poster_name', 'last_poster_colour'); if ($sync_extra) { -- cgit v1.2.1 From b76222cb6e9ed69ee8ed0c09f0196eaaafd33fad Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 13 Sep 2006 16:08:36 +0000 Subject: - fixed some bugs - changed attachment handling a bit - tried to remove target tags out of the code - do not add session ids to urls for bots as well as not creating a new session on each page view for them I bet i introduced some bugs too. ;) git-svn-id: file:///svn/phpbb/trunk@6364 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_admin.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'phpBB/includes/functions_admin.php') diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 26133786b3..49bad121e1 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -1782,12 +1782,12 @@ function prune($forum_id, $prune_mode, $prune_date, $prune_flags = 0, $auto_sync $sql_and = ''; - if (!($prune_flags & 4)) + if (!($prune_flags & FORUM_FLAG_PRUNE_ANNOUNCE)) { $sql_and .= ' AND topic_type <> ' . POST_ANNOUNCE; } - if (!($prune_flags & 8)) + if (!($prune_flags & FORUM_FLAG_PRUNE_STICKY)) { $sql_and .= ' AND topic_type <> ' . POST_STICKY; } @@ -1816,7 +1816,7 @@ function prune($forum_id, $prune_mode, $prune_date, $prune_flags = 0, $auto_sync } $db->sql_freeresult($result); - if ($prune_flags & 2) + if ($prune_flags & FORUM_FLAG_PRUNE_POLL) { $sql = 'SELECT topic_id FROM ' . TOPICS_TABLE . ' -- cgit v1.2.1 From 79137c312c15638a380adacb18a2d7194f42f09d Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Thu, 14 Sep 2006 14:57:29 +0000 Subject: - Fix some bugs - fixed retrieving of permissions if the LIKE statement is used as well as proper supporting (needs testing on mssql) git-svn-id: file:///svn/phpbb/trunk@6366 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_admin.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'phpBB/includes/functions_admin.php') diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 49bad121e1..2f2e333c78 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -2304,6 +2304,32 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id return; } +/** +* Update foes - remove moderators and administrators from foe lists... +*/ +function update_foes() +{ + global $db, $auth; + + $perms = array(); + foreach ($auth->acl_get_list(false, array('a_', 'm_'), false) as $forum_id => $forum_ary) + { + foreach ($forum_ary as $auth_option => $user_ary) + { + $perms = array_merge($perms, $user_ary); + } + } + + if (sizeof($perms)) + { + $sql = 'DELETE FROM ' . ZEBRA_TABLE . ' + WHERE ' . $db->sql_in_set('zebra_id', array_unique($perms)) . ' + AND foe = 1'; + $db->sql_query($sql); + } + unset($perms); +} + /** * Lists warned users */ -- cgit v1.2.1 From cbece78f7b180253af95071ab859c468ed061ff5 Mon Sep 17 00:00:00 2001 From: Graham Eames Date: Sat, 23 Sep 2006 12:27:51 +0000 Subject: A reworking of how we handle inactive users git-svn-id: file:///svn/phpbb/trunk@6394 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_admin.php | 46 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 'phpBB/includes/functions_admin.php') diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 2f2e333c78..1d5ec9ee68 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -2330,6 +2330,52 @@ function update_foes() unset($perms); } +/** +* Lists inactive users +*/ +function view_inactive_users(&$users, &$user_count, $limit = 0, $offset = 0, $limit_days = 0, $sort_by = 'user_inactive_time DESC') +{ + global $db, $user; + + $sql = 'SELECT user_id, username, user_regdate, user_lastvisit, user_inactive_time, user_inactive_reason + FROM ' . USERS_TABLE . ' + WHERE user_type = ' . USER_INACTIVE . + (($limit_days) ? "AND user_inactive_time >= $limit_days" : '') . " + ORDER BY $sort_by"; + $result = $db->sql_query_limit($sql, $limit, $offset); + + while ($row = $db->sql_fetchrow($result)) + { + $row['inactive_reason'] = $user->lang['INACTIVE_REASON_UNKNOWN']; + switch ($row['user_inactive_reason']) + { + case INACTIVE_REGISTER: + $row['inactive_reason'] = $user->lang['INACTIVE_REASON_REGISTER']; + break; + + case INACTIVE_PROFILE: + $row['inactive_reason'] = $user->lang['INACTIVE_REASON_PROFILE']; + break; + + case INACTIVE_MANUAL: + $row['inactive_reason'] = $user->lang['INACTIVE_REASON_MANUAL']; + break; + } + + $users[] = $row; + } + + $sql = 'SELECT count(user_id) AS user_count + FROM ' . USERS_TABLE . ' + WHERE user_type = ' . USER_INACTIVE . + (($limit_days) ? "AND user_inactive_time >= $limit_days" : ''); + $result = $db->sql_query($sql); + $user_count = (int) $db->sql_fetchfield('user_count'); + $db->sql_freeresult($result); + + return; +} + /** * Lists warned users */ -- cgit v1.2.1 From 734492958eaa2f193db304fd5d4cf050390eff1a Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 26 Sep 2006 19:59:41 +0000 Subject: These changes should let olympus scale a little bit better. i haven't adjusted the schemas but added the details to create_schema_files - david is able to build them then in line with his changes. :) git-svn-id: file:///svn/phpbb/trunk@6411 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_admin.php | 43 ++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 20 deletions(-) (limited to 'phpBB/includes/functions_admin.php') diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 1d5ec9ee68..7ce428a2b7 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -1388,6 +1388,8 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, break; } + $forum_ids = array_values($forum_ids); + // 2: Get topic counts for each forum $sql = 'SELECT forum_id, topic_approved, COUNT(topic_id) AS forum_topics FROM ' . TOPICS_TABLE . ' @@ -1408,16 +1410,27 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, $db->sql_freeresult($result); // 3: Get post count and last_post_id for each forum - $sql = 'SELECT forum_id, COUNT(post_id) AS forum_posts, MAX(post_id) AS last_post_id - FROM ' . POSTS_TABLE . ' - WHERE ' . $db->sql_in_set('forum_id', $forum_ids) . ' - AND post_approved = 1 - GROUP BY forum_id'; + if (sizeof($forum_ids) == 1) + { + $sql = 'SELECT COUNT(post_id) AS forum_posts, MAX(post_id) AS last_post_id + FROM ' . POSTS_TABLE . ' + WHERE ' . $db->sql_in_set('forum_id', $forum_ids) . ' + AND post_approved = 1'; + } + else + { + $sql = 'SELECT forum_id, COUNT(post_id) AS forum_posts, MAX(post_id) AS last_post_id + FROM ' . POSTS_TABLE . ' + WHERE ' . $db->sql_in_set('forum_id', $forum_ids) . ' + AND post_approved = 1 + GROUP BY forum_id'; + } + $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { - $forum_id = (int) $row['forum_id']; + $forum_id = (sizeof($forum_ids) == 1) ? (int) $forum_ids[0] : (int) $row['forum_id']; $forum_data[$forum_id]['posts'] = (int) $row['forum_posts']; $forum_data[$forum_id]['last_post_id'] = (int) $row['last_post_id']; @@ -1519,6 +1532,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, $topic_id = (int) $row['topic_id']; $topic_data[$topic_id] = $row; $topic_data[$topic_id]['replies_real'] = -1; + $topic_data[$topic_id]['replies'] = 0; $topic_data[$topic_id]['first_post_id'] = 0; $topic_data[$topic_id]['last_post_id'] = 0; unset($topic_data[$topic_id]['topic_id']); @@ -1538,19 +1552,8 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, // NOTE: 't.post_approved' in the GROUP BY is causing a major slowdown. $sql = 'SELECT t.topic_id, t.post_approved, COUNT(t.post_id) AS total_posts, MIN(t.post_id) AS first_post_id, MAX(t.post_id) AS last_post_id FROM ' . POSTS_TABLE . " t - $where_sql"; - - switch (SQL_LAYER) - { - case 'mssql': - case 'mssql_odbc': - $sql .= ' GROUP BY t.topic_id, t.post_approved'; - break; - - default: - $sql .= ' GROUP BY t.topic_id'; - break; - } + $where_sql + GROUP BY t.topic_id, t.post_approved"; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) @@ -1755,7 +1758,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, // batch processing. if ($resync_parents && sizeof($resync_forums) && $where_type != 'range') { - sync('forum', 'forum_id', $resync_forums, true); + sync('forum', 'forum_id', array_values($resync_forums), true); } break; } -- cgit v1.2.1 From b08c54f35eb85d0ccd01c65e1d9460603fc1c076 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 30 Sep 2006 14:58:05 +0000 Subject: - fixing a bug i am unsure about when it occurs (but it occurs). The symptoms are broken template cache files if after removing unnecessary php opening/closing tags result in statements being syntactially incorrect. - added real syncing to forums acp (not only forum statistics rebuild) git-svn-id: file:///svn/phpbb/trunk@6419 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_admin.php | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) (limited to 'phpBB/includes/functions_admin.php') diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 7ce428a2b7..27e271dbb7 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -1068,14 +1068,33 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, } else { - if (!sizeof($where_ids)) + if (!$where_type) { - return; + $where_sql = ''; + $where_sql_and = 'WHERE'; + } + else if ($where_type == 'range') + { + // Only check a range of topics/forums. For instance: 'topic_id BETWEEN 1 AND 60' + $where_sql = 'WHERE (' . $mode{0} . ".$where_ids)"; + $where_sql_and = $where_sql . "\n\tAND"; } + else + { + // Do not sync the "global forum" + $where_ids = array_diff($where_ids, array(0)); - // $where_type contains the field for the where clause (forum_id, topic_id) - $where_sql = 'WHERE ' . $db->sql_in_set($mode{0} . '.' . $where_type, $where_ids); - $where_sql_and = $where_sql . "\n\tAND"; + if (!sizeof($where_ids)) + { + // Empty array with IDs. This means that we don't have any work to do. Just return. + return; + } + + // Limit the topics/forums we are syncing, use specific topic/forum IDs. + // $where_type contains the field for the where clause (forum_id, topic_id) + $where_sql = 'WHERE ' . $db->sql_in_set($mode{0} . '.' . $where_type, $where_ids); + $where_sql_and = $where_sql . "\n\tAND"; + } } switch ($mode) @@ -1129,7 +1148,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, $where_sql_and t.topic_first_post_id = p.post_id"; $db->sql_query($sql); break; - + default: $sql = 'SELECT t.topic_id, p.post_approved FROM ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . " p -- cgit v1.2.1 From 4c2e2b83c7b1c60e5fdf5cf82329a7fb3549bd5a Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 30 Sep 2006 15:06:03 +0000 Subject: just realizing that it is better to limit the uses of RANGE. git-svn-id: file:///svn/phpbb/trunk@6420 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_admin.php | 31 ++++++------------------------- 1 file changed, 6 insertions(+), 25 deletions(-) (limited to 'phpBB/includes/functions_admin.php') diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 27e271dbb7..b346e09a2b 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -1036,7 +1036,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, $where_ids = ($where_ids) ? array((int) $where_ids) : array(); } - if ($mode == 'forum' || $mode == 'topic') + if ($mode == 'forum' || $mode == 'topic' || $mode == 'topic_approved') { if (!$where_type) { @@ -1068,33 +1068,14 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, } else { - if (!$where_type) + if (!sizeof($where_ids)) { - $where_sql = ''; - $where_sql_and = 'WHERE'; - } - else if ($where_type == 'range') - { - // Only check a range of topics/forums. For instance: 'topic_id BETWEEN 1 AND 60' - $where_sql = 'WHERE (' . $mode{0} . ".$where_ids)"; - $where_sql_and = $where_sql . "\n\tAND"; + return; } - else - { - // Do not sync the "global forum" - $where_ids = array_diff($where_ids, array(0)); - - if (!sizeof($where_ids)) - { - // Empty array with IDs. This means that we don't have any work to do. Just return. - return; - } - // Limit the topics/forums we are syncing, use specific topic/forum IDs. - // $where_type contains the field for the where clause (forum_id, topic_id) - $where_sql = 'WHERE ' . $db->sql_in_set($mode{0} . '.' . $where_type, $where_ids); - $where_sql_and = $where_sql . "\n\tAND"; - } + // $where_type contains the field for the where clause (forum_id, topic_id) + $where_sql = 'WHERE ' . $db->sql_in_set($mode{0} . '.' . $where_type, $where_ids); + $where_sql_and = $where_sql . "\n\tAND"; } switch ($mode) -- cgit v1.2.1 From 5284f321789b5d0456b48a529ed59a99956020e8 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 3 Oct 2006 18:35:59 +0000 Subject: - extend config checking to include check for writeable path - removed not utilized user_allow_email column from schema - removed inactive groups (they had no use at all, since inactive users are not able to login) The only benefit those brought are distinguish users - but this is no longer needed too due to the inactive code present. This also allows us to retain group memberships as well as default settings for users being set inactive due to profile changes. - rewrote user_active_flip to support multiple users and a mode, as well as coping with the aforementioned changes - implemented updated jabber class to support SRV server records and for better jabberd2 support. - jabber errors now logged to the error log with a full transaction - fixed user_delete calls to include usernames where possible and also update last post information correctly - implemented additioal checks to user management to cope with common mistakes - On installation, guess the required mysql schema as best as possible. Users now only need to decide if they want to use the mysqli extension or not (mysqli selected by default) and no longer need to know their mysql version. - founders do not need to re-activate their account on profile changes - remove older session if re-authentication was successful (re-authentication always assigns a new session id) - set the cookie directly instead of using php's function - added inactive_remind to see which users got deactivated because of reminders (or re-activation) sent out hopefully not introduced too many bugs - those testing with CVS releases, please concentrate on user registration, activation, profile changes (email/password)... git-svn-id: file:///svn/phpbb/trunk@6436 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_admin.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'phpBB/includes/functions_admin.php') diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index b346e09a2b..2119b86740 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -207,7 +207,7 @@ function group_select_options($group_id, $exclude_ids = false) global $db, $user, $config; $exclude_sql = ($exclude_ids !== false && sizeof($exclude_ids)) ? 'WHERE ' . $db->sql_in_set('group_id', array_map('intval', $exclude_ids), true) : ''; - $sql_and = (!$config['coppa_enable']) ? (($exclude_sql) ? ' AND ' : ' WHERE ') . "group_name NOT IN ('INACTIVE_COPPA', 'REGISTERED_COPPA')" : ''; + $sql_and = (!$config['coppa_enable']) ? (($exclude_sql) ? ' AND ' : ' WHERE ') . "group_name <> 'REGISTERED_COPPA'" : ''; $sql = 'SELECT group_id, group_name, group_type FROM ' . GROUPS_TABLE . " @@ -245,6 +245,7 @@ function get_forum_list($acl_list = 'f_list', $id_only = true, $postable_only = ORDER BY left_id ASC'; $result = $db->sql_query($sql, $expire_time); + $forum_rows = array(); while ($row = $db->sql_fetchrow($result)) { $forum_rows[] = $row; @@ -2343,7 +2344,7 @@ function view_inactive_users(&$users, &$user_count, $limit = 0, $offset = 0, $li $sql = 'SELECT user_id, username, user_regdate, user_lastvisit, user_inactive_time, user_inactive_reason FROM ' . USERS_TABLE . ' WHERE user_type = ' . USER_INACTIVE . - (($limit_days) ? "AND user_inactive_time >= $limit_days" : '') . " + (($limit_days) ? " AND user_inactive_time >= $limit_days" : '') . " ORDER BY $sort_by"; $result = $db->sql_query_limit($sql, $limit, $offset); @@ -2363,15 +2364,19 @@ function view_inactive_users(&$users, &$user_count, $limit = 0, $offset = 0, $li case INACTIVE_MANUAL: $row['inactive_reason'] = $user->lang['INACTIVE_REASON_MANUAL']; break; + + case INACTIVE_REMIND: + $row['inactive_reason'] = $user->lang['INACTIVE_REASON_REMIND']; + break; } $users[] = $row; } - $sql = 'SELECT count(user_id) AS user_count + $sql = 'SELECT COUNT(user_id) AS user_count FROM ' . USERS_TABLE . ' WHERE user_type = ' . USER_INACTIVE . - (($limit_days) ? "AND user_inactive_time >= $limit_days" : ''); + (($limit_days) ? " AND user_inactive_time >= $limit_days" : ''); $result = $db->sql_query($sql); $user_count = (int) $db->sql_fetchfield('user_count'); $db->sql_freeresult($result); -- cgit v1.2.1 From 485935e1f1a3a773260cda0b7ac3f3800dca990e Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 7 Oct 2006 17:40:07 +0000 Subject: he braces style is deprecated as of PHP 6 git-svn-id: file:///svn/phpbb/trunk@6459 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_admin.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'phpBB/includes/functions_admin.php') diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 2119b86740..5bd6384f34 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -347,7 +347,7 @@ function filelist($rootdir, $dir = '', $type = 'gif|jpg|jpeg|png') $matches[$dir][] = $fname; } } - else if ($fname{0} != '.' && is_dir("$rootdir$dir$fname")) + else if ($fname[0] != '.' && is_dir("$rootdir$dir$fname")) { $matches += filelist($rootdir, "$dir$fname", $type); } @@ -1047,7 +1047,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, else if ($where_type == 'range') { // Only check a range of topics/forums. For instance: 'topic_id BETWEEN 1 AND 60' - $where_sql = 'WHERE (' . $mode{0} . ".$where_ids)"; + $where_sql = 'WHERE (' . $mode[0] . ".$where_ids)"; $where_sql_and = $where_sql . "\n\tAND"; } else @@ -1063,7 +1063,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, // Limit the topics/forums we are syncing, use specific topic/forum IDs. // $where_type contains the field for the where clause (forum_id, topic_id) - $where_sql = 'WHERE ' . $db->sql_in_set($mode{0} . '.' . $where_type, $where_ids); + $where_sql = 'WHERE ' . $db->sql_in_set($mode[0] . '.' . $where_type, $where_ids); $where_sql_and = $where_sql . "\n\tAND"; } } @@ -1075,7 +1075,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, } // $where_type contains the field for the where clause (forum_id, topic_id) - $where_sql = 'WHERE ' . $db->sql_in_set($mode{0} . '.' . $where_type, $where_ids); + $where_sql = 'WHERE ' . $db->sql_in_set($mode[0] . '.' . $where_type, $where_ids); $where_sql_and = $where_sql . "\n\tAND"; } -- cgit v1.2.1 From 4afaca12dc55b076293e9ef8ac28332d22730df0 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 14 Oct 2006 14:56:46 +0000 Subject: - store sql_layer directly within the layer itself - new method sql_multi_insert to circumvent db-specific hacks (hopefully not introduced any parsing errors) git-svn-id: file:///svn/phpbb/trunk@6497 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_admin.php | 50 ++++++-------------------------------- 1 file changed, 8 insertions(+), 42 deletions(-) (limited to 'phpBB/includes/functions_admin.php') diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 5bd6384f34..eebd0e2ad5 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -880,7 +880,7 @@ function delete_topic_shadows($max_age, $forum_id = '', $auto_sync = true) { $where = (is_array($forum_id)) ? 'AND ' . $db->sql_in_set('t.forum_id', array_map('intval', $forum_id)) : (($forum_id) ? 'AND t.forum_id = ' . (int) $forum_id : ''); - switch (SQL_LAYER) + switch ($db->sql_layer) { case 'mysql4': case 'mysqli': @@ -971,24 +971,7 @@ function update_posted_info(&$topic_ids) } unset($posted); - if (sizeof($sql_ary)) - { - switch (SQL_LAYER) - { - case 'mysql': - case 'mysql4': - case 'mysqli': - $db->sql_query('INSERT INTO ' . TOPICS_POSTED_TABLE . ' ' . $db->sql_build_array('MULTI_INSERT', $sql_ary)); - break; - - default: - foreach ($sql_ary as $ary) - { - $db->sql_query('INSERT INTO ' . TOPICS_POSTED_TABLE . ' ' . $db->sql_build_array('INSERT', $ary)); - } - break; - } - } + $db->sql_multi_insert(TOPICS_POSTED_TABLE, $sql_ary); } /** @@ -1082,7 +1065,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, switch ($mode) { case 'topic_moved': - switch (SQL_LAYER) + switch ($db->sql_layer) { case 'mysql4': case 'mysqli': @@ -1121,7 +1104,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, break; case 'topic_approved': - switch (SQL_LAYER) + switch ($db->sql_layer) { case 'mysql4': case 'mysqli': @@ -1956,7 +1939,7 @@ function cache_moderators() $cache->destroy('sql', MODERATOR_CACHE_TABLE); // Clear table - $db->sql_query(((SQL_LAYER != 'sqlite') ? 'TRUNCATE TABLE ' : 'DELETE FROM ') . MODERATOR_CACHE_TABLE); + $db->sql_query((($db->sql_layer != 'sqlite') ? 'TRUNCATE TABLE ' : 'DELETE FROM ') . MODERATOR_CACHE_TABLE); // We add moderators who have forum moderator permissions without an explicit ACL_NEVER setting $hold_ary = $ug_id_ary = $sql_ary = array(); @@ -1994,7 +1977,7 @@ function cache_moderators() AND ' . $db->sql_in_set('ug.user_id', $ug_id_ary) . " AND ug.user_pending = 0 AND o.auth_option LIKE 'm\_%'" . - ((SQL_LAYER == 'mssql' || SQL_LAYER == 'mssql_odbc') ? " ESCAPE '\\'" : ''), + (($db->sql_layer == 'mssql' || $db->sql_layer == 'mssql_odbc') ? " ESCAPE '\\'" : ''), )); $result = $db->sql_query($sql); @@ -2093,24 +2076,7 @@ function cache_moderators() } } - if (sizeof($sql_ary)) - { - switch (SQL_LAYER) - { - case 'mysql': - case 'mysql4': - case 'mysqli': - $db->sql_query('INSERT INTO ' . MODERATOR_CACHE_TABLE . ' ' . $db->sql_build_array('MULTI_INSERT', $sql_ary)); - break; - - default: - foreach ($sql_ary as $ary) - { - $db->sql_query('INSERT INTO ' . MODERATOR_CACHE_TABLE . ' ' . $db->sql_build_array('INSERT', $ary)); - } - break; - } - } + $db->sql_multi_insert(MODERATOR_CACHE_TABLE, $sql_ary); } /** @@ -2422,7 +2388,7 @@ function get_database_size() $database_size = false; // This code is heavily influenced by a similar routine in phpMyAdmin 2.2.0 - switch (SQL_LAYER) + switch ($db->sql_layer) { case 'mysql': case 'mysql4': -- cgit v1.2.1 From fcd9b898f156b9b0269a2d2108b9d83660b791d0 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Thu, 19 Oct 2006 13:55:48 +0000 Subject: Revised attachment categories a bit Fixes for the following bugs: #4830 #4818 #4816 #4810 #4808 #4798 #4796 #4772 #4662 #4646 #4546 #4524 #4270 I hope not having introduced additional severe errors :) git-svn-id: file:///svn/phpbb/trunk@6511 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_admin.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'phpBB/includes/functions_admin.php') diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index eebd0e2ad5..ceb14d42e1 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -2006,6 +2006,12 @@ function cache_moderators() foreach ($hold_ary as $user_id => $forum_id_ary) { + // Do not continue if user does not exist + if (!isset($usernames_ary[$user_id])) + { + continue; + } + foreach ($forum_id_ary as $forum_id => $auth_ary) { $sql_ary[] = array( @@ -2047,6 +2053,12 @@ function cache_moderators() foreach ($hold_ary as $group_id => $forum_id_ary) { + // If there is no group, we do not assign it... + if (!isset($groupnames_ary[$group_id])) + { + continue; + } + foreach ($forum_id_ary as $forum_id => $auth_ary) { $flag = false; -- cgit v1.2.1 From 12c75a0991a59eecd274eb2b03476e80ae608eaa Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Mon, 30 Oct 2006 19:51:56 +0000 Subject: - temporarily disable x-sendfile support (we need to look into methods of checking if it is enabled/disabled or introducing a switch) - finally allow custom permission settings files (in acp/ as well as in mods/) git-svn-id: file:///svn/phpbb/trunk@6539 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_admin.php | 39 +++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) (limited to 'phpBB/includes/functions_admin.php') diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index ceb14d42e1..70c5b2bae3 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -2608,9 +2608,46 @@ function tidy_database() { global $db; + set_config('database_last_gc', time(), true); +} +/** +* Add permission language - this will make sure custom files will be included +*/ +function add_permission_language() +{ + global $user, $phpEx; - set_config('database_last_gc', time(), true); + // First of all, our own file. + $user->add_lang('acp/permissions_phpbb'); + + $files_to_add = array(); + + // Now search in acp and mods folder for permissions_ files. + foreach (array('acp/', 'mods/') as $path) + { + $dh = opendir($user->lang_path . $path); + + if ($dh !== false) + { + while (($file = readdir($dh)) !== false) + { + if (strpos($file, 'permissions_') === 0 && strpos($file, 'permissions_phpbb') === false && substr($file, -(strlen($phpEx) + 1)) === '.' . $phpEx) + { + $files_to_add[] = $path . substr($file, 0, -(strlen($phpEx) + 1)); + } + } + closedir($dh); + } + } + + if (!sizeof($files_to_add)) + { + return false; + } + + $user->add_lang($files_to_add); + return true; } ?> \ No newline at end of file -- cgit v1.2.1 From 8b0ec6e02d5a53ea3d1b87abd122d39cc3e8366f Mon Sep 17 00:00:00 2001 From: David M Date: Fri, 3 Nov 2006 23:09:16 +0000 Subject: - compress is nicer (fixed a bug :P) - UTF-8 code is nicer (fixed a bug :P) - new CAPTCHA. Replaced the old one for size and usability issues. The old CAPTCHA will most likely be released as a separate package git-svn-id: file:///svn/phpbb/trunk@6549 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_admin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes/functions_admin.php') diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 70c5b2bae3..c85802dafb 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -2430,7 +2430,7 @@ function get_database_size() { if ($table_prefix != '') { - if (strstr($row['Name'], $table_prefix)) + if (strpos($row['Name'], $table_prefix) !== false) { $database_size += $row['Data_length'] + $row['Index_length']; } -- cgit v1.2.1