Browse Source

Merge pull request #861 from Arantor/release-2.1

Viewing your own profile shouldn't really be a permission
Arantor 11 years ago
parent
commit
89e701b603

+ 2 - 2
SSI.php

@@ -1521,7 +1521,7 @@ function ssi_todaysBirthdays($output_method = 'echo')
 {
 	global $scripturl, $modSettings, $user_info;
 
-	if (empty($modSettings['cal_enabled']) || !allowedTo('calendar_view') || !allowedTo('profile_view_any'))
+	if (empty($modSettings['cal_enabled']) || !allowedTo('calendar_view') || !allowedTo('profile_view'))
 		return;
 
 	$eventOptions = array(
@@ -1595,7 +1595,7 @@ function ssi_todaysCalendar($output_method = 'echo')
 		return;
 
 	$eventOptions = array(
-		'include_birthdays' => allowedTo('profile_view_any'),
+		'include_birthdays' => allowedTo('profile_view'),
 		'include_holidays' => true,
 		'include_events' => true,
 		'num_days_shown' => empty($modSettings['cal_days_for_index']) || $modSettings['cal_days_for_index'] < 1 ? 1 : $modSettings['cal_days_for_index'],

+ 1 - 1
Sources/Display.php

@@ -1273,7 +1273,7 @@ function prepareDisplayContext($reset = false)
 	}
 	else
 	{
-		$memberContext[$message['id_member']]['can_view_profile'] = allowedTo('profile_view_any') || ($message['id_member'] == $user_info['id'] && allowedTo('profile_view_own'));
+		$memberContext[$message['id_member']]['can_view_profile'] = allowedTo('profile_view') || ($message['id_member'] == $user_info['id'] && !$user_info['is_guest']);
 		$memberContext[$message['id_member']]['is_topic_starter'] = $message['id_member'] == $context['topic_starter_id'];
 		$memberContext[$message['id_member']]['can_see_warning'] = !isset($context['disabled_fields']['warning_status']) && $memberContext[$message['id_member']]['warning_status'] && ($context['user']['can_mod'] || (!$user_info['is_guest'] && !empty($modSettings['warning_show']) && ($modSettings['warning_show'] > 1 || $message['id_member'] == $user_info['id'])));
 	}

+ 8 - 0
Sources/Load.php

@@ -879,6 +879,14 @@ function loadPermissions()
 		}
 		else
 			$user_info['mod_cache'] = $_SESSION['mc'];
+
+		// This is a useful phantom permission added to the current user, and only the current user while they are logged in.
+		// For example this drastically simplifies certain changes to the profile area.
+		$user_info['permissions'][] = 'is_not_guest';
+		// And now some backwards compatibility stuff for mods and whatnot that aren't expecting the new permissions.
+		$user_info['permissions'][] = 'profile_view_own';
+		if (in_array('profile_view', $user_info['permissions']))
+			$user_info['permissions'][] = 'profile_view_any';
 	}
 }
 

+ 2 - 4
Sources/ManagePermissions.php

@@ -1101,7 +1101,6 @@ function setPermissionLevel($level, $group, $profile = 'null')
 		'calendar_view',
 		'view_stats',
 		'who_view',
