Browse Source

! Missed a few things

Signed-off-by: Michael Eshom <[email protected]>
Michael Eshom 10 years ago
parent
commit
e27a912395

+ 0 - 3
Sources/ManagePermissions.php

@@ -1126,7 +1126,6 @@ function setPermissionLevel($level, $group, $profile = 'null')
 		'karma_edit',
 		'pm_read',
 		'pm_send',
-		'send_email_to_members',
 		'profile_view',
 		'profile_extra_own',
 		'profile_signature_own',
@@ -1452,7 +1451,6 @@ function loadAllPermissions()
 			'pm_send' => array(false, 'pm'),
 			'pm_draft' => array(false, 'pm'),
 			'pm_autosave_draft' => array(false, 'pm'),
-			'send_email_to_members' => array(false, 'pm'),
 			'calendar_view' => array(false, 'calendar'),
 			'calendar_post' => array(false, 'calendar'),
 			'calendar_edit' => array(true, 'calendar'),
@@ -2237,7 +2235,6 @@ function loadIllegalGuestPermissions()
 		'remove',
 		'report_any',
 		'report_user',
-		'send_email_to_members',
 		'send_mail',
 		'split_any',
 	);

+ 12 - 4
Sources/Memberlist.php

@@ -136,7 +136,7 @@ function Memberlist()
 	);
 
 	$context['can_send_pm'] = allowedTo('pm_send');
-	$context['can_send_email'] = allowedTo('send_email_to_members');
+	$context['can_send_email'] = allowedTo('moderate_forum');
 
 	// Build the memberlist button array.
 	$context['memberlist_buttons'] = array(
@@ -525,12 +525,20 @@ function MLSearch()
 			'group' => $txt['mlist_search_group'],
 		);
 
+		// Sorry, but you can't search by email unless you can view emails
+		if (!allowedTo('moderate_forum'))
+		{
+			unset($context['search_fields']['email']);
+			$context['search_defaults'] = array('name');
+		}
+		else
+		{
+			$context['search_defaults'] = array('name', 'email');
+		}
+
 		foreach ($context['custom_search_fields'] as $field)
 			$context['search_fields']['cust_' . $field['colname']] = sprintf($txt['mlist_search_by'], $field['name']);
 
-		// What do we search for by default?
-		$context['search_defaults'] = array('name', 'email');
-
 		$context['sub_template'] = 'search';
 		$context['old_search'] = isset($_GET['search']) ? $_GET['search'] : (isset($_POST['search']) ? $smcFunc['htmlspecialchars']($_POST['search']) : '');
 

+ 1 - 1
Sources/PersonalMessage.php

@@ -990,7 +990,7 @@ function MessageFolder()
 		$messages_request = false;
 
 	$context['can_send_pm'] = allowedTo('pm_send');
-	$context['can_send_email'] = allowedTo('send_email_to_members');
+	$context['can_send_email'] = allowedTo('moderate_forum');
 	if (!WIRELESS)
 		$context['sub_template'] = 'folder';
 	$context['page_title'] = $txt['pm_inbox'];

+ 1 - 1
Sources/Profile-Modify.php

@@ -1269,7 +1269,7 @@ function editBuddyIgnoreLists($memID)
 
 	// Can we email the user direct?
 	$context['can_moderate_forum'] = allowedTo('moderate_forum');
-	$context['can_send_email'] = allowedTo('send_email_to_members');
+	$context['can_send_email'] = allowedTo('moderate_forum');
 
 	$subActions = array(
 		'buddies' => array('editBuddies', $txt['editBuddies']),

+ 0 - 2
Themes/default/languages/ManagePermissions.english.php

@@ -108,8 +108,6 @@ $txt['permissionname_pm_read'] = 'Read personal messages';
 $txt['permissionhelp_pm_read'] = 'This permission allows users to access the Personal Messages section and read their Personal Messages. Without this permission a user is unable to send Personal Messages.';
 $txt['permissionname_pm_send'] = 'Send personal messages';
 $txt['permissionhelp_pm_send'] = 'Send personal messages to other registered members. Requires the \'Read personal messages\' permission.';
-$txt['permissionname_send_email_to_members'] = 'Send emails';
-$txt['permissionhelp_send_email_to_members'] = 'Send emails to other registered members.';
 
 $txt['permissiongroup_calendar'] = 'Calendar';
 $txt['permissionname_calendar_view'] = 'View the calendar';