Преглед на файлове

Merge pull request #792 from Arantor/release-2.1

! "Do not reveal contact details of members to guests" is just good prac...
Arantor преди 10 години
родител
ревизия
1eca3f0c4e

+ 4 - 4
Sources/Load.php

@@ -1158,25 +1158,25 @@ function loadMemberContext($user, $display_custom_fields = false)
 			'birth_date' => empty($profile['birthdate']) || $profile['birthdate'] === '0001-01-01' ? '0000-00-00' : (substr($profile['birthdate'], 0, 4) === '0004' ? '0000' . substr($profile['birthdate'], 4) : $profile['birthdate']),
 			'signature' => $profile['signature'],
 			'location' => $profile['location'],
-			'icq' => $profile['icq'] != '' && (empty($modSettings['guest_hideContacts']) || !$user_info['is_guest']) ? array(
+			'icq' => $profile['icq'] != '' && !$user_info['is_guest'] ? array(
 				'name' => $profile['icq'],
 				'href' => 'http://www.icq.com/whitepages/about_me.php?uin=' . $profile['icq'],
 				'link' => '<a class="icq new_win" href="http://www.icq.com/whitepages/about_me.php?uin=' . $profile['icq'] . '" target="_blank" title="' . $txt['icq_title'] . ' - ' . $profile['icq'] . '"><img src="http://status.icq.com/online.png?img=5&amp;icq=' . $profile['icq'] . '" alt="' . $txt['icq_title'] . ' - ' . $profile['icq'] . '" width="18" height="18" /></a>',
 				'link_text' => '<a class="icq extern" href="http://www.icq.com/whitepages/about_me.php?uin=' . $profile['icq'] . '" title="' . $txt['icq_title'] . ' - ' . $profile['icq'] . '">' . $profile['icq'] . '</a>',
 			) : array('name' => '', 'add' => '', 'href' => '', 'link' => '', 'link_text' => ''),
-			'aim' => $profile['aim'] != '' && (empty($modSettings['guest_hideContacts']) || !$user_info['is_guest']) ? array(
+			'aim' => $profile['aim'] != '' && !$user_info['is_guest'] ? array(
 				'name' => $profile['aim'],
 				'href' => 'aim:goim?screenname=' . urlencode(strtr($profile['aim'], array(' ' => '%20'))) . '&amp;message=' . $txt['aim_default_message'],
 				'link' => '<a class="aim" href="aim:goim?screenname=' . urlencode(strtr($profile['aim'], array(' ' => '%20'))) . '&amp;message=' . $txt['aim_default_message'] . '" title="' . $txt['aim_title'] . ' - ' . $profile['aim'] . '"><img src="' . $settings['images_url'] . '/aim.png" alt="' . $txt['aim_title'] . ' - ' . $profile['aim'] . '" /></a>',
 				'link_text' => '<a class="aim" href="aim:goim?screenname=' . urlencode(strtr($profile['aim'], array(' ' => '%20'))) . '&amp;message=' . $txt['aim_default_message'] . '" title="' . $txt['aim_title'] . ' - ' . $profile['aim'] . '">' . $profile['aim'] . '</a>'
 			) : array('name' => '', 'href' => '', 'link' => '', 'link_text' => ''),
-			'yim' => $profile['yim'] != '' && (empty($modSettings['guest_hideContacts']) || !$user_info['is_guest']) ? array(
+			'yim' => $profile['yim'] != '' && !$user_info['is_guest'] ? array(
 				'name' => $profile['yim'],
 				'href' => 'http://edit.yahoo.com/config/send_webmesg?.target=' . urlencode($profile['yim']),
 				'link' => '<a class="yim" href="http://edit.yahoo.com/config/send_webmesg?.target=' . urlencode($profile['yim']) . '" title="' . $txt['yim_title'] . ' - ' . $profile['yim'] . '"><img src="http://opi.yahoo.com/online?u=' . urlencode($profile['yim']) . '&amp;m=g&amp;t=0" alt="' . $txt['yim_title'] . ' - ' . $profile['yim'] . '" /></a>',
 				'link_text' => '<a class="yim" href="http://edit.yahoo.com/config/send_webmesg?.target=' . urlencode($profile['yim']) . '" title="' . $txt['yim_title'] . ' - ' . $profile['yim'] . '">' . $profile['yim'] . '</a>'
 			) : array('name' => '', 'href' => '', 'link' => '', 'link_text' => ''),
-			'skype' => !empty($profile['skype']) && (empty($modSettings['guest_hideContacts']) || !$user_info['is_guest']) ? array(
+			'skype' => !empty($profile['skype']) && !$user_info['is_guest'] ? array(
 				'name' => $profile['skype'],
 				'href' => 'skype:' . $profile['skype'] . '?chat',
 				'link' => '<a class="skype new_win" href="skype:' . $profile['skype'] . '?chat" title="' . $txt['skype'] . ' - ' . $profile['skype'] . '"><img src="' . $settings['images_url'] . '/skype.png" alt="' . $txt['skype'] . ' - ' . $profile['skype'] . '" /></a>',

+ 0 - 1
Sources/ManageServer.php

@@ -350,7 +350,6 @@ function ModifyGeneralSecuritySettings($return_config = false)
 	global $txt, $scripturl, $context, $settings, $sc, $modSettings;
 
 	$config_vars = array(
-			array('check', 'guest_hideContacts'),
 			array('check', 'make_email_viewable'),
 		'',
 			array('int', 'failed_login_threshold'),

+ 1 - 1
Sources/Memberlist.php

@@ -484,7 +484,7 @@ function MLSearch()
 		else
 			$fields = array();
 		// Search for messengers...
-		if (in_array('messenger', $_POST['fields']) && (!$user_info['is_guest'] || empty($modSettings['guest_hideContacts'])))
+		if (in_array('messenger', $_POST['fields']) && !$user_info['is_guest'])
 			$fields += array(3 => 'aim', 'icq', 'yim', 'skype');
 		// Search for websites.
 		if (in_array('website', $_POST['fields']))

+ 4 - 4
Sources/News.php

@@ -966,13 +966,13 @@ function getXmlProfile($xml_format)
 		if ($profile['title'] != '')
 			$data['title'] = cdata_parse($profile['title']);
 
-		if (!empty($profile['icq']['name']) && !(!empty($modSettings['guest_hideContacts']) && $user_info['is_guest']))
+		if (!empty($profile['icq']['name']) && !$user_info['is_guest'])
 			$data['icq'] = $profile['icq']['name'];
-		if ($profile['aim']['name'] != '' && !(!empty($modSettings['guest_hideContacts']) && $user_info['is_guest']))
+		if ($profile['aim']['name'] != '' && !$user_info['is_guest'])
 			$data['aim'] = $profile['aim']['name'];
-		if ($profile['yim']['name'] != '' && !(!empty($modSettings['guest_hideContacts']) && $user_info['is_guest']))
+		if ($profile['yim']['name'] != '' && !$user_info['is_guest'])
 			$data['yim'] = $profile['yim']['name'];
-		if (!empty($profile['skype']['name']) && !(!empty($modSettings['guest_hideContacts']) && $user_info['is_guest']))
+		if (!empty($profile['skype']['name']) && !$user_info['is_guest'])
 			$data['skype'] = $profile['skype']['name'];
 
 		if ($profile['website']['title'] != '')

+ 1 - 1
Sources/Security.php

@@ -1164,7 +1164,7 @@ function showEmailAddress($userProfile_hideEmail, $userProfile_id)
 	// If the forum is set to show full email addresses: yes.
 	// Otherwise: no_through_forum.
 
-	if ((!empty($modSettings['guest_hideContacts']) && $user_info['is_guest']) || isset($_SESSION['ban']['cannot_post']))
+	if ($user_info['is_guest'] || isset($_SESSION['ban']['cannot_post']))
 		return 'no';
 	elseif ((!$user_info['is_guest'] && $user_info['id'] == $userProfile_id && !$userProfile_hideEmail) || allowedTo('moderate_forum'))
 		return 'yes_permission_override';

+ 1 - 1
Sources/SendTopic.php

@@ -153,7 +153,7 @@ function CustomEmail()
 	global $context, $modSettings, $user_info, $smcFunc, $txt, $scripturl, $sourcedir;
 
 	// Can the user even see this information?
-	if ($user_info['is_guest'] && !empty($modSettings['guest_hideContacts']))
+	if ($user_info['is_guest'])
 		fatal_lang_error('no_access', false);
 
 	isAllowedTo('send_email_to_members');

+ 0 - 3
Themes/default/languages/Help.english.php

@@ -457,9 +457,6 @@ $helptxt['pm_posts_per_hour'] = 'This will limit the number of personal messages
 
 $helptxt['default_personal_text'] = 'Sets the default text a new user will have as their &quot;personal text.&quot; This option is not available when personal text is disabled, or when users can set personal text on registration for themselves.';
 
-$helptxt['guest_hideContacts'] = 'If selected this option will hide the email addresses and messenger contact details
-	of all members from any guests on your forum';
-
 $helptxt['registration_method'] = 'This option determines what method of registration is used for people wishing to join your forum. You can select from:<br /><br />
 	<ul class="normallist">
 		<li>

+ 0 - 1
Themes/default/languages/ManageSettings.english.php

@@ -16,7 +16,6 @@ $txt['allow_guestAccess'] = 'Allow guests to browse the forum';
 $txt['userLanguage'] = 'Enable user-selectable language support';
 $txt['allow_editDisplayName'] = 'Allow users to edit their displayed name';
 $txt['allow_hideOnline'] = 'Allow non-administrators to hide their online status';
-$txt['guest_hideContacts'] = 'Do not reveal contact details of members to guests';
 $txt['titlesEnable'] = 'Enable custom titles';
 $txt['enable_buddylist'] = 'Enable buddy/ignore lists';
 $txt['enable_unwatch'] = 'Enable unwatch topics';

+ 0 - 1
other/install_2-1_mysql.sql

@@ -1775,7 +1775,6 @@ VALUES ('smfVersion', '{$smf_version}'),
 	('send_welcomeEmail', '1'),
 	('allow_editDisplayName', '1'),
 	('allow_hideOnline', '1'),
-	('guest_hideContacts', '1'),
 	('spamWaitTime', '5'),
 	('pm_spam_settings', '10,5,20'),
 	('reserveWord', '0'),

+ 0 - 1
other/install_2-1_postgresql.sql

@@ -2275,7 +2275,6 @@ INSERT INTO {$db_prefix}settings (variable, value) VALUES ('send_validation_onCh
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('send_welcomeEmail', '1');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('allow_editDisplayName', '1');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('allow_hideOnline', '1');
-INSERT INTO {$db_prefix}settings (variable, value) VALUES ('guest_hideContacts', '1');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('spamWaitTime', '5');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('pm_spam_settings', '10,5,20');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('reserveWord', '0');

+ 0 - 1
other/install_2-1_sqlite.sql

@@ -1921,7 +1921,6 @@ INSERT INTO {$db_prefix}settings (variable, value) VALUES ('send_validation_onCh
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('send_welcomeEmail', '1');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('allow_editDisplayName', '1');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('allow_hideOnline', '1');
-INSERT INTO {$db_prefix}settings (variable, value) VALUES ('guest_hideContacts', '1');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('spamWaitTime', '5');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('pm_spam_settings', '10,5,20');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('reserveWord', '0');

+ 0 - 1
other/install_2-1_sqlite3.sql

@@ -1921,7 +1921,6 @@ INSERT INTO {$db_prefix}settings (variable, value) VALUES ('send_validation_onCh
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('send_welcomeEmail', '1');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('allow_editDisplayName', '1');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('allow_hideOnline', '1');
-INSERT INTO {$db_prefix}settings (variable, value) VALUES ('guest_hideContacts', '1');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('spamWaitTime', '5');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('pm_spam_settings', '10,5,20');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('reserveWord', '0');

+ 8 - 0
other/upgrade_2-1_mysql.sql

@@ -424,6 +424,14 @@ DELETE FROM {$db_prefix}settings
 WHERE variable LIKE 'integrate_%';
 ---#
 
+/******************************************************************************/
+--- Cleaning up old settings
+/******************************************************************************/
+---# Showing contact details to guests should never happen.
+DELETE FROM {$db_prefix}settings
+WHERE variable = 'guest_hideContacts';
+---#
+
 /******************************************************************************/
 --- Upgrading "verification questions" feature
 /******************************************************************************/

+ 8 - 0
other/upgrade_2-1_postgresql.sql

@@ -486,6 +486,14 @@ DELETE FROM {$db_prefix}settings
 WHERE variable LIKE 'integrate_%';
 ---#
 
+/******************************************************************************/
+--- Cleaning up old settings
+/******************************************************************************/
+---# Showing contact details to guests should never happen.
+DELETE FROM {$db_prefix}settings
+WHERE variable = 'guest_hideContacts';
+---#
+
 /******************************************************************************/
 --- Upgrading "verification questions" feature
 /******************************************************************************/

+ 8 - 0
other/upgrade_2-1_sqlite.sql

@@ -476,6 +476,14 @@ DELETE FROM {$db_prefix}settings
 WHERE variable LIKE 'integrate_%';
 ---#
 
+/******************************************************************************/
+--- Cleaning up old settings
+/******************************************************************************/
+---# Showing contact details to guests should never happen.
+DELETE FROM {$db_prefix}settings
+WHERE variable = 'guest_hideContacts';
+---#
+
 /******************************************************************************/
 --- Upgrading "verification questions" feature
 /******************************************************************************/