From fc32df035889dd74f2cfc1c62bb793d36f333ec2 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 9 Apr 2005 12:26:45 +0000 Subject: [PATCH] - Documentation related changes - added resend activation email dialog - fixed issue in session code - log failed/successful admin re-authentication/login - fixed simple forum dropdown box (used in mcp and posting) git-svn-id: file:///svn/phpbb/trunk@5114 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/admin_attachments.php | 44 ++-- phpBB/adm/admin_ban.php | 21 +- phpBB/adm/admin_bbcodes.php | 21 +- phpBB/adm/admin_board.php | 21 +- phpBB/adm/admin_bots.php | 21 +- phpBB/adm/admin_database.php | 21 +- phpBB/adm/admin_disallow.php | 29 +-- phpBB/adm/admin_email.php | 26 +- phpBB/adm/admin_forums.php | 25 +- phpBB/adm/admin_groups.php | 27 +-- phpBB/adm/admin_icons.php | 21 +- phpBB/adm/admin_jabber.php | 25 +- phpBB/adm/admin_language.php | 22 +- phpBB/adm/admin_permissions.php | 21 +- phpBB/adm/admin_phpinfo.php | 29 +-- phpBB/adm/admin_profile.php | 22 +- phpBB/adm/admin_prune.php | 21 +- phpBB/adm/admin_prune_users.php | 29 +-- phpBB/adm/admin_ranks.php | 29 +-- phpBB/adm/admin_search.php | 29 +-- phpBB/adm/admin_styles.php | 22 +- phpBB/adm/admin_users.php | 26 +- phpBB/adm/admin_viewlogs.php | 53 +++-- phpBB/adm/admin_words.php | 21 +- phpBB/adm/index.php | 77 +++--- phpBB/adm/pagestart.php | 26 +- phpBB/common.php | 22 +- phpBB/download.php | 45 ++-- phpBB/faq.php | 21 +- phpBB/includes/acm/acm_db.php | 23 +- phpBB/includes/acm/acm_file.php | 23 +- phpBB/includes/auth/auth_apache.php | 32 ++- phpBB/includes/auth/auth_db.php | 30 ++- phpBB/includes/auth/auth_ldap.php | 51 ++-- phpBB/includes/bbcode.php | 26 +- phpBB/includes/db/db2.php | 34 ++- phpBB/includes/db/firebird.php | 27 ++- phpBB/includes/db/mssql-odbc.php | 27 ++- phpBB/includes/db/mssql.php | 35 ++- phpBB/includes/db/mysql.php | 27 ++- phpBB/includes/db/mysql4.php | 29 ++- phpBB/includes/db/oracle.php | 34 ++- phpBB/includes/db/postgres.php | 35 ++- phpBB/includes/db/sqlite.php | 34 ++- phpBB/includes/functions.php | 222 ++++++++++++----- phpBB/includes/functions_admin.php | 223 +++++++++++------- phpBB/includes/functions_compress.php | 51 ++-- phpBB/includes/functions_display.php | 35 ++- phpBB/includes/functions_jabber.php | 61 ++--- phpBB/includes/functions_messenger.php | 61 +++-- phpBB/includes/functions_module.php | 25 +- phpBB/includes/functions_posting.php | 84 ++++--- phpBB/includes/functions_privmsgs.php | 75 +++--- phpBB/includes/functions_profile_fields.php | 27 ++- phpBB/includes/functions_upload.php | 50 ++-- phpBB/includes/functions_user.php | 135 +++++++---- phpBB/includes/mcp/mcp_forum.php | 29 ++- phpBB/includes/mcp/mcp_front.php | 29 +-- phpBB/includes/mcp/mcp_main.php | 51 ++-- phpBB/includes/mcp/mcp_post.php | 22 +- phpBB/includes/mcp/mcp_queue.php | 38 ++- phpBB/includes/mcp/mcp_topic.php | 33 +-- phpBB/includes/message_parser.php | 47 ++-- phpBB/includes/search/fulltext_mysql.php | 24 +- phpBB/includes/search/fulltext_phpbb.php | 24 +- phpBB/includes/session.php | 39 +-- phpBB/includes/template.php | 155 ++++++------ phpBB/includes/ucp/ucp_activate.php | 28 ++- phpBB/includes/ucp/ucp_attachments.php | 28 +-- phpBB/includes/ucp/ucp_confirm.php | 38 +-- phpBB/includes/ucp/ucp_groups.php | 23 +- phpBB/includes/ucp/ucp_main.php | 24 +- phpBB/includes/ucp/ucp_pm.php | 77 +++--- phpBB/includes/ucp/ucp_pm_compose.php | 37 +-- phpBB/includes/ucp/ucp_pm_options.php | 37 ++- phpBB/includes/ucp/ucp_pm_viewfolder.php | 32 +-- phpBB/includes/ucp/ucp_pm_viewmessage.php | 30 ++- phpBB/includes/ucp/ucp_prefs.php | 24 +- phpBB/includes/ucp/ucp_profile.php | 26 +- phpBB/includes/ucp/ucp_register.php | 28 ++- phpBB/includes/ucp/ucp_remind.php | 29 ++- phpBB/includes/ucp/ucp_zebra.php | 23 +- phpBB/index.php | 21 +- phpBB/install/install.php | 21 +- phpBB/language/en/admin.php | 30 +-- phpBB/language/en/common.php | 45 ++-- .../en/email/user_resend_inactive.txt | 21 ++ phpBB/language/en/groups.php | 25 +- phpBB/language/en/help_bbcode.php | 24 +- phpBB/language/en/help_faq.php | 24 +- phpBB/language/en/mcp.php | 26 +- phpBB/language/en/memberlist.php | 25 +- phpBB/language/en/posting.php | 25 +- phpBB/language/en/search.php | 25 +- phpBB/language/en/ucp.php | 29 ++- phpBB/language/en/viewforum.php | 25 +- phpBB/language/en/viewtopic.php | 25 +- phpBB/mcp.php | 60 +++-- phpBB/memberlist.php | 57 ++--- phpBB/posting.php | 37 ++- phpBB/report.php | 26 +- phpBB/search.php | 31 ++- phpBB/style.php | 21 +- .../styles/subSilver/template/login_body.html | 6 +- .../subSilver/template/ucp_agreement.html | 4 +- .../styles/subSilver/template/ucp_resend.html | 22 ++ phpBB/ucp.php | 63 ++--- phpBB/viewforum.php | 21 +- phpBB/viewonline.php | 21 +- phpBB/viewtopic.php | 21 +- 110 files changed, 2212 insertions(+), 1877 deletions(-) create mode 100644 phpBB/language/en/email/user_resend_inactive.txt create mode 100644 phpBB/styles/subSilver/template/ucp_resend.html diff --git a/phpBB/adm/admin_attachments.php b/phpBB/adm/admin_attachments.php index cb4b2e3464..a438b16f65 100644 --- a/phpBB/adm/admin_attachments.php +++ b/phpBB/adm/admin_attachments.php @@ -1,16 +1,15 @@ lang['UPLOAD_DIR']; ?>:
lang['UPLOAD_DIR_EXPLAIN']; ?> - + lang['DISPLAY_ORDER']; ?>:
lang['DISPLAY_ORDER_EXPLAIN']; ?> @@ -1188,10 +1187,10 @@ if ($mode == 'orphan') { $attach_filelist = array(); - $dir = @opendir($phpbb_root_path . $config['upload_dir']); + $dir = @opendir($phpbb_root_path . $config['upload_path']); while ($file = @readdir($dir)) { - if (is_file($phpbb_root_path . $config['upload_dir'] . '/' . $file) && filesize($phpbb_root_path . $config['upload_dir'] . '/' . $file) && $file{0} != '.' && $file != 'index.htm' && !preg_match('#^thumb\_#', $file)) + if (is_file($phpbb_root_path . $config['upload_path'] . '/' . $file) && filesize($phpbb_root_path . $config['upload_path'] . '/' . $file) && $file{0} != '.' && $file != 'index.htm' && !preg_match('#^thumb\_#', $file)) { $attach_filelist[$file] = $file; } @@ -1243,12 +1242,12 @@ function marklist(match, name, status) foreach ($attach_filelist as $file) { $row_class = (++$i % 2 == 0) ? 'row2' : 'row1'; - $filesize = @filesize($phpbb_root_path . $config['upload_dir'] . '/' . $file); + $filesize = @filesize($phpbb_root_path . $config['upload_path'] . '/' . $file); $size_lang = ($filesize >= 1048576) ? $user->lang['MB'] : ( ($filesize >= 1024) ? $user->lang['KB'] : $user->lang['BYTES'] ); $filesize = ($filesize >= 1048576) ? round((round($filesize / 1048576 * 100) / 100), 2) : (($filesize >= 1024) ? round((round($filesize / 1024 * 100) / 100), 2) : $filesize); ?> - + ID: @@ -1399,7 +1398,7 @@ function download_select($select_name, $group_id = false) return $group_select; } -// Upload already uploaded file... huh? are you kidding? +/* Upload already uploaded file... huh? are you kidding? function upload_file($post_id, $topic_id, $forum_id, $upload_dir, $filename) { global $message_parser, $db, $user, $phpbb_root_path; @@ -1418,8 +1417,8 @@ function upload_file($post_id, $topic_id, $forum_id, $upload_dir, $filename) 'poster_id' => $user->data['user_id'], 'topic_id' => $topic_id, 'in_message' => 0, - 'physical_filename' => $filedata['destination_filename'], - 'real_filename' => $filedata['filename'], + 'physical_filename' => $filedata['physical_filename'], + 'real_filename' => $filedata['real_filename'], 'comment' => $message_parser->filename_data['filecomment'], 'extension' => $filedata['extension'], 'mimetype' => $filedata['mimetype'], @@ -1459,6 +1458,7 @@ function upload_file($post_id, $topic_id, $forum_id, $upload_dir, $filename) echo '' . sprintf($user->lang['ADMIN_UPLOAD_ERROR'], implode("
\t", $filedata['error'])) . '


'; } } +*/ // Search Imagick function search_imagemagick() @@ -1551,7 +1551,7 @@ function perform_site_list() $ip_2_counter = ($ip_1_counter == $ip_range_explode[1]) ? $ip_range_explode[2] : 0; $ip_2_end = ($ip_1_counter < $ip_1_end) ? 254 : $ip_range_explode[6]; - if($ip_2_counter == 0 && $ip_2_end == 254) + if ($ip_2_counter == 0 && $ip_2_end == 254) { $ip_2_counter = 256; $ip_2_fragment = 256; diff --git a/phpBB/adm/admin_ban.php b/phpBB/adm/admin_ban.php index ceeaac724e..7265ea701e 100644 --- a/phpBB/adm/admin_ban.php +++ b/phpBB/adm/admin_ban.php @@ -1,16 +1,15 @@ acl_get('a_ban')) diff --git a/phpBB/adm/admin_bbcodes.php b/phpBB/adm/admin_bbcodes.php index e0977e094e..ebd82675aa 100644 --- a/phpBB/adm/admin_bbcodes.php +++ b/phpBB/adm/admin_bbcodes.php @@ -1,16 +1,15 @@ acl_get('a_bbcode')) diff --git a/phpBB/adm/admin_board.php b/phpBB/adm/admin_board.php index 2a2f2a53bc..8646577b59 100644 --- a/phpBB/adm/admin_board.php +++ b/phpBB/adm/admin_board.php @@ -1,16 +1,15 @@ acl_get('a_server')) diff --git a/phpBB/adm/admin_database.php b/phpBB/adm/admin_database.php index 6d217fbafc..ca4cf7db9b 100644 --- a/phpBB/adm/admin_database.php +++ b/phpBB/adm/admin_database.php @@ -1,16 +1,15 @@ acl_get('a_names')) diff --git a/phpBB/adm/admin_email.php b/phpBB/adm/admin_email.php index 1f2f02059f..7c4f827d1b 100644 --- a/phpBB/adm/admin_email.php +++ b/phpBB/adm/admin_email.php @@ -1,16 +1,15 @@ queue) - { - $messenger->queue->save(); - } + $messenger->save_queue(); if ($group_id) { diff --git a/phpBB/adm/admin_forums.php b/phpBB/adm/admin_forums.php index 2315799c99..5ec50c9832 100644 --- a/phpBB/adm/admin_forums.php +++ b/phpBB/adm/admin_forums.php @@ -1,22 +1,15 @@ acl_gets('a_forum', 'a_forumadd', 'a_forumdel')) diff --git a/phpBB/adm/admin_groups.php b/phpBB/adm/admin_groups.php index 91dfe2f988..ae61af33f9 100644 --- a/phpBB/adm/admin_groups.php +++ b/phpBB/adm/admin_groups.php @@ -1,20 +1,17 @@ acl_get('a_group')) diff --git a/phpBB/adm/admin_icons.php b/phpBB/adm/admin_icons.php index 8c54bb6091..be4c18a617 100644 --- a/phpBB/adm/admin_icons.php +++ b/phpBB/adm/admin_icons.php @@ -1,16 +1,15 @@ acl_get('a_icons')) diff --git a/phpBB/adm/admin_jabber.php b/phpBB/adm/admin_jabber.php index 5fe25f459f..4ae0fc583c 100644 --- a/phpBB/adm/admin_jabber.php +++ b/phpBB/adm/admin_jabber.php @@ -1,19 +1,16 @@ acl_get('a_server')) diff --git a/phpBB/adm/admin_language.php b/phpBB/adm/admin_language.php index eb99c67e6f..50f810d98e 100644 --- a/phpBB/adm/admin_language.php +++ b/phpBB/adm/admin_language.php @@ -1,15 +1,15 @@ acl_get('a_server')) ? basename(__FILE__) . $SID : ''; diff --git a/phpBB/adm/admin_profile.php b/phpBB/adm/admin_profile.php index 482befc3b4..48c25c875a 100644 --- a/phpBB/adm/admin_profile.php +++ b/phpBB/adm/admin_profile.php @@ -1,15 +1,15 @@ acl_get('a_prune')) diff --git a/phpBB/adm/admin_prune_users.php b/phpBB/adm/admin_prune_users.php index a623ac5476..55f2ca85f4 100644 --- a/phpBB/adm/admin_prune_users.php +++ b/phpBB/adm/admin_prune_users.php @@ -1,24 +1,15 @@ acl_get('a_userdel')) diff --git a/phpBB/adm/admin_ranks.php b/phpBB/adm/admin_ranks.php index 3eba8532a3..3c2c51dd11 100644 --- a/phpBB/adm/admin_ranks.php +++ b/phpBB/adm/admin_ranks.php @@ -1,24 +1,15 @@ acl_get('a_ranks')) diff --git a/phpBB/adm/admin_search.php b/phpBB/adm/admin_search.php index e427b4bd54..9826c51d33 100644 --- a/phpBB/adm/admin_search.php +++ b/phpBB/adm/admin_search.php @@ -1,24 +1,15 @@ acl_get('a_search')) diff --git a/phpBB/adm/admin_styles.php b/phpBB/adm/admin_styles.php index 2800aef021..1d0d746f21 100644 --- a/phpBB/adm/admin_styles.php +++ b/phpBB/adm/admin_styles.php @@ -1,15 +1,15 @@ acl_gets('a_user', 'a_useradd', 'a_userdel')) @@ -321,7 +320,7 @@ e_help = "lang['BBCODE_E_HELP']; ?>"; ); $messenger->send(NOTIFY_EMAIL); - $messenger->queue->save(); + $messenger->save_queue(); add_log('admin', 'LOG_USER_REACTIVATE', $username); add_log('user', $user_id, 'LOG_USER_REACTIVATE_USER'); @@ -2020,7 +2019,7 @@ if (!$auth->acl_get('a_user')) adm_page_footer(); -// Module class +/* Module class class acp_admin_users extends module { @@ -2028,5 +2027,6 @@ class acp_admin_users extends module } +*/ ?> \ No newline at end of file diff --git a/phpBB/adm/admin_viewlogs.php b/phpBB/adm/admin_viewlogs.php index 37034d49fe..f69858f0ed 100644 --- a/phpBB/adm/admin_viewlogs.php +++ b/phpBB/adm/admin_viewlogs.php @@ -1,16 +1,15 @@ acl_get('a_')) @@ -54,10 +53,7 @@ $sort_dir = request_var('sd', 'd'); // Define some vars depending on which logs we're looking at $log_type = ($mode == 'admin') ? LOG_ADMIN : (($mode == 'mod') ? LOG_MOD : LOG_CRITICAL); -if ($log_type == LOG_MOD) -{ - $user->add_lang('mcp'); -} +$user->add_lang('mcp'); // Delete entries if requested and able if (($deletemark || $deleteall) && $auth->acl_get('a_clearlogs')) @@ -125,8 +121,24 @@ if ($mode == 'mod') } +// +// Grab log data +// +$log_data = array(); +$log_count = 0; +view_log($mode, $log_data, $log_count, $config['topics_per_page'], $start, $forum_id, 0, 0, $sql_where, $sql_sort); + ?> + + + + + +
  + +
+ @@ -140,13 +152,6 @@ if ($mode == 'mod') lang['MARK_ALL']; ?> :: lang['UNMARK_ALL']; ?> 

diff --git a/phpBB/adm/admin_words.php b/phpBB/adm/admin_words.php index a13b92e1f6..7f5324592f 100644 --- a/phpBB/adm/admin_words.php +++ b/phpBB/adm/admin_words.php @@ -1,16 +1,15 @@ acl_get('a_words')) diff --git a/phpBB/adm/index.php b/phpBB/adm/index.php index 46054fa74b..c7fd63253b 100644 --- a/phpBB/adm/index.php +++ b/phpBB/adm/index.php @@ -1,16 +1,15 @@ sql_fetchrow($result)); - if ($messenger->queue) - { - $messenger->queue->save(); - } + $messenger->save_queue(); unset($email_list); @@ -283,7 +279,6 @@ elseif ($pane == 'right') add_log('admin', 'LOG_RESYNC_STATS'); break; - // TODO: Temporary or a useful function? case 'user': if (!$auth->acl_get('a_defaults')) { @@ -291,40 +286,37 @@ elseif ($pane == 'right') } $post_count_ary = $auth->acl_getf('f_postcount'); - + $forum_ary = array(); foreach ($post_count_ary as $forum_id => $allowed) { - if ($allowed['f_read'] && $allowed['f_postcount']) + if ($allowed['f_postcount']) { $forum_ary[] = $forum_id; } } - $post_count_sql = (sizeof($forum_ary)) ? 'AND f.forum_id IN (' . implode(', ', $forum_ary) . ')' : ''; - unset($forum_ary, $post_count_ary); - $sql = 'SELECT user_id FROM ' . USERS_TABLE . ' - WHERE user_type NOT IN (' . USER_INACTIVE . ')'; - $result = $db->sql_query($sql); - - while ($user_row = $db->sql_fetchrow($result)) + if (!sizeof($forum_ary)) { - $user_id = (int) $user_row['user_id']; - - $sql = 'SELECT COUNT(p.post_id) AS num_posts - FROM ' . POSTS_TABLE . ' p, ' . FORUMS_TABLE . ' f - WHERE p.poster_id = ' . $user_id . " - AND f.forum_id = p.forum_id - $post_count_sql"; - $result2 = $db->sql_query($sql); - $num_real_posts = (int) $db->sql_fetchfield('num_posts', 0, $result2); - $db->sql_freeresult($result2); - - $db->sql_query('UPDATE ' . USERS_TABLE . " SET user_posts = $num_real_posts WHERE user_id = $user_id"); + $db->sql_query('UPDATE ' . USERS_TABLE . ' SET user_posts = 0'); } - $db->sql_freeresult($result); + else + { + $sql = 'SELECT COUNT(post_id) AS num_posts, poster_id + FROM ' . POSTS_TABLE . ' + WHERE poster_id <> ' . ANONYMOUS . ' + AND forum_id IN (' . implode(', ', $forum_ary) . ') + GROUP BY poster_id'; + $result = $db->sql_query($sql); - add_log('admin', 'LOG_RESYNC_USER'); + while ($row = $db->sql_fetchrow($result)) + { + $db->sql_query('UPDATE ' . USERS_TABLE . " SET user_posts = {$row['num_posts']} WHERE user_id = {$row['poster_id']}"); + } + $db->sql_freeresult($result); + } + + add_log('admin', 'LOG_RESYNC_POSTCOUNTS'); break; case 'date': @@ -333,7 +325,7 @@ elseif ($pane == 'right') trigger_error($user->lang['NO_ADMIN']); } - set_config('board_startdate', time() - 1, true); + set_config('board_startdate', time() - 1); add_log('admin', 'LOG_RESET_DATE'); break; } @@ -537,9 +529,8 @@ elseif ($pane == 'right') - +
lang['DISPLAY_LOG']; ?>:   lang['SORT_BY']; ?>:  
 
   
diff --git a/phpBB/adm/pagestart.php b/phpBB/adm/pagestart.php index 7b1b6e5f78..3567ec32a0 100644 --- a/phpBB/adm/pagestart.php +++ b/phpBB/adm/pagestart.php @@ -1,21 +1,20 @@ \ No newline at end of file diff --git a/phpBB/faq.php b/phpBB/faq.php index d1317663f5..fe54ab3384 100644 --- a/phpBB/faq.php +++ b/phpBB/faq.php @@ -1,16 +1,15 @@ sql_fetchrow($result)) ? $row : false; } -// Create forum rules for given forum +/** +* Create forum rules for given forum +*/ function generate_forum_rules(&$forum_data) { if (!$forum_data['forum_rules'] && !$forum_data['forum_rules_link']) @@ -152,8 +167,10 @@ function generate_forum_rules(&$forum_data) ); } -// Create forum navigation links for given forum, create parent -// list if currently null, assign basic forum info to template +/** +* Create forum navigation links for given forum, create parent +* list if currently null, assign basic forum info to template +*/ function generate_forum_nav(&$forum_data) { global $db, $user, $template, $phpEx, $SID, $phpbb_root_path; @@ -194,7 +211,9 @@ function generate_forum_nav(&$forum_data) return; } -// Returns forum parents as an array. Get them from forum_data if available, or update the database otherwise +/** +* Returns forum parents as an array. Get them from forum_data if available, or update the database otherwise +*/ function get_forum_parents(&$forum_data) { global $db; @@ -234,7 +253,9 @@ function get_forum_parents(&$forum_data) return $forum_parents; } -// Obtain list of moderators of each forum +/** +* Obtain list of moderators of each forum +*/ function get_moderators(&$forum_moderators, $forum_id = false) { global $config, $template, $db, $phpEx, $SID; @@ -270,7 +291,9 @@ function get_moderators(&$forum_moderators, $forum_id = false) return; } -// User authorisation levels output +/** +* User authorisation levels output +*/ function gen_forum_auth_level($mode, $forum_id) { global $SID, $template, $auth, $user; @@ -291,6 +314,9 @@ function gen_forum_auth_level($mode, $forum_id) return; } +/** +* Generate sort selection fields +*/ function gen_sort_selects(&$limit_days, &$sort_by_text, &$sort_days, &$sort_key, &$sort_dir, &$s_limit_days, &$s_sort_key, &$s_sort_dir, &$u_sort_param) { global $user; @@ -326,6 +352,9 @@ function gen_sort_selects(&$limit_days, &$sort_by_text, &$sort_days, &$sort_key, return; } +/** +* Generate Jumpbox +*/ function make_jumpbox($action, $forum_id = false, $select_all = false, $acl_list = false) { global $config, $auth, $template, $user, $db, $phpEx, $SID; @@ -419,7 +448,9 @@ function make_jumpbox($action, $forum_id = false, $select_all = false, $acl_list return; } -// Pick a language, any language ... +/** +* Pick a language, any language ... +*/ function language_select($default = '') { global $db; @@ -440,7 +471,9 @@ function language_select($default = '') return $lang_options; } -// Pick a template/theme combo, +/** +* Pick a template/theme combo, +*/ function style_select($default = '', $all = false) { global $db; @@ -463,7 +496,9 @@ function style_select($default = '', $all = false) return $style_options; } -// Pick a timezone +/** +* Pick a timezone +*/ function tz_select($default = '') { global $sys_timezone, $user; @@ -481,7 +516,9 @@ function tz_select($default = '') return $tz_select; } -// Topic and forum watching common code +/** +* Topic and forum watching common code +*/ function watch_topic_forum($mode, &$s_watching, &$s_watching_img, $user_id, $match_id, $notify_status = 'unset', $start = 0) { global $template, $db, $user, $phpEx, $SID, $start, $phpbb_root_path; @@ -586,7 +623,9 @@ function watch_topic_forum($mode, &$s_watching, &$s_watching_img, $user_id, $mat return; } -// Marks a topic or form as read +/** +* Marks a topic or form as read +*/ function markread($mode, $forum_id = 0, $topic_id = 0, $marktime = false) { global $config, $db, $user; @@ -759,10 +798,11 @@ function markread($mode, $forum_id = 0, $topic_id = 0, $marktime = false) } } - -// Pagination routine, generates page number sequence -// tpl_prefix is for using different pagination blocks at one page -function generate_pagination($base_url, $num_items, $per_page, $start_item, $add_prevnext_text = true, $tpl_prefix = '') +/** +* Pagination routine, generates page number sequence +* tpl_prefix is for using different pagination blocks at one page +*/ +function generate_pagination($base_url, $num_items, $per_page, $start_item, $add_prevnext_text = false, $tpl_prefix = '') { global $template, $user; @@ -813,6 +853,19 @@ function generate_pagination($base_url, $num_items, $per_page, $start_item, $add $page_string .= ($on_page == $total_pages) ? '' . $total_pages . '' : '' . $total_pages . ''; + if ($add_prevnext_text) + { + if ($on_page != 1) + { + $page_string = '' . $user->lang['PREVIOUS'] . '  ' . $page_string; + } + + if ($on_page != $total_pages) + { + $page_string .= '  ' . $user->lang['NEXT'] . ''; + } + } + $template->assign_vars(array( $tpl_prefix . 'BASE_URL' => $base_url, $tpl_prefix . 'PER_PAGE' => $per_page, @@ -824,6 +877,9 @@ function generate_pagination($base_url, $num_items, $per_page, $start_item, $add return $page_string; } +/** +* Return current page (pagination) +*/ function on_page($num_items, $per_page, $start) { global $template, $user; @@ -835,9 +891,10 @@ function on_page($num_items, $per_page, $start) return sprintf($user->lang['PAGE_OF'], $on_page, max(ceil($num_items / $per_page), 1)); } -// Obtain list of naughty words and build preg style replacement arrays for use by the -// calling script, note that the vars are passed as references this just makes it easier -// to return both sets of arrays +/** +* Obtain list of naughty words and build preg style replacement arrays for use by the +* calling script +*/ function obtain_word_list(&$censors) { global $db, $cache, $user; @@ -871,7 +928,9 @@ function obtain_word_list(&$censors) return true; } -// Obtain currently listed icons, re-caching if necessary +/** +* Obtain currently listed icons +*/ function obtain_icons(&$icons) { global $db, $cache; @@ -904,7 +963,9 @@ function obtain_icons(&$icons) return; } -// Obtain ranks +/** +* Obtain ranks +*/ function obtain_ranks(&$ranks) { global $db, $cache; @@ -945,7 +1006,9 @@ function obtain_ranks(&$ranks) } } -// Obtain allowed extensions +/** +* Obtain allowed extensions +*/ function obtain_attach_extensions(&$extensions, $forum_id = false) { global $db, $cache; @@ -1025,6 +1088,9 @@ function obtain_attach_extensions(&$extensions, $forum_id = false) return; } +/** +* Generate board url +*/ function generate_board_url() { global $config; @@ -1034,7 +1100,9 @@ function generate_board_url() return (($config['cookie_secure']) ? 'https://' : 'http://') . preg_replace('#^/?(.*?)/?$#', '\1', trim($config['server_name'])) . (($config['server_port'] <> 80) ? ':' . trim($config['server_port']) : '') . (($path) ? '/' . $path : ''); } -// Redirects the user to another page then exits the script nicely +/** +* Redirects the user to another page then exits the script nicely +*/ function redirect($url) { global $db, $cache, $config, $user; @@ -1072,7 +1140,9 @@ function redirect($url) exit; } -// Meta refresh assignment +/** +* Meta refresh assignment +*/ function meta_refresh($time, $url) { global $template; @@ -1082,7 +1152,9 @@ function meta_refresh($time, $url) ); } -// Build Confirm box +/** +* Build Confirm box +*/ function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_body.html') { global $user, $template, $db; @@ -1159,10 +1231,12 @@ function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_bo page_footer(); } -// Generate login box or verify password +/** +* Generate login box or verify password +*/ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = false, $s_display = true) { - global $SID, $db, $user, $template, $auth, $phpEx, $phpbb_root_path; + global $SID, $db, $user, $template, $auth, $phpEx, $phpbb_root_path, $config; $err = ''; @@ -1177,6 +1251,12 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa // If authentication is successful we redirect user to previous page if (($result = $auth->login($username, $password, $autologin, $viewonline, $admin)) === true) { + // If admin authentication + if ($admin) + { + add_log('admin', 'LOG_ADMIN_AUTH_SUCCESS'); + } + $redirect = request_var('redirect', "index.$phpEx$SID"); meta_refresh(3, $redirect); @@ -1184,6 +1264,11 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa trigger_error($message); } + if ($admin) + { + add_log('admin', 'LOG_ADMIN_AUTH_FAIL'); + } + // If we get a non-numeric (e.g. string) value we output an error if (is_string($result)) { @@ -1191,7 +1276,7 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa } // If we get an integer zero then we are inactive, else the username/password is wrong - $err = ($result === 0) ? $user->lang['ACTIVE_ERROR'] : $user->lang['LOGIN_ERROR']; + $err = ($result === 0) ? $user->lang['ACTIVE_ERROR'] : $user->lang['LOGIN_ERROR']; } if (!$redirect) @@ -1216,9 +1301,10 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa 'LOGIN_ERROR' => $err, 'LOGIN_EXPLAIN' => $l_explain, - 'U_SEND_PASSWORD' => "{$phpbb_root_path}ucp.$phpEx$SID&mode=sendpassword", - 'U_TERMS_USE' => "{$phpbb_root_path}ucp.$phpEx$SID&mode=terms", - 'U_PRIVACY' => "{$phpbb_root_path}ucp.$phpEx$SID&mode=privacy", + 'U_SEND_PASSWORD' => ($config['email_enable']) ? "{$phpbb_root_path}ucp.$phpEx$SID&mode=sendpassword" : '', + 'U_RESEND_ACTIVATION' => ($config['require_activation'] != USER_ACTIVATION_NONE && $config['email_enable']) ? "{$phpbb_root_path}ucp.$phpEx$SID&mode=resend_act" : '', + 'U_TERMS_USE' => "{$phpbb_root_path}ucp.$phpEx$SID&mode=terms", + 'U_PRIVACY' => "{$phpbb_root_path}ucp.$phpEx$SID&mode=privacy", 'S_DISPLAY_FULL_LOGIN' => ($s_display) ? true : false, 'S_LOGIN_ACTION' => (!$admin) ? "{$phpbb_root_path}ucp.$phpEx$SID&mode=login" : "index.$phpEx$SID", @@ -1235,7 +1321,9 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa page_footer(); } -// Generate forum login box +/** +* Generate forum login box +*/ function login_forum_box(&$forum_data) { global $db, $config, $user, $template, $phpEx; @@ -1297,7 +1385,9 @@ function login_forum_box(&$forum_data) page_footer(); } -// Bump Topic Check - used by posting and viewtopic +/** +* Bump Topic Check - used by posting and viewtopic +*/ function bump_topic_allowed($forum_id, $topic_bumped, $last_post_time, $topic_poster, $last_topic_poster) { global $config, $auth, $user; @@ -1327,7 +1417,9 @@ function bump_topic_allowed($forum_id, $topic_bumped, $last_post_time, $topic_po return $bump_time; } -// Censoring +/** +* Censoring +*/ function censor_text($text) { global $censors, $user; @@ -1336,7 +1428,7 @@ function censor_text($text) { $censors = array(); - // For ANONYMOUS, this option should be enabled by default + // TODO: For ANONYMOUS, this option should be enabled by default if ($user->optionget('viewcensors')) { obtain_word_list($censors); @@ -1351,7 +1443,9 @@ function censor_text($text) return $text; } -// Smiley processing +/** +* Smiley processing +*/ function smiley_text($text, $force_option = false) { global $config, $user, $phpbb_root_path; @@ -1359,7 +1453,9 @@ function smiley_text($text, $force_option = false) return ($force_option || !$config['allow_smilies'] || !$user->optionget('viewsmilies')) ? preg_replace('#Another Error: in file $errfile on line $errline: $msg_text
"; - } - } - break;*/ } } -// +/** +* Generate page header +*/ function page_header($page_title = '') { global $db, $config, $template, $SID, $user, $auth, $phpEx, $phpbb_root_path; @@ -1823,6 +1914,9 @@ function page_header($page_title = '') return; } +/** +* Generate page footer +*/ function page_footer() { global $db, $config, $template, $SID, $user, $auth, $cache, $messenger, $starttime, $phpbb_root_path, $phpEx; @@ -1878,4 +1972,4 @@ function page_footer() exit; } -?> +?> \ No newline at end of file diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 57643c8b98..48ada3b9fc 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -1,39 +1,41 @@ sql_query($sql); + + $right = $iteration = 0; $padding_store = array('0' => ''); + $forum_list = $padding = ''; - foreach ($rowset as $row) + // Sometimes it could happen that forums will be displayed here not be displayed within the index page + // This is the result of forums not displayed at index, having list permissions and a parent of a forum with no permissions. + // If this happens, the padding could be "broken" + + while ($row = $db->sql_fetchrow($result)) { - if ((is_array($ignore_id) && in_array($row['forum_id'], $ignore_id)) || - $row['forum_id'] == $ignore_id) - { - continue; - } - if ($row['left_id'] < $right) { - $padding .= '     '; + $padding .= '   '; $padding_store[$row['parent_id']] = $padding; } else if ($row['left_id'] > $right + 1) @@ -43,35 +45,41 @@ function make_forum_select($select_id = false, $ignore_id = false, $ignore_acl = $right = $row['right_id']; + if ($acl && !$auth->acl_gets($acl, $row['forum_id'])) + { + continue; + } + + if ((is_array($ignore_id) && in_array($row['forum_id'], $ignore_id)) || $row['forum_id'] == $ignore_id) + { + continue; + } + + if ($row['forum_type'] == FORUM_CAT && ($row['left_id'] + 1 == $row['right_id']) && $ignore_emptycat) + { + // Non-postable forum with no subforums, don't display + continue; + } + + if ($row['forum_type'] != FORUM_POST && $ignore_nonpost) + { + continue; + } + $selected = (is_array($select_id)) ? ((in_array($row['forum_id'], $select_id)) ? ' selected="selected"' : '') : (($row['forum_id'] == $select_id) ? ' selected="selected"' : ''); - if ($row['left_id'] > $cat_right) - { - $holding = ''; - } + $forum_list .= ''; - if ($row['right_id'] - $row['left_id'] > 1 && $ignore_emptycat) - { - $cat_right = max($cat_right, $row['right_id']); - - $holding .= ''; - } - else - { - $forum_list .= $holding . ''; - $holding = ''; - } - } - - if (!$right) - { - $forum_list .= ''; + $iteration++; } + unset($padding_store); return $forum_list; } -// Generate size select form +/** +* Generate size select form +*/ function size_select($select_name, $size_compare) { global $user; @@ -92,7 +100,9 @@ function size_select($select_name, $size_compare) return ($select_field); } -// Obtain authed forums list +/** +* Obtain authed forums list +*/ function get_forum_list($acl_list = 'f_list', $id_only = TRUE, $postable_only = FALSE, $no_cache = FALSE) { global $db, $auth; @@ -131,6 +141,9 @@ function get_forum_list($acl_list = 'f_list', $id_only = TRUE, $postable_only = return $rowset; } +/** +* Get forum branch +*/ function get_forum_branch($forum_id, $type = 'all', $order = 'descending', $include_forum = TRUE) { global $db; @@ -172,6 +185,9 @@ function get_forum_branch($forum_id, $type = 'all', $order = 'descending', $incl return $rows; } +/** +* Get physical file listing +*/ function filelist($rootdir, $dir = '', $type = 'gif|jpg|jpeg|png') { $matches = array(); @@ -206,7 +222,9 @@ function filelist($rootdir, $dir = '', $type = 'gif|jpg|jpeg|png') return $matches; } -// Posts and topics manipulation +/* +* Move topic(s) +*/ function move_topics($topic_ids, $forum_id, $auto_sync = true) { global $db; @@ -250,6 +268,9 @@ function move_topics($topic_ids, $forum_id, $auto_sync = true) } } +/** +* Move post(s) +*/ function move_posts($post_ids, $topic_id, $auto_sync = true) { global $db; @@ -309,6 +330,9 @@ function move_posts($post_ids, $topic_id, $auto_sync = true) } } +/** +* Remove topic(s) +*/ function delete_topics($where_type, $where_ids, $auto_sync = TRUE) { global $db; @@ -377,6 +401,9 @@ function delete_topics($where_type, $where_ids, $auto_sync = TRUE) return $return; } +/** +* Remove post(s) +*/ function delete_posts($where_type, $where_ids, $auto_sync = TRUE) { global $db; @@ -436,10 +463,12 @@ function delete_posts($where_type, $where_ids, $auto_sync = TRUE) return sizeof($post_ids); } -// Delete Attachments -// mode => (post, topic, attach, user) -// ids => (post_ids, topic_ids, attach_ids, user_ids) -// resync => set this to false if you are deleting posts or topics... +/** +* Delete Attachments +* mode => (post, topic, attach, user) +* ids => (post_ids, topic_ids, attach_ids, user_ids) +* resync => set this to false if you are deleting posts or topics... +*/ function delete_attachments($mode, $ids, $resync = TRUE) { global $db, $config; @@ -628,6 +657,9 @@ function delete_attachments($mode, $ids, $resync = TRUE) return $num_deleted; } +/** +* Remove topic shadows +*/ function delete_topic_shadows($max_age, $forum_id = '', $auto_sync = TRUE) { $where = (is_array($forum_id)) ? 'AND t.forum_id IN (' . implode(', ', $forum_id) . ')' : (($forum_id) ? "AND t.forum_id = $forum_id" : ''); @@ -672,7 +704,9 @@ function delete_topic_shadows($max_age, $forum_id = '', $auto_sync = TRUE) } } -// Delete File +/** +* Delete File +*/ function phpbb_unlink($filename, $mode = 'file') { global $config, $user, $phpbb_root_path; @@ -681,22 +715,23 @@ function phpbb_unlink($filename, $mode = 'file') return @unlink($filename); } -// All-encompasing sync function -// -// Usage: -// sync('topic', 'topic_id', 123); <= resync topic #123 -// sync('topic', 'forum_id', array(2, 3)); <= resync topics from forum #2 and #3 -// sync('topic'); <= resync all topics -// sync('topic', 'range', 'topic_id BETWEEN 1 AND 60'); <= resync a range of topics/forums (only available for 'topic' and 'forum' modes) -// -// Modes: -// - topic_moved Removes topic shadows that would be in the same forum as the topic they link to -// - topic_approved Resyncs the topic_approved flag according to the status of the first post -// - post_reported Resyncs the post_reported flag, relying on actual reports -// - topic_reported Resyncs the topic_reported flag, relying on post_reported flags -// - post_attachement Same as post_reported, thanks to a quick Search/Replace -// - topic_attachement Same as topic_reported, thanks to a quick Search/Replace -// +/** +* All-encompasing sync function +* +* Usage: +* sync('topic', 'topic_id', 123); <= resync topic #123 +* sync('topic', 'forum_id', array(2, 3)); <= resync topics from forum #2 and #3 +* sync('topic'); <= resync all topics +* sync('topic', 'range', 'topic_id BETWEEN 1 AND 60'); <= resync a range of topics/forums (only available for 'topic' and 'forum' modes) +* +* Modes: +* - topic_moved Removes topic shadows that would be in the same forum as the topic they link to +* - topic_approved Resyncs the topic_approved flag according to the status of the first post +* - post_reported Resyncs the post_reported flag, relying on actual reports +* - topic_reported Resyncs the topic_reported flag, relying on post_reported flags +* - post_attachement Same as post_reported, thanks to a quick Search/Replace +* - topic_attachement Same as topic_reported, thanks to a quick Search/Replace +*/ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = FALSE, $sync_extra = FALSE) { global $db; @@ -1346,7 +1381,9 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = FALSE, } } - +/** +* Prune function +*/ function prune($forum_id, $prune_mode, $prune_date, $prune_flags = 0, $auto_sync = true) { global $db; @@ -1408,7 +1445,9 @@ function prune($forum_id, $prune_mode, $prune_date, $prune_flags = 0, $auto_sync return delete_topics('topic_id', $topic_list, $auto_sync); } -// Function auto_prune(), this function now relies on passed vars +/** +* Function auto_prune(), this function now relies on passed vars +*/ function auto_prune($forum_id, $prune_mode, $prune_flags, $prune_days, $prune_freq) { global $db; @@ -1437,8 +1476,10 @@ function auto_prune($forum_id, $prune_mode, $prune_flags, $prune_days, $prune_fr return; } -// remove_comments will strip the sql comment lines out of an uploaded sql file -// specifically for mssql and postgres type files in the install.... +/** +* remove_comments will strip the sql comment lines out of an uploaded sql file +* specifically for mssql and postgres type files in the install.... +*/ function remove_comments(&$output) { $lines = explode("\n", $output); @@ -1470,14 +1511,18 @@ function remove_comments(&$output) return $output; } -// remove_remarks will strip the sql comment lines out of an uploaded sql file +/** +* remove_remarks will strip the sql comment lines out of an uploaded sql file +*/ function remove_remarks(&$sql) { $sql = preg_replace('/(\n){2,}/', "\n", preg_replace('/^#.*/m', "\n", $sql)); } -// split_sql_file will split an uploaded sql file into single sql statements. -// Note: expects trim() to have already been run on $sql. +/** +* split_sql_file will split an uploaded sql file into single sql statements. +* Note: expects trim() to have already been run on $sql. +*/ function split_sql_file($sql, $delimiter) { // Split up our string into "possible" SQL statements. @@ -1565,8 +1610,10 @@ function split_sql_file($sql, $delimiter) return $output; } -// Cache moderators, called whenever permissions are changed via admin_permissions. Changes of username -// and group names must be carried through for the moderators table +/** +* Cache moderators, called whenever permissions are changed via admin_permissions. Changes of username +* and group names must be carried through for the moderators table +*/ function cache_moderators() { global $db, $cache; @@ -1657,7 +1704,9 @@ function cache_moderators() } } -// Logging functions +/** +* Add log event +*/ function add_log() { global $db, $user; @@ -1701,6 +1750,9 @@ function add_log() return; } +/** +* View log +*/ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id = 0, $topic_id = 0, $user_id = 0, $limit_days = 0, $sort_by = 'l.log_time DESC') { global $db, $user, $auth, $phpEx, $SID; @@ -1773,13 +1825,13 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id $log[$i]['topic_id'] = $row['topic_id']; $log[$i]['viewforum'] = ($row['forum_id'] && $auth->acl_get('f_read', $row['forum_id'])) ? ((defined('IN_ADMIN')) ? '../' : '') . "viewforum.$phpEx$SID&f=" . $row['forum_id'] : ''; - $log[$i]['action'] = (!empty($user->lang[$row['log_operation']])) ? $user->lang[$row['log_operation']] : ucfirst(str_replace('_', ' ', $row['log_operation'])); + $log[$i]['action'] = (isset($user->lang[$row['log_operation']])) ? $user->lang[$row['log_operation']] : '{' . ucfirst(str_replace('_', ' ', $row['log_operation'])) . '}'; if (!empty($row['log_data'])) { $log_data_ary = unserialize(stripslashes($row['log_data'])); - if (!empty($user->lang[$row['log_operation']])) + if (isset($user->lang[$row['log_operation']])) { foreach ($log_data_ary as $log_data) { @@ -1790,7 +1842,7 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id } else { - $log[$i]['action'] = implode('', $log_data_ary); + $log[$i]['action'] .= '
' . implode('', $log_data_ary); } } @@ -1846,9 +1898,12 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id return; } -// Extension of auth class for changing permissions if (class_exists('auth')) { + /** + * @package phpBB3 + * Extension of auth class for changing permissions + */ class auth_admin extends auth { // Set a user or group ACL record @@ -2115,8 +2170,10 @@ if (class_exists('auth')) } } -// Update Post Informations (First/Last Post in topic/forum) -// Should be used instead of sync() if only the last post informations are out of sync... faster +/** +* Update Post Informations (First/Last Post in topic/forum) +* Should be used instead of sync() if only the last post informations are out of sync... faster +*/ function update_post_information($type, $ids) { global $db; diff --git a/phpBB/includes/functions_compress.php b/phpBB/includes/functions_compress.php index 5c55fda67c..b159adf53d 100644 --- a/phpBB/includes/functions_compress.php +++ b/phpBB/includes/functions_compress.php @@ -1,16 +1,17 @@ -start(); include_once($phpbb_root_path . 'includes/functions_admin.'.$phpEx); - add_log('critical', $type . '_ERROR', $msg); + add_log('critical', 'LOG_' . $type . '_ERROR', $msg); } // // Messenger methods // + function save_queue() + { + if ($this->use_queue) + { + $this->queue->save(); + } + } function msg_email() { @@ -404,7 +412,11 @@ class messenger } } -// At the moment it is only handling the email queue +/** +* @package phpBB3 +* Queue +* At the moment it is only handling the email queue +*/ class queue { var $data = array(); @@ -636,7 +648,9 @@ class queue } -// Replacement or substitute for PHP's mail command +/** +* Replacement or substitute for PHP's mail command +*/ function smtpmail($addresses, $subject, $message, &$err_msg, $encoding, $headers = '') { global $config, $user; @@ -828,9 +842,12 @@ function smtpmail($addresses, $subject, $message, &$err_msg, $encoding, $headers return true; } -// SMTP Class -// Auth Mechanisms originally taken from the AUTH Modules found within the PHP Extension and Application Repository (PEAR) -// See docs/AUTHORS for more details +/** +* @package phpBB3 +* SMTP Class +* Auth Mechanisms originally taken from the AUTH Modules found within the PHP Extension and Application Repository (PEAR) +* See docs/AUTHORS for more details +*/ class smtp_class { var $server_response = ''; @@ -1171,10 +1188,12 @@ class smtp_class } } -// Encodes the given string for proper display for this encoding ... nabbed -// from php.net and modified. There is an alternative encoding method which -// may produce less output but it's questionable as to its worth in this -// scenario IMO +/** +* Encodes the given string for proper display for this encoding ... nabbed +* from php.net and modified. There is an alternative encoding method which +* may produce less output but it's questionable as to its worth in this +* scenario IMO +*/ function mail_encode($str, $encoding) { if ($encoding == '') diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php index 0bac9dfd76..cdb2cd6fa5 100644 --- a/phpBB/includes/functions_module.php +++ b/phpBB/includes/functions_module.php @@ -1,16 +1,17 @@ -get('filesize')) { @@ -250,7 +254,9 @@ function upload_attachment($form_name, $forum_id, $local = false, $local_storage return $filedata; } -// Calculate the needed size for Thumbnail +/** +* Calculate the needed size for Thumbnail +*/ function get_img_size_format($width, $height) { // Maximum Width the Image can take @@ -272,7 +278,9 @@ function get_img_size_format($width, $height) } } -// Return supported image types +/** +* Return supported image types +*/ function get_supported_image_types($type = false) { if (@extension_loaded('gd')) @@ -327,7 +335,9 @@ function get_supported_image_types($type = false) return array('gd' => false); } -// Create Thumbnail +/** +* Create Thumbnail +*/ function create_thumbnail($source, $destination, $mimetype) { global $config; @@ -423,7 +433,9 @@ function create_thumbnail($source, $destination, $mimetype) return true; } -// DECODE TEXT -> This will/should be handled by bbcode.php eventually +/** +* DECODE TEXT -> This will/should be handled by bbcode.php eventually +*/ function decode_message(&$message, $bbcode_uid = '') { global $config; @@ -450,7 +462,9 @@ function decode_message(&$message, $bbcode_uid = '') return; } -// Generate Topic Icons for display +/** +* Generate Topic Icons for display +*/ function posting_gen_topic_icons($mode, $icon_id) { global $phpbb_root_path, $config, $template; @@ -488,7 +502,9 @@ function posting_gen_topic_icons($mode, $icon_id) return false; } -// Assign Inline attachments (build option fields) +/** +* Assign Inline attachments (build option fields) +*/ function posting_gen_inline_attachments(&$attachment_data) { global $template; @@ -510,7 +526,9 @@ function posting_gen_inline_attachments(&$attachment_data) return false; } -// Build topic types able to be selected +/** +* Build topic types able to be selected +*/ function posting_gen_topic_types($forum_id, $cur_topic_type = POST_NORMAL) { global $auth, $user, $template, $topic_type; @@ -566,6 +584,9 @@ function posting_gen_topic_types($forum_id, $cur_topic_type = POST_NORMAL) return $toggle; } +/** +* Generate inline attachment entry +*/ function posting_gen_attachment_entry(&$attachment_data, &$filename_data) { global $template, $config, $phpbb_root_path, $SID, $phpEx; @@ -616,7 +637,9 @@ function posting_gen_attachment_entry(&$attachment_data, &$filename_data) return sizeof($attachment_data); } -// Load Drafts +/** +* Load Drafts +*/ function load_drafts($topic_id = 0, $forum_id = 0, $id = 0) { global $user, $db, $template, $phpEx, $SID, $auth; @@ -717,7 +740,9 @@ function load_drafts($topic_id = 0, $forum_id = 0, $id = 0) } } -// Topic Review +/** +* Topic Review +*/ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id = 0, $show_quote_button = true) { global $user, $auth, $db, $template, $bbcode, $template; @@ -802,7 +827,9 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id return true; } -// User Notification +/** +* User Notification +*/ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id, $topic_id, $post_id) { global $db, $user, $config, $phpbb_root_path, $phpEx, $auth; @@ -977,10 +1004,7 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id } unset($msg_list_ary); - if ($messenger->queue) - { - $messenger->queue->save(); - } + $messenger->save_queue(); } // Handle the DB updates diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index cd9160ec97..d125fe315a 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1,15 +1,15 @@ 'group' ); -// Get all folder +/** +* Get all folder +*/ function get_folder($user_id, &$folder, $folder_id = false) { global $db, $user, $template; @@ -178,7 +180,9 @@ function get_folder($user_id, &$folder, $folder_id = false) return; } -// Delete Messages From Sentbox - we are doing this here because this saves us a bunch of checks and queries +/** +* Delete Messages From Sentbox - we are doing this here because this saves us a bunch of checks and queries +*/ function clean_sentbox($num_sentbox_messages) { global $db, $user, $config; @@ -207,7 +211,9 @@ function clean_sentbox($num_sentbox_messages) } } -// Check Rule against Message Informations +/** +* Check Rule against Message Informations +*/ function check_rule(&$rules, &$rule_row, &$message_row, $user_id) { global $user, $config; @@ -252,7 +258,9 @@ function check_rule(&$rules, &$rule_row, &$message_row, $user_id) return false; } -// Place new messages into appropiate folder +/** +* Place new messages into appropiate folder +*/ function place_pm_into_folder(&$global_privmsgs_rules, $release = false) { global $db, $user, $config; @@ -569,7 +577,9 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false) return $num_not_moved; } -// Move PM from one to another folder +/** +* Move PM from one to another folder +*/ function move_pm($user_id, $message_limit, $move_msg_ids, $dest_folder, $cur_folder_id) { global $db, $user; @@ -656,7 +666,9 @@ function move_pm($user_id, $message_limit, $move_msg_ids, $dest_folder, $cur_fol return $num_moved; } -// Update unread message status +/** +* Update unread message status +*/ function update_unread_status($unread, $msg_id, $user_id, $folder_id) { if (!$unread) @@ -753,7 +765,9 @@ function handle_mark_actions($user_id, $mark_action) return true; } -// Delete PM(s) +/** +* Delete PM(s) +*/ function delete_pm($user_id, $msg_ids, $folder_id) { global $db; @@ -884,7 +898,9 @@ function delete_pm($user_id, $msg_ids, $folder_id) } } -// Rebuild message header +/** +* Rebuild message header +*/ function rebuild_header($check_ary) { global $db; @@ -917,7 +933,9 @@ function rebuild_header($check_ary) return $address; } -// Print out/Assign recipient informations +/** +* Print out/Assign recipient informations +*/ function write_pm_addresses($check_ary, $author_id, $plaintext = false) { global $db, $user, $template, $phpbb_root_path, $SID, $phpEx; @@ -1033,7 +1051,9 @@ function write_pm_addresses($check_ary, $author_id, $plaintext = false) return $addresses; } -// Get folder status +/** +* Get folder status +*/ function get_folder_status($folder_id, $folder) { global $db, $user, $config; @@ -1067,7 +1087,9 @@ function get_folder_status($folder_id, $folder) // COMPOSE MESSAGES // -// Submit PM +/** +* Submit PM +*/ function submit_pm($mode, $subject, &$data, $update_message, $put_in_outbox = true) { global $db, $auth, $user, $config, $phpEx, $SID, $template; @@ -1338,7 +1360,9 @@ function submit_pm($mode, $subject, &$data, $update_message, $put_in_outbox = tr return $data['msg_id']; } -// PM Notification +/** +* PM Notification +*/ function pm_notification($mode, $author, $recipients, $subject, $message) { global $db, $user, $config, $phpbb_root_path, $phpEx, $auth; @@ -1422,10 +1446,7 @@ function pm_notification($mode, $author, $recipients, $subject, $message) } unset($msg_list_ary); - if ($messenger->queue) - { - $messenger->queue->save(); - } + $messenger->save_queue(); unset($messenger); } diff --git a/phpBB/includes/functions_profile_fields.php b/phpBB/includes/functions_profile_fields.php index 5a3a20e549..2133463eb7 100644 --- a/phpBB/includes/functions_profile_fields.php +++ b/phpBB/includes/functions_profile_fields.php @@ -1,16 +1,17 @@ 'int', 2 => 'string', 3 => 'text', 4 => 'bool', 5 => 'dropdown', 6 => 'date'); @@ -714,6 +715,10 @@ class custom_profile } } +/** +* @package phpBB3 +* Custom Profile Fields ACP +*/ class custom_profile_admin extends custom_profile { var $vars = array(); diff --git a/phpBB/includes/functions_upload.php b/phpBB/includes/functions_upload.php index bdb4e92ade..0fd772377b 100644 --- a/phpBB/includes/functions_upload.php +++ b/phpBB/includes/functions_upload.php @@ -1,21 +1,18 @@ get('realname'), $file->get('width'), $file->get('height')); } +/** +* Avatar Gallery +*/ function avatar_gallery($category, &$error) { global $config, $phpbb_root_path, $user; @@ -1015,8 +1042,10 @@ function avatar_gallery($category, &$error) // Usergroup functions // -// Add or edit a group. If we're editing a group we only update user -// parameters such as rank, etc. if they are changed +/** +* Add or edit a group. If we're editing a group we only update user +* parameters such as rank, etc. if they are changed +*/ function group_create($group_id, $type, $name, $desc) { global $phpbb_root_path, $config, $db, $user, $file_upload; @@ -1093,6 +1122,9 @@ function group_create($group_id, $type, $name, $desc) return (sizeof($error)) ? $error : false; } +/** +* Group Delete +*/ function group_delete($group_id, $group_name = false) { global $db; @@ -1162,6 +1194,9 @@ function group_delete($group_id, $group_name = false) return false; } +/** +* Add user(s) to group +*/ function group_user_add($group_id, $user_id_ary = false, $username_ary = false, $group_name = false, $default = false, $leader = 0) { global $db, $auth; @@ -1355,9 +1390,11 @@ function group_user_add($group_id, $user_id_ary = false, $username_ary = false, return false; } -// Remove a user/s from a given group. When we remove users we update their -// default group_id. We do this by examining which "special" groups they belong -// to. The selection is made based on a reasonable priority system +/** +* Remove a user/s from a given group. When we remove users we update their +* default group_id. We do this by examining which "special" groups they belong +* to. The selection is made based on a reasonable priority system +*/ function group_user_del($group_id, $user_id_ary = false, $username_ary = false, $group_name = false) { global $db, $auth; @@ -1485,7 +1522,9 @@ function group_user_del($group_id, $user_id_ary = false, $username_ary = false, return false; } -// This is used to promote (to leader), demote or set as default a member/s +/** +* This is used to promote (to leader), demote or set as default a member/s +*/ function group_user_attributes($action, $group_id, $user_id_ary = false, $username_ary = false, $group_name = false) { global $db, $auth; @@ -1622,8 +1661,10 @@ function group_user_attributes($action, $group_id, $user_id_ary = false, $userna return false; } -// Obtain either the members of a specified group or the groups to -// which the specified users are members +/** +* Obtain either the members of a specified group or the groups to +* which the specified users are members +*/ function group_memberships($group_id = false, $user_id_ary = false) { global $db; diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php index 7de44547e3..6478d02d54 100644 --- a/phpBB/includes/mcp/mcp_forum.php +++ b/phpBB/includes/mcp/mcp_forum.php @@ -1,20 +1,16 @@ send($post_data['user_notify_type']); $messenger->reset(); - - if ($messenger->queue) - { - $messenger->queue->save(); - } } + + $messenger->save_queue(); } // Send out normal user notifications @@ -669,12 +668,9 @@ function disapprove_post($post_id_list) $messenger->send($post_data['user_notify_type']); $messenger->reset(); - - if ($messenger->queue) - { - $messenger->queue->save(); - } } + + $messenger->save_queue(); } unset($post_info, $disapprove_reason); diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php index 48677b63aa..e73ddb51ad 100644 --- a/phpBB/includes/mcp/mcp_topic.php +++ b/phpBB/includes/mcp/mcp_topic.php @@ -1,20 +1,16 @@ sql_freeresult($result); // Check autologin request, is it valid? - if ($this->data === false || ($this->data['user_password'] != $autologin && !$set_autologin) || ($this->data['user_type'] == USER_INACTIVE && !$bot)) + if ($this->data === false || ($this->data['user_password'] !== $autologin && !$set_autologin) || ($this->data['user_type'] == USER_INACTIVE && !$bot)) { $autologin = ''; $this->data['user_id'] = $user_id = ANONYMOUS; @@ -475,8 +476,11 @@ class session } } -// Contains (at present) basic user methods such as configuration -// creating date/time ... keep this? +/** +* @package phpBB3 +* Contains (at present) basic user methods such as configuration +* creating date/time ... keep this? +*/ class user extends session { var $lang = array(); @@ -865,8 +869,11 @@ class user extends session } } -// Will be keeping my eye of 'other products' to ensure these things don't -// mysteriously appear elsewhere, think up your own solutions! +/** +* @package phpBB3 +* Will be keeping my eye of 'other products' to ensure these things don't +* mysteriously appear elsewhere, think up your own solutions! +*/ class auth { var $founder = false; diff --git a/phpBB/includes/template.php b/phpBB/includes/template.php index 0e6cabbdce..d7a2bfa5f8 100644 --- a/phpBB/includes/template.php +++ b/phpBB/includes/template.php @@ -1,36 +1,34 @@ VALUE [the key/value pair to search for within the loop to determine the correct position] OR - // (int) Position [the position to change or insert at directly given] - // - // If key is false the position is set to 0 - // If key is true the position is set to the last entry - // - // $mode : insert|change - // If insert, the vararray is inserted at the given position (position counting from zero). - // If change, the current block gets merged with the vararray (resulting in new key/value pairs be added and existing keys be - // replaced by the new value). - // - // Since counting begins by zero... - // inserting at the last position will result in this array: array(vararray, last positioned array) - // inserting at the position 1 will result in this array: array(first positioned array, vararray, following vars) + /** + * Change already assigned key variable pair (one-dimensional - single loop entry) + * + * Some Examples: + * + * + * alter_block_array('loop', $varrarray); // Insert vararray at the end + * alter_block_array('loop', $vararray, 2); // Insert vararray at position 2 + * alter_block_array('loop', $vararray, array('KEY' => 'value')); // Insert vararray at the position where the key 'KEY' has the value of 'value' + * alter_block_array('loop', $vararray, false); // Insert vararray at first position + * alter_block_array('loop', $vararray, true); //Insert vararray at last position (assign_block_vars equivalence) + * + * alter_block_array('loop', $vararray, 2, 'change'); // Change/Merge vararray with existing array at position 2 + * alter_block_array('loop', $vararray, array('KEY' => 'value'), 'change'); // Change/Merge vararray with existing array at the position where the key 'KEY' has the value of 'value' + * alter_block_array('loop', $vararray, false, 'change'); // Change/Merge vararray with existing array at first position + * alter_block_array('loop', $vararray, true, 'change'); // Change/Merge vararray with existing array at last position + * + * + * + * @param string $blockname the blockname, for example 'loop' + * @param array $vararray the var array to insert/add or merge + * @param mixed $key Key to search for + * + * array: KEY => VALUE [the key/value pair to search for within the loop to determine the correct position] + * + * int: Position [the position to change or insert at directly given] + * + * If key is false the position is set to 0 + * + * If key is true the position is set to the last entry + * + * @param insert|change $mode Mode to execute + * + * If insert, the vararray is inserted at the given position (position counting from zero). + * + * If change, the current block gets merged with the vararray (resulting in new key/value pairs be added and existing keys be replaced by the new value). + * + * Since counting begins by zero, inserting at the last position will result in this array: array(vararray, last positioned array) + * and inserting at position 1 will result in this array: array(first positioned array, vararray, following vars) + * + */ function alter_block_array($blockname, $vararray, $key = false, $mode = 'insert') { - // Examples: - // ('loop', $varrarray) : Insert vararray at the end - // ('loop', $vararray, 2) : Insert vararray at position 2 - // ('loop', $vararray, array('KEY' => 'value')) : Insert vararray at the position where the key 'KEY' has the value of 'value' - // ('loop', $vararray, false) : Insert vararray at first position - // ('loop', $vararray, true) : Insert vararray at last position (assign_block_vars equivalence) - - // ('loop', $vararray, 2, 'change') : Change/Merge vararray with existing array at position 2 - // ('loop', $vararray, array('KEY' => 'value'), 'change') : Change/Merge vararray with existing array at the position where the key 'KEY' has the value of 'value' - // ('loop', $vararray, false, 'change') : Change/Merge vararray with existing array at first position - // ('loop', $vararray, true, 'change') : Change/Merge vararray with existing array at last position - if (strpos($blockname, '.') !== false) { // Nested blocks are not supported @@ -889,12 +898,12 @@ class template } /** - * Generates a reference to the given variable inside the given (possibly nested) - * block namespace. This is a string of the form: - * ' . $this->_tpldata['parent'][$_parent_i]['$child1'][$_child1_i]['$child2'][$_child2_i]...['varname'] . ' - * It's ready to be inserted into an "echo" line in one of the templates. - * NOTE: expects a trailing "." on the namespace. - */ + * Generates a reference to the given variable inside the given (possibly nested) + * block namespace. This is a string of the form: + * ' . $this->_tpldata['parent'][$_parent_i]['$child1'][$_child1_i]['$child2'][$_child2_i]...['varname'] . ' + * It's ready to be inserted into an "echo" line in one of the templates. + * NOTE: expects a trailing "." on the namespace. + */ function generate_block_varref($namespace, $varname, $echo = true, $defop = false) { // Strip the trailing period. @@ -912,13 +921,13 @@ class template } /** - * Generates a reference to the array of data values for the given - * (possibly nested) block namespace. This is a string of the form: - * $this->_tpldata['parent'][$_parent_i]['$child1'][$_child1_i]['$child2'][$_child2_i]...['$childN'] - * - * If $include_last_iterator is true, then [$_childN_i] will be appended to the form shown above. - * NOTE: does not expect a trailing "." on the blockname. - */ + * Generates a reference to the array of data values for the given + * (possibly nested) block namespace. This is a string of the form: + * $this->_tpldata['parent'][$_parent_i]['$child1'][$_child1_i]['$child2'][$_child2_i]...['$childN'] + * + * If $include_last_iterator is true, then [$_childN_i] will be appended to the form shown above. + * NOTE: does not expect a trailing "." on the blockname. + */ function generate_block_data_ref($blockname, $include_last_iterator, $defop = false) { // Get an array of the blocks involved. diff --git a/phpBB/includes/ucp/ucp_activate.php b/phpBB/includes/ucp/ucp_activate.php index f7d069e5de..0241ce7974 100644 --- a/phpBB/includes/ucp/ucp_activate.php +++ b/phpBB/includes/ucp/ucp_activate.php @@ -1,16 +1,18 @@ send($row['user_notify_type']); - $messenger->queue->save(); + $messenger->save_queue(); $message = 'ACCOUNT_ACTIVE_ADMIN'; } diff --git a/phpBB/includes/ucp/ucp_attachments.php b/phpBB/includes/ucp/ucp_attachments.php index e499b3f907..2e479b0654 100644 --- a/phpBB/includes/ucp/ucp_attachments.php +++ b/phpBB/includes/ucp/ucp_attachments.php @@ -1,20 +1,18 @@ data['user_id'], $check_lang, $rule_lang, $action_lang, $folder); } +/** +* Defining check option for message rules +*/ function define_check_option($hardcoded, $check_option, $check_lang) { global $template; @@ -498,6 +501,9 @@ function define_check_option($hardcoded, $check_option, $check_lang) ); } +/** +* Defining action option for message rules +*/ function define_action_option($hardcoded, $action_option, $action_lang, $folder) { global $db, $template, $user; @@ -542,6 +548,9 @@ function define_action_option($hardcoded, $action_option, $action_lang, $folder) ); } +/** +* Defining rule option for message rules +*/ function define_rule_option($hardcoded, $rule_option, $rule_lang, $check_ary) { global $template; @@ -564,6 +573,9 @@ function define_rule_option($hardcoded, $rule_option, $rule_lang, $check_ary) ); } +/** +* Defining condition option for message rules +*/ function define_cond_option($hardcoded, $cond_option, $rule_option, $global_rule_conditions) { global $db, $template; @@ -668,6 +680,9 @@ function define_cond_option($hardcoded, $cond_option, $rule_option, $global_rule ); } +/** +* Display defined message rules +*/ function show_defined_rules($user_id, $check_lang, $rule_lang, $action_lang, $folder) { global $db, $template; diff --git a/phpBB/includes/ucp/ucp_pm_viewfolder.php b/phpBB/includes/ucp/ucp_pm_viewfolder.php index 8edac192ad..89fe1d53c8 100644 --- a/phpBB/includes/ucp/ucp_pm_viewfolder.php +++ b/phpBB/includes/ucp/ucp_pm_viewfolder.php @@ -1,18 +1,17 @@ sql_freeresult($result); } - $messenger->queue->save(); + $messenger->save_queue(); $sql_ary += array( 'user_type' => USER_INACTIVE, diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php index 6dc10877fd..1a0c0e5eb9 100644 --- a/phpBB/includes/ucp/ucp_register.php +++ b/phpBB/includes/ucp/ucp_register.php @@ -1,16 +1,18 @@ assign_vars(array( - 'L_AGREEMENT' => $user->lang['UCP_AGREEMENT'], + 'L_TERMS_OF_USE' => $user->lang['TERMS_OF_USE_CONTENT'], 'S_SHOW_COPPA' => false, 'S_REGISTER_ACTION' => "{$phpbb_root_path}ucp.$phpEx$SID&mode=register") @@ -413,7 +415,7 @@ class ucp_register extends module $db->sql_freeresult($result); $code = gen_rand_string(6); - $confirm_id = md5(uniqid($user_ip)); + $confirm_id = md5(uniqid($user->ip)); $sql = 'INSERT INTO ' . CONFIRM_TABLE . ' ' . $db->sql_build_array('INSERT', array( 'confirm_id' => (string) $confirm_id, diff --git a/phpBB/includes/ucp/ucp_remind.php b/phpBB/includes/ucp/ucp_remind.php index 97dc2d5bfe..dea1027ce6 100644 --- a/phpBB/includes/ucp/ucp_remind.php +++ b/phpBB/includes/ucp/ucp_remind.php @@ -1,16 +1,18 @@ send($row['user_notify_type']); - if ($messenger->queue) - { - $messenger->queue->save(); - } + $messenger->save_queue(); meta_refresh(3, "index.$phpEx$SID"); diff --git a/phpBB/includes/ucp/ucp_zebra.php b/phpBB/includes/ucp/ucp_zebra.php index cdc5f9ca4b..ae0d5b496c 100644 --- a/phpBB/includes/ucp/ucp_zebra.php +++ b/phpBB/includes/ucp/ucp_zebra.php @@ -1,16 +1,17 @@ 'Users Pruned and Posts Retained
%s', 'LOG_RESYNC_STATS' => 'Post, topic and user stats reset', + 'LOG_RESYNC_POSTCOUNTS' => 'User postcounts synced', 'LOG_RESET_DATE' => 'Board start date reset', 'LOG_RESET_ONLINE' => 'Most users online reset', @@ -277,9 +279,6 @@ $lang += array( 'LOG_JAB_REGISTER' => 'Jabber account registered', 'LOG_JAB_CHANGED' => 'Jabber account changed', - 'LOG_EMAIL_ERROR' => '%s', - 'LOG_JABBER_ERROR' => '%s', - 'LOG_BOT_ADDED' => 'New bot added
» %s', 'LOG_BOT_UPDATED' => 'Existing bot updated
» %s', 'LOG_BOT_DELETE' => 'Deleted bot
» %s', @@ -316,6 +315,7 @@ $lang += array( 'RESET_ONLINE' => 'Reset Online', 'RESET_DATE' => 'Reset Date', 'RESYNC_STATS' => 'Resync Stats', + 'RESYNC_POSTCOUNTS' => 'Resync Postcounts', 'INACTIVE_USERS' => 'Inactive Users', 'INACTIVE_USERS_EXPLAIN'=> 'This is a list of users who have registered but whos accounts are inactive. You can activate, delete or remind (by sending an email) these users if you wish.', diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index 5fdaf1f94e..1dc3784860 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -1,17 +1,18 @@ '6 Months', '7_DAYS' => '7 Days', + 'ACCOUNT_ALREADY_ACTIVATED' => 'Your account is already activated', 'ACCOUNT_NOT_ACTIVATED' => 'Your account has not been activated yet', 'ACP' => 'Administration Control Panel', 'ACTIVE_ERROR' => 'You have specified an inactive username. Please activate your account and try again. If you continue to have problems please contact a board administrator.', @@ -173,19 +175,6 @@ $lang += array( 'JUMP_PAGE' => 'Enter the page number you wish to goto', 'JUMP_TO' => 'Jump to', - 'KARMA' => array( - '-5' => 'Extremely Bad', - '-4' => 'Very Bad', - '-3' => 'Very Poor', - '-2' => 'Bad', - '-1' => 'Poor', - '0' => 'Neutral', - '1' => 'Positive', - '2' => 'Good', - '3' => 'Very Good', - '4' => 'Extremely good', - '5' => 'Excellent' - ), 'KB' => 'KB', 'LAST_POST' => 'Last Post', @@ -208,8 +197,13 @@ $lang += array( 'LOGIN_INFO' => 'In order to login you must be registered. Registering takes only a few seconds but gives you increased capabilies. The board administrator may also grant additional permissions to registered users. Before you login please ensure you are familiar with our terms of use and related policies. Please ensure you read any forum rules as you navigate around the board.', 'LOGIN_VIEWFORUM' => 'The board administrator requires you to be registered and logged in to view this forum.', 'LOGOUT_USER' => 'Logout [ %s ]', + 'LOG_ADMIN_AUTH_FAIL' => 'Failed administration login attempt', + 'LOG_ADMIN_AUTH_SUCCESS'=> 'Sucessful administration login', 'LOG_DELETE_TOPIC' => 'Deleted topic
» %s', + 'LOG_EMAIL_ERROR' => 'Email error
» %s', + 'LOG_JABBER_ERROR' => 'Jabber error
» %s', 'LOG_ME_IN' => 'Log me on automatically each visit', + 'LOG_USER_FEEDBACK' => 'Added user feedback
» %s', 'LOG_USER_GENERAL' => '%s', 'MARK' => 'Mark', @@ -311,6 +305,7 @@ $lang += array( 'REPLY_WITH_QUOTE' => 'Reply with quote', 'REPLYING_GLOBAL_ANNOUNCE' => 'Replying to global announcement', 'REPLYING_MESSAGE' => 'Replying to message in %s', + 'RESEND_ACTIVATION' => 'Resend activation email', 'RESET' => 'Reset', 'RETURN_INDEX' => 'Click %sHere%s to return to the index', 'RETURN_FORUM' => 'Click %sHere%s to return to the forum', diff --git a/phpBB/language/en/email/user_resend_inactive.txt b/phpBB/language/en/email/user_resend_inactive.txt new file mode 100644 index 0000000000..bc4dd02d2d --- /dev/null +++ b/phpBB/language/en/email/user_resend_inactive.txt @@ -0,0 +1,21 @@ +Subject: Welcome to {SITENAME} Forums +Charset: iso-8859-1 + +{WELCOME_MSG} + +Please keep this email for your records. Your account information is as follows: + +---------------------------- +Username: {USERNAME} +---------------------------- + +Your password has been encrypted in our database. Should you forget your password you can request a new one which will be activated in the same way as this account. + +Your account is currently inactive. You cannot use it until you visit the following link: + +{U_ACTIVATE} + + +Thank you for registering. + +{EMAIL_SIG} \ No newline at end of file diff --git a/phpBB/language/en/groups.php b/phpBB/language/en/groups.php index 0186ce0ad1..2e857d94b5 100644 --- a/phpBB/language/en/groups.php +++ b/phpBB/language/en/groups.php @@ -1,17 +1,18 @@ 'Unlocked topic
» %s', 'LOG_UNLOCK_POST' => 'Unlocked post
» %s', 'LOG_UNRATE' => 'Unrated post
» %s', + 'LOG_USER_LOCK' => 'User locked own topic
» %s', 'LOGVIEW_VIEWTOPIC' => 'View Topic', 'LOGVIEW_VIEWLOGS' => 'View Topic Log', 'LOGVIEW_VIEWFORUM' => 'View Forum', diff --git a/phpBB/language/en/memberlist.php b/phpBB/language/en/memberlist.php index 7606be0887..25d68b8215 100644 --- a/phpBB/language/en/memberlist.php +++ b/phpBB/language/en/memberlist.php @@ -1,17 +1,18 @@ 'Your account has been created but has to be approved, please check your email for details.', 'ACCOUNT_INACTIVE' => 'Your account has been created. However, this forum requires account activation, an activation key has been sent to the email address you provided. Please check your email for further information', 'ACCOUNT_INACTIVE_ADMIN' => 'Your account has been created. However, this forum requires account activation by the administrator. An email has been sent to them and you will be informed when your account has been activated', + 'ACTIVATION_EMAIL_SENT' => 'The activation email has been sent to your email address', 'ADD' => 'Add', 'ADD_BCC' => 'Add [Bcc]', 'ADD_FOES' => 'Add new foes', @@ -305,6 +307,7 @@ $lang += array( 'SORT_POST_TIME' => 'Post Time', 'SORT_SIZE' => 'Filesize', + 'TERMS_OF_USE_CONTENT' => 'While the administrators and moderators of this forum will attempt to remove or edit any generally objectionable material as quickly as possible, it is impossible to review every message. Therefore you acknowledge that all posts made to these forums express the views and opinions of the author and not the administrators, moderators or webmaster (except for posts by these people) and hence will not be held liable.

You agree not to post any abusive, obscene, vulgar, slanderous, hateful, threatening, sexually-orientated or any other material that may violate any applicable laws. Doing so may lead to you being immediately and permanently banned (and your service provider being informed). The IP address of all posts is recorded to aid in enforcing these conditions. You agree that the webmaster, administrator and moderators of this forum have the right to remove, edit, move or close any topic at any time should they see fit. As a user you agree to any information you have entered above being stored in a database. While this information will not be disclosed to any third party without your consent the webmaster, administrator and moderators cannot be held responsible for any hacking attempt that may lead to the data being compromised.

This forum system uses cookies to store information on your local computer. These cookies do not contain any of the information you have entered above, they serve only to improve your viewing pleasure. The email address is used only for confirming your registration details and password (and for sending new passwords should you forget your current one).

By clicking Register below you agree to be bound by these conditions.', 'TIMEZONE' => 'Timezone', 'TO' => 'To', 'TOO_MANY_RECIPIENTS' => 'Too many recipients', @@ -312,7 +315,6 @@ $lang += array( 'UCP' => 'User Control Panel', 'UCP_ADMIN_ACTIVATE' => 'Please note that you will need to enter a valid email address before your account is activated. The administrator will review your account and if approved you will an email at the address you specified.', - 'UCP_AGREEMENT' => 'While the administrators and moderators of this forum will attempt to remove or edit any generally objectionable material as quickly as possible, it is impossible to review every message. Therefore you acknowledge that all posts made to these forums express the views and opinions of the author and not the administrators, moderators or webmaster (except for posts by these people) and hence will not be held liable.

You agree not to post any abusive, obscene, vulgar, slanderous, hateful, threatening, sexually-orientated or any other material that may violate any applicable laws. Doing so may lead to you being immediately and permanently banned (and your service provider being informed). The IP address of all posts is recorded to aid in enforcing these conditions. You agree that the webmaster, administrator and moderators of this forum have the right to remove, edit, move or close any topic at any time should they see fit. As a user you agree to any information you have entered above being stored in a database. While this information will not be disclosed to any third party without your consent the webmaster, administrator and moderators cannot be held responsible for any hacking attempt that may lead to the data being compromised.

This forum system uses cookies to store information on your local computer. These cookies do not contain any of the information you have entered above, they serve only to improve your viewing pleasure. The email address is used only for confirming your registration details and password (and for sending new passwords should you forget your current one).

By clicking Register below you agree to be bound by these conditions.', 'UCP_AIM' => 'AOL Instant Messenger', 'UCP_ATTACHMENTS' => 'Attachments', 'UCP_COPPA_BEFORE' => 'Before %s', @@ -350,6 +352,7 @@ $lang += array( 'UCP_REGISTER_DISABLE' => 'Creating a new account is currently not possible.', 'UCP_REMIND' => 'Send password', + 'UCP_RESEND' => 'Send activation email', 'UCP_WATCHED' => 'Watched items', 'UCP_WELCOME' => 'Welcome to the User Control Panel. From here you can monitor, view and update your profile, preferences, subscribed forums and topics. You can also send messages to other users (if permitted). Please ensure you read any announcements before continuing.', 'UCP_YIM' => 'Yahoo Messenger', diff --git a/phpBB/language/en/viewforum.php b/phpBB/language/en/viewforum.php index 0769970918..602a98682d 100644 --- a/phpBB/language/en/viewforum.php +++ b/phpBB/language/en/viewforum.php @@ -1,17 +1,18 @@ start(); @@ -438,7 +438,9 @@ switch ($mode) // // LITTLE HELPER -// request_var, the array way +/** +* request_var, the array way +*/ function get_array($var, $default_value) { $ids = request_var($var, $default_value); @@ -463,7 +465,9 @@ function get_array($var, $default_value) return $ids; } -// Build simple hidden fields from array +/** +* Build simple hidden fields from array +*/ function build_hidden_fields($field_ary) { $s_hidden_fields = ''; @@ -486,7 +490,9 @@ function build_hidden_fields($field_ary) return $s_hidden_fields; } -// Get simple topic data +/** +* Get simple topic data +*/ function get_topic_data($topic_ids, $acl_list = false) { global $auth, $db; @@ -516,7 +522,9 @@ function get_topic_data($topic_ids, $acl_list = false) return $rowset; } -// Get simple post data +/** +* Get simple post data +*/ function get_post_data($post_ids, $acl_list = false) { global $db, $auth; @@ -549,6 +557,9 @@ function get_post_data($post_ids, $acl_list = false) return $rowset; } +/** +* Get simple forum data +*/ function get_forum_data($forum_id, $acl_list = 'f_list') { global $auth, $db; @@ -576,6 +587,9 @@ function get_forum_data($forum_id, $acl_list = 'f_list') return $rowset; } +/** +* sorting in mcp +*/ function mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql, &$sort_order_sql, &$total, $forum_id = 0, $topic_id = 0, $where_sql = 'WHERE') { global $db, $user, $auth, $template; @@ -732,7 +746,9 @@ function mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql, } } -// +/** +* Validate ids +*/ function check_ids(&$ids, $table, $sql_id, $acl_list = false) { global $db, $auth; diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index 3e0cffa1b8..f7eca2d264 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -1,18 +1,15 @@ send(NOTIFY_IM); - $messenger->queue->save(); + $messenger->save_queue(); $s_select = 'S_SENT_JABBER'; } @@ -591,7 +588,7 @@ switch ($mode) ); $messenger->send($row['user_notify_type']); - $messenger->queue->save(); + $messenger->save_queue(); meta_refresh(3, "index.$phpEx$SID"); $message = (!$topic_id) ? sprintf($user->lang['RETURN_INDEX'], '', '') : sprintf($user->lang['RETURN_TOPIC'], "', ''); @@ -650,7 +647,7 @@ switch ($mode) // Additional sorting options for user search ... if search is enabled, if not // then only admins can make use of this (for ACP functionality) - $sql_where = $form = $field = ''; + $sql_from = $sql_where = $form = $field = ''; if ($mode == 'searchuser' && ($config['load_search'] || $auth->acl_get('a_'))) { $form = request_var('form', ''); @@ -669,7 +666,7 @@ switch ($mode) $count_select = request_var('count_select', 'eq'); $joined = explode('-', request_var('joined', '')); $active = explode('-', request_var('active', '')); - $count = request_var('count', 0); + $count = (request_var('count', '')) ? request_var('count', 0) : ''; $ipdomain = request_var('ip', ''); $find_key_match = array('lt' => '<', 'gt' => '>', 'eq' => '='); @@ -697,14 +694,14 @@ switch ($mode) $s_find_active_time .= ''; } - $sql_where .= ($username) ? " AND u.username LIKE '" . str_replace('*', '%', $db->sql_escape($username)) ."'" : ''; - $sql_where .= ($email) ? " AND u.user_email LIKE '" . str_replace('*', '%', $db->sql_escape($email)) ."' " : ''; - $sql_where .= ($icq) ? " AND u.user_icq LIKE '" . str_replace('*', '%', $db->sql_escape($icq)) ."' " : ''; - $sql_where .= ($aim) ? " AND u.user_aim LIKE '" . str_replace('*', '%', $db->sql_escape($aim)) ."' " : ''; - $sql_where .= ($yahoo) ? " AND u.user_yim LIKE '" . str_replace('*', '%', $db->sql_escape($yahoo)) ."' " : ''; - $sql_where .= ($msn) ? " AND u.user_msnm LIKE '" . str_replace('*', '%', $db->sql_escape($msn)) ."' " : ''; + $sql_where .= ($username) ? " AND u.username LIKE '" . str_replace('*', '%', $db->sql_escape($username)) . "'" : ''; + $sql_where .= ($email) ? " AND u.user_email LIKE '" . str_replace('*', '%', $db->sql_escape($email)) . "' " : ''; + $sql_where .= ($icq) ? " AND u.user_icq LIKE '" . str_replace('*', '%', $db->sql_escape($icq)) . "' " : ''; + $sql_where .= ($aim) ? " AND u.user_aim LIKE '" . str_replace('*', '%', $db->sql_escape($aim)) . "' " : ''; + $sql_where .= ($yahoo) ? " AND u.user_yim LIKE '" . str_replace('*', '%', $db->sql_escape($yahoo)) . "' " : ''; + $sql_where .= ($msn) ? " AND u.user_msnm LIKE '" . str_replace('*', '%', $db->sql_escape($msn)) . "' " : ''; $sql_where .= ($jabber) ? " AND u.user_jabber LIKE '" . str_replace('*', '%', $db->sql_escape($jabber)) . "' " : ''; - $sql_where .= ($count) ? " AND u.user_posts " . $find_key_match[$count_select] . " $count " : ''; + $sql_where .= (is_numeric($count)) ? ' AND u.user_posts ' . $find_key_match[$count_select] . ' ' . (int) $count . ' ' : ''; $sql_where .= (sizeof($joined) > 1) ? " AND u.user_regdate " . $find_key_match[$joined_select] . ' ' . gmmktime(0, 0, 0, intval($joined[1]), intval($joined[2]), intval($joined[0])) : ''; $sql_where .= (sizeof($active) > 1) ? " AND u.user_lastvisit " . $find_key_match[$active_select] . ' ' . gmmktime(0, 0, 0, $active[1], intval($active[2]), intval($active[0])) : ''; @@ -738,7 +735,6 @@ switch ($mode) // Are we looking at a usergroup? If so, fetch additional info // and further restrict the user info query - $sql_from = $sql_where = ''; if ($mode == 'group') { $sql = 'SELECT * @@ -970,9 +966,9 @@ make_jumpbox('viewforum.'.$phpEx); page_footer(); -// --------- -// FUNCTIONS -// +/** +* Prepare profile data +*/ function show_profile($data) { global $config, $auth, $template, $user, $ranks, $SID, $phpEx, $phpbb_root_path; @@ -983,7 +979,7 @@ function show_profile($data) $rank_title = $rank_img = ''; if (!empty($data['user_rank'])) { - $rank_title = $ranks['special'][$data['user_rank']]['rank_title']; + $rank_title = (isset($ranks['special'][$data['user_rank']]['rank_title'])) ? $ranks['special'][$data['user_rank']]['rank_title'] : ''; $rank_img = (!empty($ranks['special'][$data['user_rank']]['rank_image'])) ? '' . $ranks['special'][$data['user_rank']]['rank_title'] . '
' : ''; } else @@ -1042,8 +1038,5 @@ function show_profile($data) 'S_ONLINE' => (intval($data['session_time']) >= time() - 300) ? true : false ); } -// -// FUNCTIONS -// --------- ?> \ No newline at end of file diff --git a/phpBB/posting.php b/phpBB/posting.php index fe2f977630..4a6a8b91c1 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -1,16 +1,15 @@ display('popup'); } -// -// FUNCTIONS -// --------- - ?> \ No newline at end of file diff --git a/phpBB/report.php b/phpBB/report.php index cd4727adfa..d97cf4c755 100644 --- a/phpBB/report.php +++ b/phpBB/report.php @@ -1,16 +1,15 @@ send($notify_row['notify_type']); $messenger->reset(); - if ($messenger->queue) - { - $messenger->queue->save(); - } + $messenger->save_queue(); } else { diff --git a/phpBB/search.php b/phpBB/search.php index 91877d98cd..e218c61a62 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -1,22 +1,19 @@ {L_PASSWORD}: -
{L_FORGOT_PASS} + + +
{L_FORGOT_PASS} +
{L_RESEND_ACTIVATION} + diff --git a/phpBB/styles/subSilver/template/ucp_agreement.html b/phpBB/styles/subSilver/template/ucp_agreement.html index bddda95fe0..6348b4b609 100644 --- a/phpBB/styles/subSilver/template/ucp_agreement.html +++ b/phpBB/styles/subSilver/template/ucp_agreement.html @@ -10,7 +10,7 @@ - +
{SITENAME} - {REGISTRATION}{SITENAME} - {L_REGISTRATION}
@@ -18,7 +18,7 @@ -

