Browse Source

! Fix Mantis bug 4922 - make the delete profile code slightly more logical by indicating the two different things that can be done, make it clear that they are unconnected. Also fix layout and clarify the wording on one of the options that was ambiguous, even inaccurate.

Signed-off-by: Peter Spicer <[email protected]>
Peter Spicer 11 years ago
parent
commit
505b82ec3e

+ 1 - 1
Sources/Profile-Actions.php

@@ -592,7 +592,7 @@ function deleteAccount2($memID)
 
 		// Now, have you been naughty and need your posts deleting?
 		// @todo Should this check board permissions?
-		if ($_POST['remove_type'] != 'none' && allowedTo('moderate_forum'))
+		if (!empty($_POST['deletePosts']) && in_array($_POST['remove_type'], array('posts', 'topics')) && allowedTo('moderate_forum'))
 		{
 			// Include RemoveTopics - essential for this type of work!
 			require_once($sourcedir . '/RemoveTopic.php');

+ 2 - 3
Themes/default/Profile.template.php

@@ -2642,7 +2642,7 @@ function template_deleteAccount()
 	// If deleting another account give them a lovely info box.
 	if (!$context['user']['is_owner'])
 		echo '
-			<p class="windowbg2 description">', $txt['deleteAccount_desc'], '</p>';
+			<p class="information">', $txt['deleteAccount_desc'], '</p>';
 	echo '
 			<div class="windowbg2">
 				<div class="content">';
@@ -2682,9 +2682,8 @@ function template_deleteAccount()
 		if ($context['can_delete_posts'])
 			echo '
 					<div>
-						', $txt['deleteAccount_posts'], ':
+						<label for="deletePosts"><input type="checkbox" name="deletePosts" id="deletePosts" value="1" class="input_check" /> ', $txt['deleteAccount_posts'], ':</label>
 						<select name="remove_type">
-							<option value="none">', $txt['deleteAccount_none'], '</option>
 							<option value="posts">', $txt['deleteAccount_all_posts'], '</option>
 							<option value="topics">', $txt['deleteAccount_topics'], '</option>
 						</select>

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

@@ -184,8 +184,7 @@ $txt['deleteAccount_warning'] = 'Warning - These actions are irreversible!';
 $txt['deleteAccount_desc'] = 'From this page you can delete this user\'s account and posts.';
 $txt['deleteAccount_member'] = 'Delete this member\'s account';
 $txt['deleteAccount_posts'] = 'Remove posts made by this member';
-$txt['deleteAccount_none'] = 'None';
-$txt['deleteAccount_all_posts'] = 'All Posts';
+$txt['deleteAccount_all_posts'] = 'Replies to Topics';
 $txt['deleteAccount_topics'] = 'Topics and Posts';
 $txt['deleteAccount_confirm'] = 'Are you completely sure you want to delete this account?';
 $txt['deleteAccount_approval'] = 'Please note that the forum moderators will have to approve this account\'s deletion before it will be removed.';