-		'profile_view_own',
 		'profile_identity_own',
 	);
 	$groupLevels['board']['restrict'] = array(
@@ -1124,7 +1123,7 @@ function setPermissionLevel($level, $group, $profile = 'null')
 		'pm_read',
 		'pm_send',
 		'send_email_to_members',
-		'profile_view_any',
+		'profile_view',
 		'profile_extra_own',
 		'profile_signature_own',
 		'profile_forum_own',
@@ -1493,7 +1492,7 @@ function loadAllPermissions($loadType = 'classic')
 			'manage_bans' => array(false, 'member_admin', 'administrate'),
 			'send_mail' => array(false, 'member_admin', 'administrate'),
 			'issue_warning' => array(false, 'member_admin', 'moderate_general'),
-			'profile_view' => array(true, 'profile', 'view_basic_info', 'view_basic_info'),
+			'profile_view' => array(false, 'profile', 'view_basic_info'),
 			'profile_identity' => array(true, 'profile', 'edit_profile', 'moderate_general'),
 			'profile_forum' => array(true, 'profile', 'edit_profile', 'moderate_general'),
 			'profile_password' => array(true, 'profile', 'edit_profile', 'moderate_general'),
@@ -2259,7 +2258,6 @@ function loadIllegalGuestPermissions()
 		'profile_server_avatar',
 		'profile_upload_avatar',
 		'profile_remote_avatar',
-		'profile_view_own',
 		'mark_any_notify',
 		'mark_notify',
 		'admin_forum',

+ 1 - 1
Sources/News.php

@@ -897,7 +897,7 @@ function getXmlProfile($xml_format)
 	// Make sure the id is a number and not "I like trying to hack the database".
 	$_GET['u'] = (int) $_GET['u'];
 	// Load the member's contextual information!
-	if (!loadMemberContext($_GET['u']) || !allowedTo('profile_view_any'))
+	if (!loadMemberContext($_GET['u']) || !allowedTo('profile_view'))
 		return array();
 
 	// Okay, I admit it, I'm lazy.  Stupid $_GET['u'] is long and hard to type.

+ 1 - 1
Sources/PersonalMessage.php

@@ -967,7 +967,7 @@ function prepareMessageContext($type = 'subject', $reset = false)
 	}
 	else
 	{
-		$memberContext[$message['id_member_from']]['can_view_profile'] = allowedTo('profile_view_any') || ($message['id_member_from'] == $user_info['id'] && allowedTo('profile_view_own'));
+		$memberContext[$message['id_member_from']]['can_view_profile'] = allowedTo('profile_view') || ($message['id_member_from'] == $user_info['id'] && !$user_info['is_guest']);
 		$memberContext[$message['id_member_from']]['can_see_warning'] = !isset($context['disabled_fields']['warning_status']) && $memberContext[$message['id_member_from']]['warning_status'] && ($context['user']['can_mod'] || (!empty($modSettings['warning_show']) && ($modSettings['warning_show'] > 1 || $message['id_member_from'] == $user_info['id'])));
 	}
 

+ 15 - 15
Sources/Profile.php

@@ -93,8 +93,8 @@ function ModifyProfile($post_errors = array())
 					'file' => 'Profile-View.php',
 					'function' => 'summary',
 					'permission' => array(
-						'own' => 'profile_view_own',
-						'any' => 'profile_view_any',
+						'own' => 'is_not_guest',
+						'any' => 'profile_view',
 					),
 				),
 				'statistics' => array(
@@ -102,8 +102,8 @@ function ModifyProfile($post_errors = array())
 					'file' => 'Profile-View.php',
 					'function' => 'statPanel',
 					'permission' => array(
-						'own' => 'profile_view_own',
-						'any' => 'profile_view_any',
+						'own' => 'is_not_guest',
+						'any' => 'profile_view',
 					),
 				),
 				'showposts' => array(
@@ -111,14 +111,14 @@ function ModifyProfile($post_errors = array())
 					'file' => 'Profile-View.php',
 					'function' => 'showPosts',
 					'subsections' => array(
-						'messages' => array($txt['showMessages'], array('profile_view_own', 'profile_view_any')),
-						'topics' => array($txt['showTopics'], array('profile_view_own', 'profile_view_any')),
-						'unwatchedtopics' => array($txt['showUnwatched'], array('profile_view_own', 'profile_view_any'), 'enabled' => $modSettings['enable_unwatch'] && $context['user']['is_owner']),
-						'attach' => array($txt['showAttachments'], array('profile_view_own', 'profile_view_any')),
+						'messages' => array($txt['showMessages'], array('is_not_guest', 'profile_view')),
+						'topics' => array($txt['showTopics'], array('is_not_guest', 'profile_view')),
+						'unwatchedtopics' => array($txt['showUnwatched'], array('is_not_guest', 'profile_view'), 'enabled' => $modSettings['enable_unwatch'] && $context['user']['is_owner']),
+						'attach' => array($txt['showAttachments'], array('is_not_guest', 'profile_view')),
 					),
 					'permission' => array(
-						'own' => 'profile_view_own',
-						'any' => 'profile_view_any',
+						'own' => 'is_not_guest',
+						'any' => 'profile_view',
 					),
 				),
 				'showdrafts' => array(
@@ -127,7 +127,7 @@ function ModifyProfile($post_errors = array())
 					'function' => 'showProfileDrafts',
 					'enabled' => !empty($modSettings['drafts_post_enabled']) && $context['user']['is_owner'],
 					'permission' => array(
-						'own' => 'profile_view_own',
+						'own' => 'is_not_guest',
 						'any' =>  array(),
 					),
 				),
