diff --git a/phpBB/download.php b/phpBB/download.php index ccc23b94b8..3162068c53 100644 --- a/phpBB/download.php +++ b/phpBB/download.php @@ -24,6 +24,13 @@ $user->session_begin(false); $auth->acl($user->data); $user->setup('viewtopic'); +/* +$fp = fopen('session.txt', 'at'); +fwrite($fp, print_r($_GET, true)); +fwrite($fp, print_r($user->data, true)); +fclose($fp); +*/ + if (!$download_id) { trigger_error('NO_ATTACHMENT_SELECTED'); diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php index 956afdd7ae..f9fe924b39 100644 --- a/phpBB/includes/acp/acp_attachments.php +++ b/phpBB/includes/acp/acp_attachments.php @@ -535,10 +535,12 @@ class acp_attachments } $cat_lang = array( - ATTACHMENT_CATEGORY_NONE => $user->lang['NO_FILE_CAT'], - ATTACHMENT_CATEGORY_IMAGE => $user->lang['CAT_IMAGES'], - ATTACHMENT_CATEGORY_WM => $user->lang['CAT_WM_FILES'], - ATTACHMENT_CATEGORY_RM => $user->lang['CAT_RM_FILES'] + ATTACHMENT_CATEGORY_NONE => $user->lang['NO_FILE_CAT'], + ATTACHMENT_CATEGORY_IMAGE => $user->lang['CAT_IMAGES'], + ATTACHMENT_CATEGORY_WM => $user->lang['CAT_WM_FILES'], + ATTACHMENT_CATEGORY_RM => $user->lang['CAT_RM_FILES'], + ATTACHMENT_CATEGORY_FLASH => $user->lang['CAT_FLASH_FILES'], + ATTACHMENT_CATEGORY_QUICKTIME => $user->lang['CAT_QUICKTIME_FILES'], ); $group_id = request_var('g', 0); @@ -1016,10 +1018,12 @@ class acp_attachments global $db, $user; $types = array( - ATTACHMENT_CATEGORY_NONE => $user->lang['NO_FILE_CAT'], - ATTACHMENT_CATEGORY_IMAGE => $user->lang['CAT_IMAGES'], - ATTACHMENT_CATEGORY_WM => $user->lang['CAT_WM_FILES'], - ATTACHMENT_CATEGORY_RM => $user->lang['CAT_RM_FILES'] + ATTACHMENT_CATEGORY_NONE => $user->lang['NO_FILE_CAT'], + ATTACHMENT_CATEGORY_IMAGE => $user->lang['CAT_IMAGES'], + ATTACHMENT_CATEGORY_WM => $user->lang['CAT_WM_FILES'], + ATTACHMENT_CATEGORY_RM => $user->lang['CAT_RM_FILES'], + ATTACHMENT_CATEGORY_FLASH => $user->lang['CAT_FLASH_FILES'], + ATTACHMENT_CATEGORY_QUICKTIME => $user->lang['CAT_QUICKTIME_FILES'], ); if ($group_id) diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php index f4c869c40c..a390bd8212 100644 --- a/phpBB/includes/acp/acp_groups.php +++ b/phpBB/includes/acp/acp_groups.php @@ -317,7 +317,7 @@ class acp_groups { if (isset($group_row['group_avatar']) && $group_row['group_avatar']) { - avatar_delete($group_row['group_avatar']); + avatar_delete('group', $group_row); } } diff --git a/phpBB/includes/acp/acp_language.php b/phpBB/includes/acp/acp_language.php index 896dc75f69..c901c73ddc 100644 --- a/phpBB/includes/acp/acp_language.php +++ b/phpBB/includes/acp/acp_language.php @@ -47,8 +47,10 @@ class acp_language $missing_file = request_var('missing_file', array('' => 0)); list($_REQUEST['language_file'], ) = array_keys($missing_file); } - - list($this->language_directory, $this->language_file) = explode('|', request_var('language_file', '|common.' . $phpEx)); + + $selected_lang_file = request_var('language_file', '|common.' . $phpEx); + + list($this->language_directory, $this->language_file) = explode('|', $selected_lang_file); $this->language_directory = basename($this->language_directory); $this->language_file = basename($this->language_file); @@ -201,7 +203,7 @@ class acp_language if (!$fp) { - trigger_error(sprintf($user->lang['UNABLE_TO_WRITE_FILE'], $filename) . adm_back_link($this->u_action), E_USER_WARNING); + trigger_error(sprintf($user->lang['UNABLE_TO_WRITE_FILE'], $filename) . adm_back_link($this->u_action . '&id=' . $lang_id . '&language_file=' . urlencode($selected_lang_file)), E_USER_WARNING); } if ($this->language_directory == 'email') @@ -285,6 +287,8 @@ class acp_language $file = request_var('file', ''); $dir = request_var('dir', ''); + $selected_lang_file = $dir . '|' . $file; + $old_file = '/' . $this->get_filename($row['lang_iso'], $dir, $file, false, true); $lang_path = 'language/' . $row['lang_iso'] . '/' . (($dir) ? $dir . '/' : ''); @@ -308,7 +312,7 @@ class acp_language if (($result = $transfer->open_session()) !== true) { - trigger_error($user->lang[$result] . adm_back_link($this->u_action), E_USER_WARNING); + trigger_error($user->lang[$result] . adm_back_link($this->u_action . '&action=details&id=' . $lang_id . '&language_file=' . urlencode($selected_lang_file)), E_USER_WARNING); } $transfer->rename($lang_path . $file, $lang_path . $file . '.bak'); @@ -320,7 +324,7 @@ class acp_language add_log('admin', 'LOG_LANGUAGE_FILE_REPLACED', $file); - trigger_error($user->lang['UPLOAD_COMPLETED'] . adm_back_link($this->u_action)); + trigger_error($user->lang['UPLOAD_COMPLETED'] . adm_back_link($this->u_action . '&action=details&id=' . $lang_id . '&language_file=' . urlencode($selected_lang_file))); } $action = 'details'; diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index 4bd230458b..4506c8f7c7 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -276,7 +276,8 @@ class acp_main { $sql = 'SELECT COUNT(attach_id) AS total_orphan FROM ' . ATTACHMENTS_TABLE . ' - WHERE is_orphan = 1'; + WHERE is_orphan = 1 + AND filetime < ' . (time() - 3*60*60); $result = $db->sql_query($sql); $total_orphan = (int) $db->sql_fetchfield('total_orphan'); $db->sql_freeresult($result); diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index 1ba433a777..9e49e986e7 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -397,9 +397,12 @@ pagination_sep = \'{PAGINATION_SEP}\' } unset($cfg_data); - $sql = 'UPDATE ' . STYLES_IMAGESET_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " - WHERE imageset_id = $style_id"; - $db->sql_query($sql); + if (sizeof($sql_ary)) + { + $sql = 'UPDATE ' . STYLES_IMAGESET_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE imageset_id = $style_id"; + $db->sql_query($sql); + } $cache->destroy('sql', STYLES_IMAGESET_TABLE); @@ -1845,7 +1848,7 @@ pagination_sep = \'{PAGINATION_SEP}\' { foreach ($key_array as $key) { - $imageset_cfg .= "\n" . $key . ' = ' . str_replace("styles/{$style_row['imageset_path']}/imageset/", '{PATH}', $style_row[$key]); + $imageset_cfg .= "\nimg_" . $key . ' = ' . str_replace("styles/{$style_row['imageset_path']}/imageset/", '{PATH}', $style_row[$key]); } } diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 94d24e6505..7cdd86d612 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -389,7 +389,7 @@ class acp_users // Delete old avatar if present if ($user_row['user_avatar'] && $user_row['user_avatar_type'] != AVATAR_GALLERY) { - avatar_delete($user_row['user_avatar']); + avatar_delete('user', $user_row); } add_log('admin', 'LOG_USER_DEL_AVATAR', $user_row['username']); @@ -1476,7 +1476,7 @@ class acp_users // Delete old avatar if present if ($user_row['user_avatar'] && $filename != $user_row['user_avatar'] && $user_row['user_avatar_type'] != AVATAR_GALLERY) { - avatar_delete($user_row['user_avatar']); + avatar_delete('user', $user_row); } } diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php index ae121fa017..652bda40a6 100644 --- a/phpBB/includes/constants.php +++ b/phpBB/includes/constants.php @@ -130,7 +130,8 @@ define('ATTACHMENT_CATEGORY_IMAGE', 1); // Inline Images define('ATTACHMENT_CATEGORY_WM', 2); // Windows Media Files - Streaming define('ATTACHMENT_CATEGORY_RM', 3); // Real Media Files - Streaming define('ATTACHMENT_CATEGORY_THUMB', 4); // Not used within the database, only while displaying posts -//define('SWF_CAT', 5); // Replaced by [flash]? or an additional possibility? +define('ATTACHMENT_CATEGORY_FLASH', 5); // Flash/SWF files +define('ATTACHMENT_CATEGORY_QUICKTIME', 6); // Quicktime/Mov files // BBCode UID length define('BBCODE_UID_LEN', 5); diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 58f5c5e4a6..b0d76fff4c 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -1945,6 +1945,7 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa 'U_PRIVACY' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=privacy'), 'S_DISPLAY_FULL_LOGIN' => ($s_display) ? true : false, + 'S_AUTOLOGIN_ENABLED' => ($config['allow_autologin']) ? true : false, 'S_LOGIN_ACTION' => (!$admin) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login') : append_sid("index.$phpEx", false, true, $user->session_id), // Needs to stay index.$phpEx because we are within the admin directory 'S_HIDDEN_FIELDS' => $s_hidden_fields, 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; diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index a5579c40f5..dd9b1d7afa 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -837,6 +837,8 @@ function display_attachments($forum_id, $blockname, &$attachment_data, &$update_ $download_link = (!$force_physical && $attachment['attach_id']) ? append_sid("{$phpbb_root_path}download.$phpEx", 'id=' . $attachment['attach_id'] . '&f=' . $forum_id) : $filename; + $download_link_full = (!$force_physical && $attachment['attach_id']) ? generate_board_url() . append_sid("/download.$phpEx", 'id=' . $attachment['attach_id'] . '&f=' . $forum_id) : generate_board_url() . $filename; + switch ($display_cat) { // Images @@ -865,53 +867,51 @@ function display_attachments($forum_id, $blockname, &$attachment_data, &$update_ case ATTACHMENT_CATEGORY_WM: $l_downloaded_viewed = $user->lang['VIEWED']; - // The download link is slightly different, because somehow phpBB is not able to get the correct results if called - // within the wmp object (cookies are not present). - // $download_link = (!$force_physical && $attachment['attach_id']) ? generate_board_url() . append_sid("/download.$phpEx", 'id=' . $attachment['attach_id'] . '&f=' . $forum_id, false, $user->session_id) : $filename; - // Giving the filename directly because within the wm object all variables are in local context making it impossible // to validate against a valid session (all params can differ) $download_link = $filename; $block_array += array( + 'U_FORUM' => generate_board_url(), 'S_WM_FILE' => true, ); - // Viewed/Heared File ... update the download count (download.php is not called here) + // Viewed/Heared File ... update the download count $update_count[] = $attachment['attach_id']; break; // Real Media Streams case ATTACHMENT_CATEGORY_RM: + case ATTACHMENT_CATEGORY_QUICKTIME: $l_downloaded_viewed = $user->lang['VIEWED']; $block_array += array( - 'S_RM_FILE' => true, - 'U_FORUM' => generate_board_url(), - 'ATTACH_ID' => $attachment['attach_id'], + 'S_RM_FILE' => ($display_cat == ATTACHMENT_CATEGORY_RM) ? true : false, + 'S_QUICKTIME_FILE' => ($display_cat == ATTACHMENT_CATEGORY_QUICKTIME) ? true : false, + 'U_FORUM' => generate_board_url(), + 'ATTACH_ID' => $attachment['attach_id'], ); - // Viewed/Heared File ... update the download count (download.php is not called here) + // Viewed/Heared File ... update the download count $update_count[] = $attachment['attach_id']; break; -/* // Macromedia Flash Files - case SWF_CAT: - list($width, $height) = swf_getdimension($filename); + // Macromedia Flash Files + case ATTACHMENT_CATEGORY_FLASH: + list($width, $height) = @getimagesize($filename); $l_downloaded_viewed = $user->lang['VIEWED']; - $download_link = $filename; $block_array += array( - 'S_SWF_FILE' => true, + 'S_FLASH_FILE' => true, 'WIDTH' => $width, 'HEIGHT' => $height, ); - // Viewed/Heared File ... update the download count (download.php is not called here) + // Viewed/Heared File ... update the download count $update_count[] = $attachment['attach_id']; break; -*/ + default: $l_downloaded_viewed = $user->lang['DOWNLOADED']; diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php index 5d5f004064..89dda74700 100644 --- a/phpBB/includes/functions_module.php +++ b/phpBB/includes/functions_module.php @@ -256,9 +256,9 @@ class p_master // If no category or module selected, go active for first module in first category if ( (($item_ary['name'] === $id || $item_ary['id'] === (int) $id) && (($item_ary['mode'] == $mode && !$item_ary['cat']) || ($icat && $item_ary['cat']))) || - ($item_ary['parent'] === $category && !$item_ary['cat'] && !$icat) || + ($item_ary['parent'] === $category && !$item_ary['cat'] && !$icat && $item_ary['display']) || (($item_ary['name'] === $id || $item_ary['id'] === (int) $id) && !$mode && !$item_ary['cat']) || - (!$id && !$mode && !$item_ary['cat']) + (!$id && !$mode && !$item_ary['cat'] && $item_ary['display']) ) { if ($item_ary['cat']) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 2bdc109b96..fccad678a9 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -111,7 +111,7 @@ function update_post_information($type, $ids, $return_update_sql = false) $ids = array($ids); } - $update_sql = $empty_forums = array(); + $update_sql = $empty_forums = $not_empty_forums = array(); if (sizeof($ids) == 1) { @@ -140,7 +140,12 @@ function update_post_information($type, $ids, $return_update_sql = false) if ($type == 'forum') { - $empty_forums[] = $row['forum_id']; + $not_empty_forums[] = $row['forum_id']; + + if (empty($row['last_post_id'])) + { + $empty_forums[] = $row['forum_id']; + } } $last_post_ids[] = $row['last_post_id']; @@ -149,7 +154,7 @@ function update_post_information($type, $ids, $return_update_sql = false) if ($type == 'forum') { - $empty_forums = array_diff($ids, $empty_forums); + $empty_forums = array_merge($empty_forums, array_diff($ids, $not_empty_forums)); foreach ($empty_forums as $void => $forum_id) { diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index c9f5b5faf7..f851fde3e0 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -344,7 +344,7 @@ function user_delete($mode, $user_id, $post_username = false) break; } - $table_ary = array(USERS_TABLE, USER_GROUP_TABLE, TOPICS_WATCH_TABLE, FORUMS_WATCH_TABLE, ACL_USERS_TABLE, TOPICS_TRACK_TABLE, TOPICS_POSTED_TABLE, FORUMS_TRACK_TABLE, PROFILE_FIELDS_DATA_TABLE); + $table_ary = array(USERS_TABLE, USER_GROUP_TABLE, TOPICS_WATCH_TABLE, FORUMS_WATCH_TABLE, ACL_USERS_TABLE, TOPICS_TRACK_TABLE, TOPICS_POSTED_TABLE, FORUMS_TRACK_TABLE, PROFILE_FIELDS_DATA_TABLE, MODERATOR_CACHE_TABLE); foreach ($table_ary as $table) { @@ -353,6 +353,8 @@ function user_delete($mode, $user_id, $post_username = false) $db->sql_query($sql); } + $cache->destroy('sql', MODERATOR_CACHE_TABLE); + include_once($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx); // Remove any undelivered mails... @@ -1241,13 +1243,23 @@ function validate_email($email) /** * Remove avatar */ -function avatar_delete($id) +function avatar_delete($mode, $row) { global $phpbb_root_path, $config, $db, $user; - if (file_exists($phpbb_root_path . $config['avatar_path'] . '/' . basename($id))) + // Check if the users avatar is actually *not* a group avatar + if ($mode == 'user') { - @unlink($phpbb_root_path . $config['avatar_path'] . '/' . basename($id)); + if (strpos($row['user_avatar'], 'g' . $row['group_id'] . '_') === 0 || strpos($row['user_avatar'], $row['user_id'] . '_') !== 0) + { + return false; + } + } + + if (file_exists($phpbb_root_path . $config['avatar_path'] . '/' . basename($row[$mode . '_avatar']))) + { + @unlink($phpbb_root_path . $config['avatar_path'] . '/' . basename($row[$mode . '_avatar'])); + return true; } return false; @@ -1616,7 +1628,7 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow */ function group_delete($group_id, $group_name = false) { - global $db; + global $db, $phpbb_root_path, $phpEx; if (!$group_name) { @@ -1668,6 +1680,11 @@ function group_delete($group_id, $group_name = false) $db->sql_query($sql); // Re-cache moderators + if (!function_exists('cache_moderators')) + { + include($phpbb_root_path . 'includes/functions_admin.' . $phpEx); + } + cache_moderators(); add_log('admin', 'LOG_GROUP_DELETE', $group_name); @@ -2056,7 +2073,7 @@ function group_set_user_default($group_id, $user_id_ary, $group_attributes = fal if (in_array('user_avatar', array_keys($sql_ary))) { // Ok, get the original avatar data from users having an uploaded one (we need to remove these from the filesystem) - $sql = 'SELECT user_id, user_avatar + $sql = 'SELECT user_id, group_id, user_avatar FROM ' . USERS_TABLE . ' WHERE ' . $db->sql_in_set('user_id', $user_id_ary) . ' AND user_avatar_type = ' . AVATAR_UPLOAD; @@ -2064,7 +2081,7 @@ function group_set_user_default($group_id, $user_id_ary, $group_attributes = fal while ($row = $db->sql_fetchrow($result)) { - avatar_delete($row['user_avatar']); + avatar_delete('user', $row); } $db->sql_freeresult($result); } @@ -2073,18 +2090,21 @@ function group_set_user_default($group_id, $user_id_ary, $group_attributes = fal WHERE ' . $db->sql_in_set('user_id', $user_id_ary); $db->sql_query($sql); - // Update any cached colour information for these users - $sql = 'UPDATE ' . FORUMS_TABLE . " SET forum_last_poster_colour = '" . $db->sql_escape($sql_ary['user_colour']) . "' - WHERE " . $db->sql_in_set('forum_last_poster_id', $user_id_ary); - $db->sql_query($sql); + if (in_array('user_colour', array_keys($sql_ary))) + { + // Update any cached colour information for these users + $sql = 'UPDATE ' . FORUMS_TABLE . " SET forum_last_poster_colour = '" . $db->sql_escape($sql_ary['user_colour']) . "' + WHERE " . $db->sql_in_set('forum_last_poster_id', $user_id_ary); + $db->sql_query($sql); - $sql = 'UPDATE ' . TOPICS_TABLE . " SET topic_first_poster_colour = '" . $db->sql_escape($sql_ary['user_colour']) . "' - WHERE " . $db->sql_in_set('topic_poster', $user_id_ary); - $db->sql_query($sql); + $sql = 'UPDATE ' . TOPICS_TABLE . " SET topic_first_poster_colour = '" . $db->sql_escape($sql_ary['user_colour']) . "' + WHERE " . $db->sql_in_set('topic_poster', $user_id_ary); + $db->sql_query($sql); - $sql = 'UPDATE ' . TOPICS_TABLE . " SET topic_last_poster_colour = '" . $db->sql_escape($sql_ary['user_colour']) . "' - WHERE " . $db->sql_in_set('topic_last_poster_id', $user_id_ary); - $db->sql_query($sql); + $sql = 'UPDATE ' . TOPICS_TABLE . " SET topic_last_poster_colour = '" . $db->sql_escape($sql_ary['user_colour']) . "' + WHERE " . $db->sql_in_set('topic_last_poster_id', $user_id_ary); + $db->sql_query($sql); + } } /** @@ -2224,6 +2244,10 @@ function group_update_listings($group_id) if ($mod_permissions) { + if (!function_exists('cache_moderators')) + { + include($phpbb_root_path . 'includes/functions_admin.' . $phpEx); + } cache_moderators(); } diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php index a845a64016..3669e9ad02 100755 --- a/phpBB/includes/search/fulltext_native.php +++ b/phpBB/includes/search/fulltext_native.php @@ -199,7 +199,7 @@ class fulltext_native extends search_backend { if ($row['word_common']) { - $this->common_words[] = $row['wort_text']; + $this->common_words[] = $row['word_text']; continue; } diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php index 2d867177d5..810fe4c7ee 100644 --- a/phpBB/includes/ucp/ucp_groups.php +++ b/phpBB/includes/ucp/ucp_groups.php @@ -496,7 +496,7 @@ class ucp_groups { if (isset($group_row['group_avatar']) && $group_row['group_avatar']) { - avatar_delete($group_row['group_avatar']); + avatar_delete('group', $group_row); } } diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index cabe813f96..376573d059 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -597,11 +597,7 @@ class ucp_profile // Delete old avatar if present if ($user->data['user_avatar'] && $filename != $user->data['user_avatar'] && $user->data['user_avatar_type'] != AVATAR_GALLERY) { - // Check if the users avatar is actually a group avatar - if (strpos($user->data['user_avatar'], 'g' . $user->data['group_id'] . '_') !== 0 && strpos($user->data['user_avatar'], $user->data['user_id'] . '_') === 0) - { - avatar_delete($user->data['user_avatar']); - } + avatar_delete('user', $user->data); } } diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php index e3e1315721..22f9c86f40 100644 --- a/phpBB/includes/ucp/ucp_register.php +++ b/phpBB/includes/ucp/ucp_register.php @@ -47,6 +47,9 @@ class ucp_register $user->lang_path = $phpbb_root_path . 'language/' . $lang . '/'; $user->lang = array(); $user->add_lang(array('common', 'ucp')); + + // Setting back agreed to let the user view the agreement in his/her language + $agreed = (empty($_GET['change_lang'])) ? 0 : $agreed; } else { @@ -61,6 +64,8 @@ class ucp_register // if (!$agreed) { + $add_lang = ($change_lang) ? '&change_lang=' . urlencode($change_lang) : ''; + if ($coppa === false && $config['coppa_enable']) { $now = getdate(); @@ -71,11 +76,12 @@ class ucp_register 'L_COPPA_NO' => sprintf($user->lang['UCP_COPPA_BEFORE'], $coppa_birthday), 'L_COPPA_YES' => sprintf($user->lang['UCP_COPPA_ON_AFTER'], $coppa_birthday), - 'U_COPPA_NO' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register&coppa=0'), - 'U_COPPA_YES' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register&coppa=1'), + 'U_COPPA_NO' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register&coppa=0' . $add_lang), + 'U_COPPA_YES' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register&coppa=1' . $add_lang), 'S_SHOW_COPPA' => true, - 'S_REGISTER_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register')) + 'S_HIDDEN_FIELDS' => ($confirm_id) ? '' : '', + 'S_UCP_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register' . $add_lang)) ); } else @@ -85,7 +91,8 @@ class ucp_register 'S_SHOW_COPPA' => false, 'S_REGISTRATION' => true, - 'S_REGISTER_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register')) + 'S_HIDDEN_FIELDS' => ($confirm_id) ? '' : '', + 'S_UCP_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register' . $add_lang)) ); } @@ -93,6 +100,16 @@ class ucp_register return; } + // Try to manually determine the timezone + $timezone = date('Z') / 3600; + $is_dst = date('I'); + $timezone = ($is_dst) ? $timezone - 1 : $timezone; + + if (!isset($user->lang['tz_zones'][(string) $timezone])) + { + $timezone = $config['board_timezone']; + } + $var_ary = array( 'username' => (string) '', 'password_confirm' => (string) '', @@ -101,8 +118,8 @@ class ucp_register 'email' => (string) '', 'email_confirm' => (string) '', 'confirm_code' => (string) '', - 'lang' => (string) $config['default_lang'], - 'tz' => (float) $config['board_timezone'], + 'lang' => (string) $user->lang_name, + 'tz' => (float) $timezone, ); // If we change the language inline, we do not want to display errors, but pre-fill already filled out values @@ -263,6 +280,7 @@ class ucp_register 'user_email' => $email, 'group_id' => (int) $group_id, 'user_timezone' => (float) $tz, + 'user_dst' => $is_dst, 'user_lang' => $lang, 'user_type' => $user_type, 'user_actkey' => $user_actkey, @@ -351,7 +369,7 @@ class ucp_register if (sizeof($admin_ary)) { - $where_sql .= ' OR ' . $db->sql_in_set('user_id', $admin_ary[0]['a_user']); + $where_sql .= ' OR ' . $db->sql_in_set('user_id', $admin_ary); } $sql = 'SELECT user_id, username, user_email, user_lang, user_jabber, user_notify_type @@ -472,7 +490,7 @@ class ucp_register $pass_char_ary = array('.*' => 'PASS_TYPE_ANY', '[a-zA-Z]' => 'PASS_TYPE_CASE', '[a-zA-Z0-9]' => 'PASS_TYPE_ALPHA', '[a-zA-Z\W]' => 'PASS_TYPE_SYMBOL'); $lang = (isset($lang)) ? $lang : $config['default_lang']; - $tz = (isset($tz)) ? $tz : $config['board_timezone']; + $tz = (isset($tz)) ? $tz : $timezone; // $template->assign_vars(array( diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index 0ca9824203..95d3adb9c0 100755 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -1394,6 +1394,21 @@ class install_install extends module $_module->move_module_by($row, 'move_up', 5); } + if ($module_class == 'ucp') + { + // Move attachment module 4 down... + $sql = 'SELECT * + FROM ' . MODULES_TABLE . " + WHERE module_basename = 'attachments' + AND module_class = 'ucp' + AND module_mode = 'attachments'"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $_module->move_module_by($row, 'move_down', 4); + } + // And now for the special ones // (these are modules which appear in multiple categories and thus get added manually to some for more control) if (isset($this->module_extras[$module_class])) diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index 15f12f2d4a..3feb804b67 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -635,8 +635,11 @@ INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mo INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('Archives', 0, 1, 1, '', 0, ''); INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('Plain Text', 0, 0, 1, '', 0, ''); INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('Documents', 0, 0, 1, '', 0, ''); -INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('Real Media', 3, 0, 2, '', 0, ''); +INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('Real Media', 3, 0, 1, '', 0, ''); INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('Windows Media', 2, 0, 1, '', 0, ''); +INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('Flash Files', 5, 0, 1, '', 0, ''); +INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('Quicktime Media', 6, 0, 1, '', 0, ''); +INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('Downloadable Files', 0, 0, 1, '', 0, ''); # -- extensions INSERT INTO phpbb_extensions (group_id, extension) VALUES (1, 'gif'); @@ -644,19 +647,32 @@ INSERT INTO phpbb_extensions (group_id, extension) VALUES (1, 'png'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (1, 'jpeg'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (1, 'jpg'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (1, 'tif'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (1, 'tiff'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (1, 'tga'); + INSERT INTO phpbb_extensions (group_id, extension) VALUES (2, 'gtar'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (2, 'gz'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (2, 'tar'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (2, 'zip'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (2, 'rar'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (2, 'ace'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (2, 'torrent'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (2, 'tgz'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (2, 'bz2'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (2, '7z'); + INSERT INTO phpbb_extensions (group_id, extension) VALUES (3, 'txt'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (3, 'c'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (3, 'h'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (3, 'cpp'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (3, 'hpp'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (3, 'diz'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (3, 'csv'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (3, 'ini'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (3, 'log'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (3, 'js'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (3, 'xml'); + INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'xls'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'doc'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'dot'); @@ -664,8 +680,32 @@ INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'pdf'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'ai'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'ps'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'ppt'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'odg'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'odp'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'ods'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'odt'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'rtf'); + INSERT INTO phpbb_extensions (group_id, extension) VALUES (5, 'rm'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (5, 'ram'); + INSERT INTO phpbb_extensions (group_id, extension) VALUES (6, 'wma'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (6, 'wmv'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (7, 'swf'); + +INSERT INTO phpbb_extensions (group_id, extension) VALUES (8, 'mov'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (8, 'm4v'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (8, 'm4a'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (8, 'mp4'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (8, '3gp'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (8, '3g2'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (8, 'qt'); + +INSERT INTO phpbb_extensions (group_id, extension) VALUES (9, 'mpeg'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (9, 'mpg'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (9, 'mp3'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (9, 'ogg'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (9, 'ogm'); + # POSTGRES COMMIT # \ No newline at end of file diff --git a/phpBB/language/en/acp/attachments.php b/phpBB/language/en/acp/attachments.php index 0fe5c16375..d701a2d513 100644 --- a/phpBB/language/en/acp/attachments.php +++ b/phpBB/language/en/acp/attachments.php @@ -59,7 +59,9 @@ $lang = array_merge($lang, array( 'ATTACH_QUOTA_EXPLAIN' => 'Maximum drive space available for attachments in total, 0 is unlimited.', 'ATTACH_TO_POST' => 'Attach file to post', + 'CAT_FLASH_FILES' => 'Flash Files', 'CAT_IMAGES' => 'Images', + 'CAT_QUICKTIME_FILES' => 'Quicktime Media', 'CAT_RM_FILES' => 'Real Media Streams', 'CAT_WM_FILES' => 'Window Media Streams', 'CREATE_GROUP' => 'Create new group', diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php index 705682e94a..dc66d8261e 100644 --- a/phpBB/language/en/acp/board.php +++ b/phpBB/language/en/acp/board.php @@ -396,7 +396,7 @@ $lang = array_merge($lang, array( 'SMTP_DIGEST_MD5' => 'DIGEST-MD5', 'SMTP_LOGIN' => 'LOGIN', 'SMTP_PASSWORD' => 'SMTP Password', - 'SMTP_PASSWORD_EXPLAIN' => 'Only enter a password if your smtp server requires it.', + 'SMTP_PASSWORD_EXPLAIN' => 'Only enter a password if your SMTP server requires it.', 'SMTP_PLAIN' => 'PLAIN', 'SMTP_POP_BEFORE_SMTP' => 'POP-BEFORE-SMTP', 'SMTP_PORT' => 'SMTP Server Port', diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index 1ec3fb6091..40f62e4608 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -360,36 +360,37 @@ $lang = array_merge($lang, array( 'ONLINE_USER_TOTAL' => 'In total there is %d user online :: ', 'OPTIONS' => 'Options', - 'PAGE_OF' => 'Page %1$d of %2$d', - 'PASSWORD' => 'Password', - 'PM' => 'PM', - 'POSTING_MESSAGE' => 'Posting message in %s', - 'POST' => 'Post', - 'POST_ANNOUNCEMENT' => 'Announce', - 'POST_STICKY' => 'Sticky', - 'POSTED' => 'Posted', - 'POSTED_IN_FORUM' => 'in', - 'POSTED_ON_DATE' => 'on', - 'POSTS' => 'Posts', - 'POSTS_UNAPPROVED' => 'At least one post in this topic has not been approved', - 'POST_BY_AUTHOR' => 'by', - 'POST_BY_FOE' => 'This post was made by %1$s who is currently on your ignore list. %2$sDisplay this post%3$s.', - 'POST_DAY' => '%.2f posts per day', - 'POST_DETAILS' => 'Post details', - 'POST_NEW_TOPIC' => 'Post new topic', - 'POST_PCT' => '%.2f%% of all posts', - 'POST_PCT_ACTIVE' => '%.2f%% of your posts', - 'POST_REPORTED' => 'Click to view report', - 'POST_SUBJECT' => 'Post subject', - 'POST_TIME' => 'Post time', - 'POST_UNAPPROVED' => 'This post is waiting for approval', - 'PREVIEW' => 'Preview', - 'PREVIOUS' => 'Previous', - 'PRIVACY' => 'Privacy policy', - 'PRIVATE_MESSAGE' => 'Private Message', - 'PRIVATE_MESSAGES' => 'Private Messages', - 'PRIVATE_MESSAGING' => 'Private Messaging', - 'PROFILE' => 'User Control Panel', + 'PAGE_OF' => 'Page %1$d of %2$d', + 'PASSWORD' => 'Password', + 'PLAY_QUICKTIME_FILE' => 'Play quicktime file', + 'PM' => 'PM', + 'POSTING_MESSAGE' => 'Posting message in %s', + 'POST' => 'Post', + 'POST_ANNOUNCEMENT' => 'Announce', + 'POST_STICKY' => 'Sticky', + 'POSTED' => 'Posted', + 'POSTED_IN_FORUM' => 'in', + 'POSTED_ON_DATE' => 'on', + 'POSTS' => 'Posts', + 'POSTS_UNAPPROVED' => 'At least one post in this topic has not been approved', + 'POST_BY_AUTHOR' => 'by', + 'POST_BY_FOE' => 'This post was made by %1$s who is currently on your ignore list. %2$sDisplay this post%3$s.', + 'POST_DAY' => '%.2f posts per day', + 'POST_DETAILS' => 'Post details', + 'POST_NEW_TOPIC' => 'Post new topic', + 'POST_PCT' => '%.2f%% of all posts', + 'POST_PCT_ACTIVE' => '%.2f%% of your posts', + 'POST_REPORTED' => 'Click to view report', + 'POST_SUBJECT' => 'Post subject', + 'POST_TIME' => 'Post time', + 'POST_UNAPPROVED' => 'This post is waiting for approval', + 'PREVIEW' => 'Preview', + 'PREVIOUS' => 'Previous', + 'PRIVACY' => 'Privacy policy', + 'PRIVATE_MESSAGE' => 'Private Message', + 'PRIVATE_MESSAGES' => 'Private Messages', + 'PRIVATE_MESSAGING' => 'Private Messaging', + 'PROFILE' => 'User Control Panel', 'READING_FORUM' => 'Viewing topics in %s', 'READING_GLOBAL_ANNOUNCE' => 'Reading global announcement', diff --git a/phpBB/styles/subSilver/template/attachment.html b/phpBB/styles/subSilver/template/attachment.html index 4e91dcfde3..2f4ac0d268 100644 --- a/phpBB/styles/subSilver/template/attachment.html +++ b/phpBB/styles/subSilver/template/attachment.html @@ -28,53 +28,74 @@ - - - - + + + + - + -
- {_file.DOWNLOAD_NAME} [ {_file.FILESIZE} {_file.SIZE_LANG} | {_file.L_DOWNLOADED_VIEWED} {_file.L_DOWNLOAD_COUNT} ] - - - - + + + + + + + + + + + + + + + + + + + + - - - + + +
- + - - + + + + +
+ [ {L_PLAY_QUICKTIME_FILE} ] {_file.DOWNLOAD_NAME} [ {_file.FILESIZE} {_file.SIZE_LANG} | {_file.L_DOWNLOADED_VIEWED} {_file.L_DOWNLOAD_COUNT} ] diff --git a/phpBB/styles/subSilver/template/login_body.html b/phpBB/styles/subSilver/template/login_body.html index d198b9d0ef..0d72ee8f3b 100644 --- a/phpBB/styles/subSilver/template/login_body.html +++ b/phpBB/styles/subSilver/template/login_body.html @@ -50,10 +50,12 @@ +   {L_LOG_ME_IN} +   {L_HIDE_ME} diff --git a/phpBB/styles/subSilver/template/overall_header.html b/phpBB/styles/subSilver/template/overall_header.html index 4ba665a838..3035cb61b2 100644 --- a/phpBB/styles/subSilver/template/overall_header.html +++ b/phpBB/styles/subSilver/template/overall_header.html @@ -75,6 +75,44 @@ function marklist(id, name, state) } } + + + /** + * Play quicktime file by determining it's width/height + * from the displayed rectangle area + * + * Only defined if there is a file block present. + */ + function play_qt_file(obj) + { + var rectangle = obj.GetRectangle(); + + if (rectangle) + { + rectangle = rectangle.split(',') + var x1 = parseInt(rectangle[0]); + var x2 = parseInt(rectangle[2]); + var y1 = parseInt(rectangle[1]); + var y2 = parseInt(rectangle[3]); + + var width = (x1 < 0) ? (x1 * -1) + x2 : x2 - x1; + var height = (y1 < 0) ? (y1 * -1) + y2 : y2 - y1; + } + else + { + var width = 200; + var height = 0; + } + + obj.width = width; + obj.height = height + 16; + + obj.SetControllerVisible(true); + + obj.Play(); + } + + //--> diff --git a/phpBB/styles/subSilver/template/ucp_agreement.html b/phpBB/styles/subSilver/template/ucp_agreement.html index 3d25015101..d01a040a7a 100644 --- a/phpBB/styles/subSilver/template/ucp_agreement.html +++ b/phpBB/styles/subSilver/template/ucp_agreement.html @@ -18,8 +18,8 @@
{L_TERMS_OF_USE}

-

- +

+
@@ -28,7 +28,7 @@ - + {S_HIDDEN_FIELDS}