{L_COPPA_BIRTHDAY}

{L_COPPA_NO} :: {L_COPPA_YES}


{L_AGREEMENT}

+

{L_TERMS_OF_USE}



diff --git a/phpBB/styles/subSilver/template/ucp_resend.html b/phpBB/styles/subSilver/template/ucp_resend.html new file mode 100644 index 0000000000..86c3c99503 --- /dev/null +++ b/phpBB/styles/subSilver/template/ucp_resend.html @@ -0,0 +1,22 @@ + + +
+ + + + + + + + + + + + + + + + +
{L_UCP_RESEND}
{L_USERNAME}:
{L_EMAIL_ADDRESS}:
{L_EMAIL_REMIND}
{S_HIDDEN_FIELDS}  
+ + \ No newline at end of file diff --git a/phpBB/ucp.php b/phpBB/ucp.php index a85155164f..515d36579e 100755 --- a/phpBB/ucp.php +++ b/phpBB/ucp.php @@ -1,35 +1,15 @@ setup('ucp'); $ucp = new module(); - - -// --------- -// FUNCTIONS -// +/** +* @package ucp +* UCP Module +*/ class module { var $id = 0; @@ -248,11 +227,6 @@ class module return false; } } -// -// FUNCTIONS -// --------- - - // Basic "global" modes switch ($mode) @@ -263,6 +237,11 @@ switch ($mode) redirect("index.$phpEx$SID"); break; + case 'resend_act': + $ucp->load('ucp', 'resend'); + $ucp->module->ucp_resend(); + break; + case 'sendpassword': $ucp->load('ucp', 'remind'); $ucp->module->ucp_remind(); @@ -304,6 +283,10 @@ switch ($mode) trigger_error($message); break; + case 'terms_of_use': + case 'privacy_statement': + break; + case 'delete_cookies': // Delete Cookies with dynamic names (do NOT delete poll cookies) if (confirm_box(true)) diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index 9e0e346394..1a9a91420b 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -1,16 +1,15 @@