From 2e5106aae1bfe83ad8b2336a6d519da5aabc59d2 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 4 Mar 2014 11:22:55 +0100 Subject: [PATCH] [ticket/12237] Convert yahoo messanger to custom profile field PHPBB3-12237 --- phpBB/adm/style/acp_users_profile.html | 4 -- phpBB/develop/benchmark.php | 5 +- phpBB/includes/acp/acp_users.php | 4 -- phpBB/includes/db/schema_data.php | 2 +- phpBB/includes/ucp/ucp_pm_viewmessage.php | 1 - phpBB/includes/ucp/ucp_profile.php | 4 -- phpBB/install/convertors/convert_phpbb20.php | 2 +- phpBB/install/schemas/schema_data.sql | 5 +- phpBB/language/en/acp/styles.php | 1 - phpBB/language/en/common.php | 4 +- phpBB/language/en/ucp.php | 1 - phpBB/memberlist.php | 15 ++---- .../data/v310/profilefield_yahoo.php | 51 +++++++++++++++++++ .../data/v310/profilefield_yahoo_cleanup.php | 47 +++++++++++++++++ .../prosilver/template/memberlist_search.html | 4 -- .../prosilver/template/memberlist_view.html | 1 - .../template/ucp_pm_viewmessage.html | 3 +- .../template/ucp_profile_profile_info.html | 4 -- .../prosilver/template/viewtopic_body.html | 3 +- phpBB/styles/prosilver/theme/bidi.css | 2 +- phpBB/styles/prosilver/theme/buttons.css | 2 + phpBB/styles/prosilver/theme/colours.css | 1 + phpBB/styles/prosilver/theme/imageset.css | 2 +- .../template/memberlist_search.html | 3 +- .../subsilver2/template/memberlist_view.html | 4 -- .../template/ucp_profile_profile_info.html | 4 -- .../styles/subsilver2/theme/en/stylesheet.css | 2 +- phpBB/styles/subsilver2/theme/stylesheet.css | 2 +- phpBB/viewtopic.php | 4 -- tests/auth/provider_apache_test.php | 1 - 30 files changed, 119 insertions(+), 69 deletions(-) create mode 100644 phpBB/phpbb/db/migration/data/v310/profilefield_yahoo.php create mode 100644 phpBB/phpbb/db/migration/data/v310/profilefield_yahoo_cleanup.php diff --git a/phpBB/adm/style/acp_users_profile.html b/phpBB/adm/style/acp_users_profile.html index 84d5df8c14..c21d8833ac 100644 --- a/phpBB/adm/style/acp_users_profile.html +++ b/phpBB/adm/style/acp_users_profile.html @@ -6,10 +6,6 @@
-
-
-
-
diff --git a/phpBB/develop/benchmark.php b/phpBB/develop/benchmark.php index db3b8bc508..51340dcedd 100644 --- a/phpBB/develop/benchmark.php +++ b/phpBB/develop/benchmark.php @@ -371,7 +371,6 @@ function make_user($username) $avatar_filename = ""; $viewemail = 0; $aim = 0; - $yim = 0; $attachsig = 1; $allowsmilies = 1; $allowhtml = 1; @@ -416,8 +415,8 @@ function make_user($username) } - $sql = "INSERT INTO " . USERS_TABLE . " (user_id, username, user_regdate, user_password, user_email, user_sig, user_sig_bbcode_uid, user_avatar, user_viewemail, user_aim, user_yim, user_attachsig, user_allowsmilies, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_timezone, user_dateformat, user_lang, user_style, user_level, user_allow_pm, user_active, user_actkey) - VALUES ($new_user_id, '$username', " . time() . ", '$password', '$email', '$signature', '$signature_bbcode_uid', '$avatar_filename', $viewemail, '$aim', '$yim', $attachsig, $allowsmilies, $allowhtml, $allowbbcode, $allowviewonline, $notifyreply, $notifypm, $user_timezone, '$user_dateformat', '$user_lang', $user_style, 0, 1, "; + $sql = "INSERT INTO " . USERS_TABLE . " (user_id, username, user_regdate, user_password, user_email, user_sig, user_sig_bbcode_uid, user_avatar, user_viewemail, user_aim, user_attachsig, user_allowsmilies, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_timezone, user_dateformat, user_lang, user_style, user_level, user_allow_pm, user_active, user_actkey) + VALUES ($new_user_id, '$username', " . time() . ", '$password', '$email', '$signature', '$signature_bbcode_uid', '$avatar_filename', $viewemail, '$aim', $attachsig, $allowsmilies, $allowhtml, $allowbbcode, $allowviewonline, $notifyreply, $notifypm, $user_timezone, '$user_dateformat', '$user_lang', $user_style, 0, 1, "; $sql .= "1, '')"; diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index e5c82d0ca2..aabdefeccf 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -1361,7 +1361,6 @@ class acp_users $data = array( 'aim' => request_var('aim', $user_row['user_aim']), - 'yim' => request_var('yim', $user_row['user_yim']), 'jabber' => utf8_normalize_nfc(request_var('jabber', $user_row['user_jabber'], true)), 'bday_day' => 0, 'bday_month' => 0, @@ -1386,7 +1385,6 @@ class acp_users 'jabber' => array( array('string', true, 5, 255), array('jabber')), - 'yim' => array('string', true, 5, 255), 'bday_day' => array('num', true, 1, 31), 'bday_month' => array('num', true, 1, 12), 'bday_year' => array('num', true, 1901, gmdate('Y', time())), @@ -1409,7 +1407,6 @@ class acp_users { $sql_ary = array( 'user_aim' => $data['aim'], - 'user_yim' => $data['yim'], 'user_jabber' => $data['jabber'], 'user_birthday' => $data['user_birthday'], ); @@ -1454,7 +1451,6 @@ class acp_users unset($now); $template->assign_vars(array( - 'YIM' => $data['yim'], 'AIM' => $data['aim'], 'JABBER' => $data['jabber'], diff --git a/phpBB/includes/db/schema_data.php b/phpBB/includes/db/schema_data.php index 04a4ce0d9c..fe9787422f 100644 --- a/phpBB/includes/db/schema_data.php +++ b/phpBB/includes/db/schema_data.php @@ -796,6 +796,7 @@ $schema_data['phpbb_profile_fields_data'] = array( 'pf_phpbb_occupation' => array('TEXT_UNI', ''), 'pf_phpbb_icq' => array('VCHAR', ''), 'pf_phpbb_wlm' => array('VCHAR', ''), + 'pf_phpbb_yahoo' => array('VCHAR', ''), 'pf_phpbb_website' => array('VCHAR', ''), ), 'PRIMARY_KEY' => 'user_id', @@ -1176,7 +1177,6 @@ $schema_data['phpbb_users'] = array( 'user_sig_bbcode_uid' => array('VCHAR:8', ''), 'user_sig_bbcode_bitfield' => array('VCHAR:255', ''), 'user_aim' => array('VCHAR_UNI', ''), - 'user_yim' => array('VCHAR_UNI', ''), 'user_jabber' => array('VCHAR_UNI', ''), 'user_form_salt' => array('VCHAR_UNI:32', ''), 'user_new' => array('BOOL', 1), diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php index 594415ffc0..3e2b8f7456 100644 --- a/phpBB/includes/ucp/ucp_pm_viewmessage.php +++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php @@ -210,7 +210,6 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row) 'U_PM' => ($config['allow_privmsg'] && $auth->acl_get('u_sendpm') && ($user_info['user_allow_pm'] || $auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'))) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=compose&u=' . $author_id) : '', 'U_AIM' => ($user_info['user_aim'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contact&action=aim&u=' . $author_id) : '', - 'U_YIM' => ($user_info['user_yim']) ? 'http://edit.yahoo.com/config/send_webmesg?.target=' . urlencode($user_info['user_yim']) . '&.src=pg' : '', 'U_JABBER' => ($user_info['user_jabber'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contact&action=jabber&u=' . $author_id) : '', 'U_DELETE' => ($auth->acl_get('u_pm_delete')) ? "$url&mode=compose&action=delete&f=$folder_id&p=" . $message_row['msg_id'] : '', diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index 9821ad8485..9ed4278ec2 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -265,7 +265,6 @@ class ucp_profile $data = array( 'aim' => request_var('aim', $user->data['user_aim']), - 'yim' => request_var('yim', $user->data['user_yim']), 'jabber' => utf8_normalize_nfc(request_var('jabber', $user->data['user_jabber'], true)), ); @@ -293,7 +292,6 @@ class ucp_profile 'jabber' => array( array('string', true, 5, 255), array('jabber')), - 'yim' => array('string', true, 5, 255), ); if ($config['allow_birthdays']) @@ -334,7 +332,6 @@ class ucp_profile $sql_ary = array( 'user_aim' => $data['aim'], - 'user_yim' => $data['yim'], 'user_jabber' => $data['jabber'], 'user_notify_type' => $data['notify'], ); @@ -398,7 +395,6 @@ class ucp_profile $template->assign_vars(array( 'ERROR' => (sizeof($error)) ? implode('
', $error) : '', - 'YIM' => $data['yim'], 'AIM' => $data['aim'], 'JABBER' => $data['jabber'], )); diff --git a/phpBB/install/convertors/convert_phpbb20.php b/phpBB/install/convertors/convert_phpbb20.php index f3d1e969f1..b3b43f5b77 100644 --- a/phpBB/install/convertors/convert_phpbb20.php +++ b/phpBB/install/convertors/convert_phpbb20.php @@ -907,7 +907,6 @@ if (!$get_info) array('user_inactive_time', '', 'phpbb_inactive_time'), array('user_jabber', '', ''), - array('user_yim', 'users.user_yim', array('function1' => 'phpbb_set_encoding')), array('user_aim', 'users.user_aim', array('function1' => 'phpbb_set_encoding')), array('user_rank', 'users.user_rank', 'intval'), array('user_permissions', '', ''), @@ -962,6 +961,7 @@ if (!$get_info) array('pf_phpbb_location', 'users.user_from', array('function1' => 'phpbb_set_encoding')), array('pf_phpbb_icq', 'users.user_icq', array('function1' => 'phpbb_set_encoding')), array('pf_phpbb_wlm', 'users.user_msnm', array('function1' => 'phpbb_set_encoding')), + array('pf_phpbb_yahoo', 'users.user_yim', array('function1' => 'phpbb_set_encoding')), array('pf_phpbb_website', 'users.user_website', 'validate_website'), 'where' => 'users.user_id <> -1', diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index 9e9f185f57..774ede06b9 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -467,10 +467,10 @@ INSERT INTO phpbb_forums (forum_name, forum_desc, left_id, right_id, parent_id, INSERT INTO phpbb_forums (forum_name, forum_desc, left_id, right_id, parent_id, forum_type, forum_posts_approved, forum_posts_unapproved, forum_posts_softdeleted, forum_topics_approved, forum_topics_unapproved, forum_topics_softdeleted, forum_last_post_id, forum_last_poster_id, forum_last_poster_name, forum_last_poster_colour, forum_last_post_subject, forum_last_post_time, forum_link, forum_password, forum_image, forum_rules, forum_rules_link, forum_rules_uid, forum_desc_uid, prune_days, prune_viewed, forum_parents, forum_flags) VALUES ('{L_FORUMS_TEST_FORUM_TITLE}', '{L_FORUMS_TEST_FORUM_DESC}', 2, 3, 1, 1, 1, 0, 0, 1, 0, 0, 1, 2, 'Admin', 'AA0000', '{L_TOPICS_TOPIC_TITLE}', 972086460, '', '', '', '', '', '', '', 0, 0, '', 48); # -- Users / Anonymous user -INSERT INTO phpbb_users (user_type, group_id, username, username_clean, user_regdate, user_password, user_email, user_lang, user_style, user_rank, user_colour, user_posts, user_permissions, user_ip, user_birthday, user_lastpage, user_last_confirm_key, user_post_sortby_type, user_post_sortby_dir, user_topic_sortby_type, user_topic_sortby_dir, user_avatar, user_sig, user_sig_bbcode_uid, user_aim, user_yim, user_jabber, user_actkey, user_newpasswd, user_allow_massemail) VALUES (2, 1, 'Anonymous', 'anonymous', 0, '', '', 'en', 1, 0, '', 0, '', '', '', '', '', 't', 'a', 't', 'd', '', '', '', '', '', '', '', '', 0); +INSERT INTO phpbb_users (user_type, group_id, username, username_clean, user_regdate, user_password, user_email, user_lang, user_style, user_rank, user_colour, user_posts, user_permissions, user_ip, user_birthday, user_lastpage, user_last_confirm_key, user_post_sortby_type, user_post_sortby_dir, user_topic_sortby_type, user_topic_sortby_dir, user_avatar, user_sig, user_sig_bbcode_uid, user_aim, user_jabber, user_actkey, user_newpasswd, user_allow_massemail) VALUES (2, 1, 'Anonymous', 'anonymous', 0, '', '', 'en', 1, 0, '', 0, '', '', '', '', '', 't', 'a', 't', 'd', '', '', '', '', '', '', '', 0); # -- username: Admin password: admin (change this or remove it once everything is working!) -INSERT INTO phpbb_users (user_type, group_id, username, username_clean, user_regdate, user_password, user_email, user_lang, user_style, user_rank, user_colour, user_posts, user_permissions, user_ip, user_birthday, user_lastpage, user_last_confirm_key, user_post_sortby_type, user_post_sortby_dir, user_topic_sortby_type, user_topic_sortby_dir, user_avatar, user_sig, user_sig_bbcode_uid, user_aim, user_yim, user_jabber, user_actkey, user_newpasswd) VALUES (3, 5, 'Admin', 'admin', 0, '21232f297a57a5a743894a0e4a801fc3', 'admin@yourdomain.com', 'en', 1, 1, 'AA0000', 1, '', '', '', '', '', 't', 'a', 't', 'd', '', '', '', '', '', '', '', ''); +INSERT INTO phpbb_users (user_type, group_id, username, username_clean, user_regdate, user_password, user_email, user_lang, user_style, user_rank, user_colour, user_posts, user_permissions, user_ip, user_birthday, user_lastpage, user_last_confirm_key, user_post_sortby_type, user_post_sortby_dir, user_topic_sortby_type, user_topic_sortby_dir, user_avatar, user_sig, user_sig_bbcode_uid, user_aim, user_jabber, user_actkey, user_newpasswd) VALUES (3, 5, 'Admin', 'admin', 0, '21232f297a57a5a743894a0e4a801fc3', 'admin@yourdomain.com', 'en', 1, 1, 'AA0000', 1, '', '', '', '', '', 't', 'a', 't', 'd', '', '', '', '', '', '', ''); # -- Groups INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('GUESTS', 3, 0, '', 0, '', '', '', 5); @@ -794,6 +794,7 @@ INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_len INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_icq', 'profilefields.type.string', 'phpbb_icq', '20', '3', '15', '', '', '[0-9]+', 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 4, 1, 'SEND_ICQ_MESSAGE', 'https://www.icq.com/people/%s/'); INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_website', 'profilefields.type.url', 'phpbb_website', '40', '12', '255', '', '', '', 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 5, 1, 'VISIT_WEBSITE', '%s'); INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_wlm', 'profilefields.type.string', 'phpbb_wlm', '40', '5', '255', '', '', '.*', 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 6, 1, '', ''); +INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_yahoo', 'profilefields.type.string', 'phpbb_yahoo', '40', '5', '255', '', '', '.*', 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 7, 1, 'SEND_YIM_MESSAGE', 'http://edit.yahoo.com/config/send_webmesg?.target=%s&.src=pg'); # User Notification Options (for first user) INSERT INTO phpbb_user_notifications (item_type, item_id, user_id, method) VALUES('post', 0, 2, ''); diff --git a/phpBB/language/en/acp/styles.php b/phpBB/language/en/acp/styles.php index eef669220a..6954702f1f 100644 --- a/phpBB/language/en/acp/styles.php +++ b/phpBB/language/en/acp/styles.php @@ -186,7 +186,6 @@ $lang = array_merge($lang, array( 'IMG_ICON_CONTACT_EMAIL' => 'Send email', 'IMG_ICON_CONTACT_JABBER' => 'Jabber', 'IMG_ICON_CONTACT_PM' => 'Send message', - 'IMG_ICON_CONTACT_YAHOO' => 'YIM', 'IMG_ICON_POST_DELETE' => 'Delete post', 'IMG_ICON_POST_EDIT' => 'Edit post', diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index eba423deff..144ffd33d5 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -691,7 +691,6 @@ $lang = array_merge($lang, array( 'TOO_LONG_USER_PASSWORD' => 'The password you entered is too long.', 'TOO_LONG_USERNAME' => 'The username you entered is too long.', 'TOO_LONG_EMAIL' => 'The email address you entered is too long.', - 'TOO_LONG_YIM' => 'The Yahoo! Messenger name you entered is too long.', 'TOO_MANY_VOTE_OPTIONS' => 'You have tried to vote for too many options.', @@ -706,7 +705,6 @@ $lang = array_merge($lang, array( 'TOO_SHORT_USER_PASSWORD' => 'The password you entered is too short.', 'TOO_SHORT_USERNAME' => 'The username you entered is too short.', 'TOO_SHORT_EMAIL' => 'The email address you entered is too short.', - 'TOO_SHORT_YIM' => 'The Yahoo! Messenger name you entered is too short.', 'TOO_SMALL' => 'The value you entered is too small.', 'TOO_SMALL_MAX_RECIPIENTS' => 'The value of Maximum number of allowed recipients per private message setting you entered is too small.', @@ -830,7 +828,7 @@ $lang = array_merge($lang, array( 'YEAR' => 'Year', 'YEAR_MONTH_DAY' => '(YYYY-MM-DD)', 'YES' => 'Yes', - 'YIM' => 'YIM', + 'YIM' => 'Yahoo Messenger', 'YOU_LAST_VISIT' => 'Last visit was: %s', 'datetime' => array( diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php index 42fd0fd506..4fa73667cb 100644 --- a/phpBB/language/en/ucp.php +++ b/phpBB/language/en/ucp.php @@ -539,7 +539,6 @@ $lang = array_merge($lang, array( 'UCP_REMIND' => 'Send password', 'UCP_RESEND' => 'Send activation email', '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', 'UCP_ZEBRA' => 'Friends & Foes', 'UCP_ZEBRA_FOES' => 'Manage foes', 'UCP_ZEBRA_FRIENDS' => 'Manage friends', diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index 37d53087d5..afae1a60f1 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -644,7 +644,6 @@ switch ($mode) 'PM_IMG' => $user->img('icon_contact_pm', $user->lang['SEND_PRIVATE_MESSAGE']), 'EMAIL_IMG' => $user->img('icon_contact_email', $user->lang['EMAIL']), 'AIM_IMG' => $user->img('icon_contact_aim', $user->lang['AIM']), - 'YIM_IMG' => $user->img('icon_contact_yahoo', $user->lang['YIM']), 'JABBER_IMG' => $user->img('icon_contact_jabber', $user->lang['JABBER']), 'SEARCH_IMG' => $user->img('icon_user_search', $user->lang['SEARCH']), @@ -988,8 +987,8 @@ switch ($mode) $pagination = $phpbb_container->get('pagination'); // Sorting - $sort_key_text = array('a' => $user->lang['SORT_USERNAME'], 'c' => $user->lang['SORT_JOINED'], 'd' => $user->lang['SORT_POST_COUNT'], 'h' => $user->lang['AIM'], 'j' => $user->lang['YIM'], 'k' => $user->lang['JABBER']); - $sort_key_sql = array('a' => 'u.username_clean', 'c' => 'u.user_regdate', 'd' => 'u.user_posts', 'h' => 'u.user_aim', 'j' => 'u.user_yim', 'k' => 'u.user_jabber'); + $sort_key_text = array('a' => $user->lang['SORT_USERNAME'], 'c' => $user->lang['SORT_JOINED'], 'd' => $user->lang['SORT_POST_COUNT'], 'h' => $user->lang['AIM'], 'k' => $user->lang['JABBER']); + $sort_key_sql = array('a' => 'u.username_clean', 'c' => 'u.user_regdate', 'd' => 'u.user_posts', 'h' => 'u.user_aim', 'k' => 'u.user_jabber'); if ($auth->acl_get('a_user')) { @@ -1032,7 +1031,7 @@ switch ($mode) $select_single = request_var('select_single', false); // Search URL parameters, if any of these are in the URL we do a search - $search_params = array('username', 'email', 'aim', 'yahoo', 'jabber', 'search_group_id', 'joined_select', 'active_select', 'count_select', 'joined', 'active', 'count', 'ip'); + $search_params = array('username', 'email', 'aim', 'jabber', 'search_group_id', 'joined_select', 'active_select', 'count_select', 'joined', 'active', 'count', 'ip'); // We validate form and field here, only id/class allowed $form = (!preg_match('/^[a-z0-9_-]+$/i', $form)) ? '' : $form; @@ -1042,7 +1041,6 @@ switch ($mode) $username = request_var('username', '', true); $email = strtolower(request_var('email', '')); $aim = request_var('aim', ''); - $yahoo = request_var('yahoo', ''); $jabber = request_var('jabber', ''); $search_group_id = request_var('search_group_id', 0); @@ -1084,7 +1082,6 @@ switch ($mode) $sql_where .= ($username) ? ' AND u.username_clean ' . $db->sql_like_expression(str_replace('*', $db->any_char, utf8_clean_string($username))) : ''; $sql_where .= ($auth->acl_get('a_user') && $email) ? ' AND u.user_email ' . $db->sql_like_expression(str_replace('*', $db->any_char, $email)) . ' ' : ''; $sql_where .= ($aim) ? ' AND u.user_aim ' . $db->sql_like_expression(str_replace('*', $db->any_char, $aim)) . ' ' : ''; - $sql_where .= ($yahoo) ? ' AND u.user_yim ' . $db->sql_like_expression(str_replace('*', $db->any_char, $yahoo)) . ' ' : ''; $sql_where .= ($jabber) ? ' AND u.user_jabber ' . $db->sql_like_expression(str_replace('*', $db->any_char, $jabber)) . ' ' : ''; $sql_where .= (is_numeric($count) && isset($find_key_match[$count_select])) ? ' AND u.user_posts ' . $find_key_match[$count_select] . ' ' . (int) $count . ' ' : ''; @@ -1314,7 +1311,6 @@ switch ($mode) 'username' => array('username', '', true), 'email' => array('email', ''), 'aim' => array('aim', ''), - 'yahoo' => array('yahoo', ''), 'jabber' => array('jabber', ''), 'search_group_id' => array('search_group_id', 0), 'joined_select' => array('joined_select', 'lt'), @@ -1444,7 +1440,6 @@ switch ($mode) 'USERNAME' => $username, 'EMAIL' => $email, 'AIM' => $aim, - 'YAHOO' => $yahoo, 'JABBER' => $jabber, 'JOINED' => implode('-', $joined), 'ACTIVE' => implode('-', $active), @@ -1621,7 +1616,6 @@ switch ($mode) 'PM_IMG' => $user->img('icon_contact_pm', $user->lang['SEND_PRIVATE_MESSAGE']), 'EMAIL_IMG' => $user->img('icon_contact_email', $user->lang['EMAIL']), 'AIM_IMG' => $user->img('icon_contact_aim', $user->lang['AIM']), - 'YIM_IMG' => $user->img('icon_contact_yahoo', $user->lang['YIM']), 'JABBER_IMG' => $user->img('icon_contact_jabber', $user->lang['JABBER']), 'SEARCH_IMG' => $user->img('icon_user_search', $user->lang['SEARCH']), @@ -1632,7 +1626,6 @@ switch ($mode) 'U_SORT_POSTS' => $sort_url . '&sk=d&sd=' . (($sort_key == 'd' && $sort_dir == 'a') ? 'd' : 'a'), 'U_SORT_EMAIL' => $sort_url . '&sk=e&sd=' . (($sort_key == 'e' && $sort_dir == 'a') ? 'd' : 'a'), 'U_SORT_AIM' => $sort_url . '&sk=h&sd=' . (($sort_key == 'h' && $sort_dir == 'a') ? 'd' : 'a'), - 'U_SORT_YIM' => $sort_url . '&sk=j&sd=' . (($sort_key == 'j' && $sort_dir == 'a') ? 'd' : 'a'), 'U_SORT_ACTIVE' => ($auth->acl_get('u_viewonline')) ? $sort_url . '&sk=l&sd=' . (($sort_key == 'l' && $sort_dir == 'a') ? 'd' : 'a') : '', 'U_SORT_RANK' => $sort_url . '&sk=m&sd=' . (($sort_key == 'm' && $sort_dir == 'a') ? 'd' : 'a'), 'U_LIST_CHAR' => $sort_url . '&sk=a&sd=' . (($sort_key == 'l' && $sort_dir == 'a') ? 'd' : 'a'), @@ -1753,11 +1746,9 @@ function show_profile($data, $user_notes_enabled = false, $warn_user_enabled = f 'U_PM' => ($config['allow_privmsg'] && $auth->acl_get('u_sendpm') && ($data['user_allow_pm'] || $auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'))) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=compose&u=' . $user_id) : '', 'U_EMAIL' => $email, 'U_AIM' => ($data['user_aim'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contact&action=aim&u=' . $user_id) : '', - 'U_YIM' => ($data['user_yim']) ? 'http://edit.yahoo.com/config/send_webmesg?.target=' . urlencode($data['user_yim']) . '&.src=pg' : '', 'U_JABBER' => ($data['user_jabber'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contact&action=jabber&u=' . $user_id) : '', 'USER_AIM' => $data['user_aim'], - 'USER_YIM' => $data['user_yim'], 'USER_JABBER' => $data['user_jabber'], 'USER_JABBER_IMG' => ($data['user_jabber']) ? $user->img('icon_contact_jabber', $data['user_jabber']) : '', diff --git a/phpBB/phpbb/db/migration/data/v310/profilefield_yahoo.php b/phpBB/phpbb/db/migration/data/v310/profilefield_yahoo.php new file mode 100644 index 0000000000..808aec8099 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/profilefield_yahoo.php @@ -0,0 +1,51 @@ + 'phpbb_yahoo', + 'field_type' => 'profilefields.type.string', + 'field_ident' => 'phpbb_yahoo', + 'field_length' => '40', + 'field_minlen' => '5', + 'field_maxlen' => '255', + 'field_novalue' => '', + 'field_default_value' => '', + 'field_validation' => '.*', + 'field_required' => 0, + 'field_show_novalue' => 0, + 'field_show_on_reg' => 0, + 'field_show_on_pm' => 1, + 'field_show_on_vt' => 1, + 'field_show_on_ml' => 0, + 'field_show_profile' => 1, + 'field_hide' => 0, + 'field_no_view' => 0, + 'field_active' => 1, + 'field_is_contact' => 1, + 'field_contact_desc' => 'SEND_YIM_MESSAGE', + 'field_contact_url' => 'http://edit.yahoo.com/config/send_webmesg?.target=%s&.src=pg', + ); + + protected $user_column_name = 'user_yim'; +} diff --git a/phpBB/phpbb/db/migration/data/v310/profilefield_yahoo_cleanup.php b/phpBB/phpbb/db/migration/data/v310/profilefield_yahoo_cleanup.php new file mode 100644 index 0000000000..4747c1c3d4 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/profilefield_yahoo_cleanup.php @@ -0,0 +1,47 @@ +db_tools->sql_column_exists($this->table_prefix . 'users', 'user_yim'); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\profilefield_yahoo', + ); + } + + public function update_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'users' => array( + 'user_yim', + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'users' => array( + 'user_yim' => array('VCHAR_UNI', ''), + ), + ), + ); + } +} diff --git a/phpBB/styles/prosilver/template/memberlist_search.html b/phpBB/styles/prosilver/template/memberlist_search.html index b07eab04c1..01ddc48381 100644 --- a/phpBB/styles/prosilver/template/memberlist_search.html +++ b/phpBB/styles/prosilver/template/memberlist_search.html @@ -21,10 +21,6 @@
-
-
-
-
diff --git a/phpBB/styles/prosilver/template/memberlist_view.html b/phpBB/styles/prosilver/template/memberlist_view.html index 3b9eea347d..e50d7be255 100644 --- a/phpBB/styles/prosilver/template/memberlist_view.html +++ b/phpBB/styles/prosilver/template/memberlist_view.html @@ -62,7 +62,6 @@
{L_EMAIL_ADDRESS}{L_COLON}
{L_SEND_EMAIL_USER} {USERNAME}
{L_PM}{L_COLON}
{L_SEND_PRIVATE_MESSAGE}
-
{L_YIM}{L_COLON}
{L_SEND_YIM_MESSAGE}{USER_YIM}
{L_AIM}{L_COLON}
{L_SEND_AIM_MESSAGE}{USER_AIM}
{L_JABBER}{L_COLON}
{L_SEND_JABBER_MESSAGE}
{L_JABBER}{L_COLON}
{USER_JABBER}
diff --git a/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html b/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html index f895af90bd..208111b2fb 100644 --- a/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html +++ b/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html @@ -34,13 +34,12 @@ - +
  • {L_PRIVATE_MESSAGE}
  • -
  • {L_YIM}
  • {L_AIM}
  • {L_JABBER}
  • diff --git a/phpBB/styles/prosilver/template/ucp_profile_profile_info.html b/phpBB/styles/prosilver/template/ucp_profile_profile_info.html index fced53cfa0..8193f4c6ae 100644 --- a/phpBB/styles/prosilver/template/ucp_profile_profile_info.html +++ b/phpBB/styles/prosilver/template/ucp_profile_profile_info.html @@ -14,10 +14,6 @@
-
-
-
-
diff --git a/phpBB/styles/prosilver/template/viewtopic_body.html b/phpBB/styles/prosilver/template/viewtopic_body.html index a09d044bc1..0718b0a2e5 100644 --- a/phpBB/styles/prosilver/template/viewtopic_body.html +++ b/phpBB/styles/prosilver/template/viewtopic_body.html @@ -144,12 +144,11 @@ - +
  • {L_PRIVATE_MESSAGE}
  • -
  • {L_YIM}
  • {L_AIM}
  • {L_JABBER}
  • diff --git a/phpBB/styles/prosilver/theme/bidi.css b/phpBB/styles/prosilver/theme/bidi.css index 0b8030b6b3..eace60e35f 100644 --- a/phpBB/styles/prosilver/theme/bidi.css +++ b/phpBB/styles/prosilver/theme/bidi.css @@ -849,7 +849,7 @@ ul.linklist li.small-icon > a, ul.linklist li.breadcrumbs span:first-child > a { padding-right: 11px; padding-left: 0; } -.rtl .imageset.icon_contact_aim, .rtl .imageset.icon_contact_email, .rtl .imageset.icon_contact_icq, .rtl .imageset.phpbb_icq-icon, .rtl .imageset.icon_contact_jabber, .rtl .imageset.icon_contact_msnm, .rtl .imageset.phpbb_wlm-icon, .rtl .imageset.icon_contact_www, .rtl .imageset.phpbb_website-icon, .rtl .imageset.icon_contact_yahoo, .rtl .imageset.icon_post_delete, .rtl .imageset.icon_post_info, .rtl .imageset.icon_post_report, .rtl .imageset.icon_user_warn { +.rtl .imageset.icon_contact_aim, .rtl .imageset.icon_contact_email, .rtl .imageset.icon_contact_icq, .rtl .imageset.phpbb_icq-icon, .rtl .imageset.icon_contact_jabber, .rtl .imageset.icon_contact_msnm, .rtl .imageset.phpbb_wlm-icon, .rtl .imageset.icon_contact_www, .rtl .imageset.phpbb_website-icon, .rtl .imageset.icon_contact_yahoo, .rtl .imageset.phpbb_yahoo-icon, .rtl .imageset.icon_post_delete, .rtl .imageset.icon_post_info, .rtl .imageset.icon_post_report, .rtl .imageset.icon_user_warn { padding-right: 20px; padding-left: 0; } diff --git a/phpBB/styles/prosilver/theme/buttons.css b/phpBB/styles/prosilver/theme/buttons.css index 66355503a7..6d0fa06574 100644 --- a/phpBB/styles/prosilver/theme/buttons.css +++ b/phpBB/styles/prosilver/theme/buttons.css @@ -239,6 +239,7 @@ ul.profile-icons.responsive a.responsive-menu-link:before { .email-icon, .email-icon a { background: none top left no-repeat; } .aim-icon, .aim-icon a { background: none top left no-repeat; } .yahoo-icon, .yahoo-icon a { background: none top left no-repeat; } +.phpbb_yahoo-icon, .phpbb_yahoo-icon a { background: none top left no-repeat; } .web-icon, .web-icon a { background: none top left no-repeat; } .phpbb_website-icon, .phpbb_website-icon a { background: none top left no-repeat; } .msnm-icon, .msnm-icon a { background: none top left no-repeat; } @@ -260,6 +261,7 @@ ul.profile-icons.responsive a.responsive-menu-link:before { ul.profile-icons li.email-icon { width: 20px; height: 20px; } ul.profile-icons li.aim-icon { width: 20px; height: 20px; } ul.profile-icons li.yahoo-icon { width: 20px; height: 20px; } +ul.profile-icons li.phpbb_yahoo-icon { width: 20px; height: 20px; } ul.profile-icons li.web-icon { width: 20px; height: 20px; } ul.profile-icons li.phpbb_website-icon { width: 20px; height: 20px; } ul.profile-icons li.msnm-icon { width: 20px; height: 20px; } diff --git a/phpBB/styles/prosilver/theme/colours.css b/phpBB/styles/prosilver/theme/colours.css index adaf507bd5..18ead9cab9 100644 --- a/phpBB/styles/prosilver/theme/colours.css +++ b/phpBB/styles/prosilver/theme/colours.css @@ -741,6 +741,7 @@ a.sendemail { .email-icon, .email-icon a { background-image: url("./images/icon_contact_email.gif"); } .aim-icon, .aim-icon a { background-image: url("./images/icon_contact_aim.gif"); } .yahoo-icon, .yahoo-icon a { background-image: url("./images/icon_contact_yahoo.gif"); } +.phpbb_yahoo-icon, .phpbb_yahoo-icon a { background-image: url("./images/icon_contact_yahoo.gif"); } .web-icon, .web-icon a { background-image: url("./images/icon_contact_www.gif"); } .phpbb_website-icon, .phpbb_website-icon a { background-image: url("./images/icon_contact_www.gif"); } .msnm-icon, .msnm-icon a { background-image: url("./images/icon_contact_msnm.gif"); } diff --git a/phpBB/styles/prosilver/theme/imageset.css b/phpBB/styles/prosilver/theme/imageset.css index 9482a01f12..285218e22e 100644 --- a/phpBB/styles/prosilver/theme/imageset.css +++ b/phpBB/styles/prosilver/theme/imageset.css @@ -290,7 +290,7 @@ span.imageset { padding-left: 20px; padding-top: 20px; } -.imageset.icon_contact_yahoo { +.imageset.icon_contact_yahoo, .imageset.phpbb_yahoo-icon { background-image: url("./images/icon_contact_yahoo.gif"); padding-left: 20px; padding-top: 20px; diff --git a/phpBB/styles/subsilver2/template/memberlist_search.html b/phpBB/styles/subsilver2/template/memberlist_search.html index 251230b643..bf0bb42b0c 100644 --- a/phpBB/styles/subsilver2/template/memberlist_search.html +++ b/phpBB/styles/subsilver2/template/memberlist_search.html @@ -91,8 +91,7 @@ {L_JOINED}{L_COLON} - {L_YIM}{L_COLON} - +   diff --git a/phpBB/styles/subsilver2/template/memberlist_view.html b/phpBB/styles/subsilver2/template/memberlist_view.html index 9c84fedd89..1c71de3111 100644 --- a/phpBB/styles/subsilver2/template/memberlist_view.html +++ b/phpBB/styles/subsilver2/template/memberlist_view.html @@ -118,10 +118,6 @@ {PM_IMG} - - {L_YIM}{L_COLON} - {YIM_IMG}{USER_YIM} - {L_AIM}{L_COLON} {AIM_IMG}{USER_AIM} diff --git a/phpBB/styles/subsilver2/template/ucp_profile_profile_info.html b/phpBB/styles/subsilver2/template/ucp_profile_profile_info.html index 877c9fe1ab..555dcbbe17 100644 --- a/phpBB/styles/subsilver2/template/ucp_profile_profile_info.html +++ b/phpBB/styles/subsilver2/template/ucp_profile_profile_info.html @@ -16,10 +16,6 @@ {L_UCP_AIM}{L_COLON} - - {L_UCP_YIM}{L_COLON} - - {L_UCP_JABBER}{L_COLON} diff --git a/phpBB/styles/subsilver2/theme/en/stylesheet.css b/phpBB/styles/subsilver2/theme/en/stylesheet.css index 449fe7bec5..e9f24b45d1 100644 --- a/phpBB/styles/subsilver2/theme/en/stylesheet.css +++ b/phpBB/styles/subsilver2/theme/en/stylesheet.css @@ -29,7 +29,7 @@ padding-left: 72px; padding-top: 20px; } -.imageset.icon_contact_yahoo { +.imageset.phpbb_yahoo-icon, .imageset.icon_contact_yahoo { background-image: url("./icon_contact_yahoo.gif"); padding-left: 72px; padding-top: 20px; diff --git a/phpBB/styles/subsilver2/theme/stylesheet.css b/phpBB/styles/subsilver2/theme/stylesheet.css index 936625a0cf..6bda3997de 100644 --- a/phpBB/styles/subsilver2/theme/stylesheet.css +++ b/phpBB/styles/subsilver2/theme/stylesheet.css @@ -1043,7 +1043,7 @@ a.imageset { padding-left: 72px; padding-top: 20px; } -.imageset.icon_contact_yahoo { +.imageset.phpbb_yahoo-icon, .imageset.icon_contact_yahoo { background-image: url("./en/icon_contact_yahoo.gif"); padding-left: 72px; padding-top: 20px; diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 6c30f0dc05..5e1bc68357 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -621,7 +621,6 @@ $template->assign_vars(array( 'PM_IMG' => $user->img('icon_contact_pm', 'SEND_PRIVATE_MESSAGE'), 'EMAIL_IMG' => $user->img('icon_contact_email', 'SEND_EMAIL'), 'AIM_IMG' => $user->img('icon_contact_aim', 'AIM'), - 'YIM_IMG' => $user->img('icon_contact_yahoo', 'YIM'), 'JABBER_IMG' => $user->img('icon_contact_jabber', 'JABBER') , 'REPORT_IMG' => $user->img('icon_post_report', 'REPORT_POST'), 'REPORTED_IMG' => $user->img('icon_topic_reported', 'POST_REPORTED'), @@ -1115,7 +1114,6 @@ while ($row = $db->sql_fetchrow($result)) 'pm' => '', 'email' => '', 'aim' => '', - 'yim' => '', 'jabber' => '', 'search' => '', 'age' => '', @@ -1180,7 +1178,6 @@ while ($row = $db->sql_fetchrow($result)) 'online' => false, 'profile' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=viewprofile&u=$poster_id"), 'aim' => ($row['user_aim'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=contact&action=aim&u=$poster_id") : '', - 'yim' => ($row['user_yim']) ? 'http://edit.yahoo.com/config/send_webmesg?.target=' . urlencode($row['user_yim']) . '&.src=pg' : '', 'jabber' => ($row['user_jabber'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=contact&action=jabber&u=$poster_id") : '', 'search' => ($auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", "author_id=$poster_id&sr=posts") : '', @@ -1625,7 +1622,6 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) 'U_PM' => ($poster_id != ANONYMOUS && $config['allow_privmsg'] && $auth->acl_get('u_sendpm') && ($user_cache[$poster_id]['allow_pm'] || $auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'))) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=compose&action=quotepost&p=' . $row['post_id']) : '', 'U_EMAIL' => $user_cache[$poster_id]['email'], 'U_AIM' => $user_cache[$poster_id]['aim'], - 'U_YIM' => $user_cache[$poster_id]['yim'], 'U_JABBER' => $user_cache[$poster_id]['jabber'], 'U_APPROVE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&p={$row['post_id']}&f=$forum_id&redirect=" . urlencode(str_replace('&', '&', $viewtopic_url . '&p=' . $row['post_id'] . '#p' . $row['post_id']))), diff --git a/tests/auth/provider_apache_test.php b/tests/auth/provider_apache_test.php index 84abd41bca..c584c3ecbe 100644 --- a/tests/auth/provider_apache_test.php +++ b/tests/auth/provider_apache_test.php @@ -194,7 +194,6 @@ class phpbb_auth_provider_apache_test extends phpbb_database_test_case 'user_sig_bbcode_uid' => '', 'user_sig_bbcode_bitfield' => '', 'user_aim' => '', - 'user_yim' => '', 'user_jabber' => '', 'user_actkey' => '', 'user_newpasswd' => '',