@@ -148,7 +148,7 @@ function ModifyProfile($post_errors = array())
 						'activity' => array($txt['trackActivity'], 'moderate_forum'),
 						'ip' => array($txt['trackIP'], 'moderate_forum'),
 						'edits' => array($txt['trackEdits'], 'moderate_forum', 'enabled' => !empty($modSettings['userlog_enabled'])),
-						'logins' => array($txt['trackLogins'], array('profile_view_own', 'moderate_forum')),
+						'logins' => array($txt['trackLogins'], array('is_not_guest', 'moderate_forum')),
 					),
 					'permission' => array(
 						'own' => 'moderate_forum',
@@ -161,7 +161,7 @@ function ModifyProfile($post_errors = array())
 					'file' => 'Profile-View.php',
 					'function' => 'viewWarning',
 					'permission' => array(
-						'own' => 'profile_view_own',
+						'own' => 'is_not_guest', // @todo this needs to be a view-own warning
 						'any' => 'issue_warning',
 					),
 				),
@@ -280,7 +280,7 @@ function ModifyProfile($post_errors = array())
 					'token' => 'profile-gm%u',
 					'token_type' => 'request',
 					'permission' => array(
-						'own' => array('profile_view_own'),
+						'own' => array('is_not_guest'),
 						'any' => array('manage_membergroups'),
 					),
 				),
@@ -323,7 +323,7 @@ function ModifyProfile($post_errors = array())
 					'function' => 'subscriptions',
 					'enabled' => !empty($modSettings['paid_enabled']),
 					'permission' => array(
-						'own' => array('profile_view_own'),
+						'own' => array('is_not_guest'),
 						'any' => array('moderate_forum'),
 					),
 				),

+ 1 - 1
Sources/Subs-Members.php

@@ -998,7 +998,7 @@ function groupsAllowedTo($permission, $board_id = null)
 		'denied' => array(),
 	);
 
-	// Assume we're dealing with regular permissions (like profile_view_own).
+	// Assume we're dealing with regular permissions (like profile_view).
 	if ($board_id === null)
 	{
 		$request = $smcFunc['db_query']('', '

+ 1 - 1
Sources/Subs.php

@@ -3790,7 +3790,7 @@ function setupMenuContext()
 	// Set up the menu privileges.
 	$context['allow_search'] = !empty($modSettings['allow_guestAccess']) ? allowedTo('search_posts') : (!$user_info['is_guest'] && allowedTo('search_posts'));
 	$context['allow_admin'] = allowedTo(array('admin_forum', 'manage_boards', 'manage_permissions', 'moderate_forum', 'manage_membergroups', 'manage_bans', 'send_mail', 'edit_news', 'manage_attachments', 'manage_smileys'));
-	$context['allow_edit_profile'] = !$user_info['is_guest'] && allowedTo(array('profile_view_own', 'profile_view_any', 'profile_identity_own', 'profile_identity_any', 'profile_forum_own', 'profile_forum_any', 'moderate_forum', 'manage_membergroups'));
+	$context['allow_edit_profile'] = !$user_info['is_guest'];
 	$context['allow_memberlist'] = allowedTo('view_mlist');
 	$context['allow_calendar'] = allowedTo('calendar_view') && !empty($modSettings['cal_enabled']);
 	$context['allow_moderation_center'] = $context['user']['can_mod'];

+ 5 - 3
Sources/Who.php

@@ -484,8 +484,10 @@ function determineActions($urls, $preferred_prefix = false)
 		$smcFunc['db_free_result']($result);
 	}
 
-	// Load member names for the profile.
-	if (!empty($profile_ids) && (allowedTo('profile_view_any') || allowedTo('profile_view_own')))
+	// Load member names for the profile. (is_not_guest permission for viewing their own profile)
+	$allow_view_own = allowedTo('is_not_guest');
+	$allow_view_any = allowedTo('profile_view');
+	if (!empty($profile_ids) && ($allow_view_any || $allow_view_own))
 	{
 		$result = $smcFunc['db_query']('', '
 			SELECT id_member, real_name
@@ -499,7 +501,7 @@ function determineActions($urls, $preferred_prefix = false)
 		while ($row = $smcFunc['db_fetch_assoc']($result))
 		{
 			// If they aren't allowed to view this person's profile, skip it.
-			if (!allowedTo('profile_view_any') && $user_info['id'] != $row['id_member'])
+			if (!$allow_view_any && ($user_info['id'] != $row['id_member']))
 				continue;
 
 			// Set their action on each - session/text to sprintf.

+ 1 - 2
Themes/default/languages/Errors.english.php

@@ -121,8 +121,7 @@ $txt['cannot_profile_title_own'] = 'You are not allowed to change your custom ti
 $txt['cannot_profile_server_avatar'] = 'You are not permitted to use a server stored avatar.';
 $txt['cannot_profile_upload_avatar'] = 'You do not have permission to upload an avatar.';
 $txt['cannot_profile_remote_avatar'] = 'You don\'t have the privilege of using a remote avatar.';
-$txt['cannot_profile_view_own'] = 'Many apologies, but you can\'t view your own profile.';
-$txt['cannot_profile_view_any'] = 'Many apologies, but you can\'t view just any profile.';
+$txt['cannot_profile_view'] = 'Many apologies, but you can\'t view just any profile.';
 $txt['cannot_delete_own'] = 'You are not, on this board, allowed to delete your own posts.';
 $txt['cannot_delete_replies'] = 'Sorry, but you cannot remove these posts, even though they are replies to your topic.';
 $txt['cannot_delete_any'] = 'Deleting just any posts in this board is not allowed.';

+ 3 - 6
Themes/default/languages/ManagePermissions.english.php

@@ -160,10 +160,8 @@ $txt['permissionname_issue_warning'] = 'Issue warnings to members';
 $txt['permissionhelp_issue_warning'] = 'Issue a warning to members of the forum and change that members\' warning level. Requires the warning system to be enabled.';
 
 $txt['permissiongroup_profile'] = 'Member Profiles';
-$txt['permissionname_profile_view'] = 'View profile summary and stats';
-$txt['permissionhelp_profile_view'] = 'This permission allows users clicking on a username to see a summary of profile settings, some statistics and all posts of the user.';
-$txt['permissionname_profile_view_own'] = 'Own profile';
-$txt['permissionname_profile_view_any'] = 'Any profile';
+$txt['permissionname_profile_view'] = 'View other members\' profile summary and stats pages';
+$txt['permissionhelp_profile_view'] = 'This permission allows users clicking on a username to see a summary of other users\' profile settings, some statistics and their posts.';
 $txt['permissionname_profile_identity'] = 'Edit account settings';
 $txt['permissionhelp_profile_identity'] = 'Account settings are the basic settings of a profile, like password, email address, membergroup and preferred language.';
 $txt['permissionname_profile_identity_own'] = 'Own profile';
@@ -314,8 +312,7 @@ $txt['permissiongroup_simple_administrate'] = 'Carry out administrative duties';
 
 $txt['permissionname_simple_calendar_edit_own'] = 'Edit their own calendar events';
 $txt['permissionname_simple_calendar_edit_any'] = 'Edit other people\'s calendar events';
-$txt['permissionname_simple_profile_view_own'] = 'View their own profile';
-$txt['permissionname_simple_profile_view_any'] = 'View other people\'s profiles';
+$txt['permissionname_simple_profile_view'] = 'View other people\'s profiles';
 $txt['permissionname_simple_profile_identity_own'] = 'Edit their account settings';
 $txt['permissionname_simple_profile_identity_any'] = 'Edit other people\'s account settings';
 $txt['permissionname_simple_profile_extra_own'] = 'Edit their additional profile options';

+ 6 - 3
Themes/default/languages/Reports.english.php

@@ -59,6 +59,8 @@ $txt['board_perms_name_post_unapproved_attachments'] = 'Post unapproved attachme
 $txt['board_perms_name_post_unapproved_topics'] = 'Post unapproved topics';
 $txt['board_perms_name_post_unapproved_replies_any'] = 'Post unapproved replies in any topic';
 $txt['board_perms_name_post_unapproved_replies_own'] = 'Post unapproved replies in own topic';
+$txt['board_perms_name_post_draft'] = 'Save drafts of posts';
+$txt['board_perms_name_post_autosave_draft'] = 'Automatically save drafts of posts';
 $txt['board_perms_name_remove_any'] = 'Remove any topic';
 $txt['board_perms_name_remove_own'] = 'Remove own topics';
 $txt['board_perms_name_report_any'] = 'Report any post';
@@ -112,6 +114,8 @@ $txt['group_perms_name_manage_smileys'] = 'Manage smileys and message icons';
 $txt['group_perms_name_moderate_forum'] = 'Moderate the forum';
 $txt['group_perms_name_pm_read'] = 'Read personal messages';
 $txt['group_perms_name_pm_send'] = 'Send personal messages';
+$txt['group_perms_name_pm_draft'] = 'Save draft personal messages';
+$txt['group_perms_name_pm_autosave_draft'] = 'Automatically save draft personal messages';
 $txt['group_perms_name_profile_extra_any'] = 'Edit any additional options';
 $txt['group_perms_name_profile_extra_own'] = 'Edit own additional options';
 $txt['group_perms_name_profile_identity_any'] = 'Edit any account settings';
@@ -123,10 +127,9 @@ $txt['group_perms_name_profile_remove_any'] = 'Delete any account';
 $txt['group_perms_name_profile_remove_own'] = 'Delete own account';
 $txt['group_perms_name_profile_title_any'] = 'Edit any custom title';
 $txt['group_perms_name_profile_title_own'] = 'Edit own custom title';
-$txt['group_perms_name_profile_view_any'] = 'View any profile';
-$txt['group_perms_name_profile_view_own'] = 'View  own profile';
+$txt['group_perms_name_profile_view'] = 'View any user\'s profile';
 $txt['group_perms_name_search_posts'] = 'Search for posts';
-$txt['group_perms_name_send_mail'] = 'Send a forum email to members';
+$txt['group_perms_name_send_email_to_members'] = 'Send a forum email to members';
 $txt['group_perms_name_view_mlist'] = 'View the memberlist';
 $txt['group_perms_name_view_stats'] = 'View forum stats';
 $txt['group_perms_name_who_view'] = 'See who\'s online';

+ 2 - 4
other/install_2-1_mysql.sql

@@ -1488,8 +1488,7 @@ VALUES (-1, 'search_posts'),
 	(-1, 'view_stats'),
 	(0, 'view_mlist'),
 	(0, 'search_posts'),
-	(0, 'profile_view_own'),
-	(0, 'profile_view_any'),
+	(0, 'profile_view'),
 	(0, 'pm_read'),
 	(0, 'pm_send'),
 	(0, 'pm_draft'),
@@ -1513,8 +1512,7 @@ VALUES (-1, 'search_posts'),
 	(0, 'karma_edit'),
 	(2, 'view_mlist'),
 	(2, 'search_posts'),
-	(2, 'profile_view_own'),
-	(2, 'profile_view_any'),
+	(2, 'profile_view'),
 	(2, 'pm_read'),
 	(2, 'pm_send'),
 	(2, 'pm_draft'),

+ 2 - 4
other/install_2-1_postgresql.sql

@@ -1938,8 +1938,7 @@ INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (-1, 'calendar
 INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (-1, 'view_stats');
 INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (0, 'view_mlist');
 INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (0, 'search_posts');
-INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (0, 'profile_view_own');
-INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (0, 'profile_view_any');
+INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (0, 'profile_view');
 INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (0, 'pm_read');
 INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (0, 'pm_send');
 INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (0, 'pm_draft');
@@ -1963,8 +1962,7 @@ INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (0, 'send_emai
 INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (0, 'karma_edit');
 INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (2, 'view_mlist');
 INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (2, 'search_posts');
-INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (2, 'profile_view_own');
-INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (2, 'profile_view_any');
+INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (2, 'profile_view');
 INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (2, 'pm_read');
 INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (2, 'pm_send');
 INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (2, 'pm_draft');

+ 2 - 4
other/install_2-1_sqlite.sql

@@ -1614,8 +1614,7 @@ INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (-1, 'calendar
 INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (-1, 'view_stats');
 INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (0, 'view_mlist');
 INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (0, 'search_posts');
-INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (0, 'profile_view_own');
-INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (0, 'profile_view_any');
+INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (0, 'profile_view');
 INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (0, 'pm_read');
 INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (0, 'pm_send');
 INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (0, 'pm_draft');
@@ -1639,8 +1638,7 @@ INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (0, 'send_emai
 INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (0, 'karma_edit');
 INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (2, 'view_mlist');
 INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (2, 'search_posts');
-INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (2, 'profile_view_own');
-INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (2, 'profile_view_any');
+INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (2, 'profile_view');
 INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (2, 'pm_read');
 INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (2, 'pm_send');
 INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (2, 'pm_draft');

+ 2 - 4
other/install_2-1_sqlite3.sql

@@ -1614,8 +1614,7 @@ INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (-1, 'calendar
 INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (-1, 'view_stats');
 INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (0, 'view_mlist');
 INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (0, 'search_posts');
-INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (0, 'profile_view_own');
-INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (0, 'profile_view_any');
+INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (0, 'profile_view');
 INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (0, 'pm_read');
 INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (0, 'pm_send');
 INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (0, 'pm_draft');
@@ -1638,8 +1637,7 @@ INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (0, 'send_emai
 INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (0, 'karma_edit');
 INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (2, 'view_mlist');
 INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (2, 'search_posts');
-INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (2, 'profile_view_own');
-INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (2, 'profile_view_any');
+INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (2, 'profile_view');
 INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (2, 'pm_read');
 INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (2, 'pm_send');
 INSERT INTO {$db_prefix}permissions (id_group, permission) VALUES (2, 'pm_draft');

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

@@ -518,6 +518,17 @@ SET install_state = 0;
 /******************************************************************************/
 --- Updating profile permissions...
 /******************************************************************************/
+---# Removing the old "view your own profile" permission
+DELETE FROM {$db_prefix}permissions
+WHERE permission = 'profile_view_own';
+---#
+
+---# Updating the old "view any profile" permission
+UPDATE {$db_prefix}permissions
+SET permission = 'profile_view'
+WHERE permission = 'profile_view_any';
+---#
+
 ---# Adding "profile_password_own"
 ---{
 $inserts = array();

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

@@ -592,6 +592,17 @@ SET install_state = 0;
 /******************************************************************************/
 --- Updating profile permissions...
 /******************************************************************************/
+---# Removing the old "view your own profile" permission
+DELETE FROM {$db_prefix}permissions
+WHERE permission = 'profile_view_own';
+---#
+
+---# Updating the old "view any profile" permission
+UPDATE {$db_prefix}permissions
+SET permission = 'profile_view'
+WHERE permission = 'profile_view_any';
+---#
+
 ---# Adding "profile_password_own"
 ---{
 $inserts = array();

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

@@ -575,6 +575,17 @@ SET install_state = 0;
 /******************************************************************************/
 --- Updating profile permissions...
 /******************************************************************************/
+---# Removing the old "view your own profile" permission
+DELETE FROM {$db_prefix}permissions
+WHERE permission = 'profile_view_own';
+---#
+
+---# Updating the old "view any profile" permission
+UPDATE {$db_prefix}permissions
+SET permission = 'profile_view'
+WHERE permission = 'profile_view_any';
+---#
+
 ---# Adding "profile_password_own"
 ---{
 $inserts = array();