Browse Source

Merge pull request #260 from emanuele45/banEdit

Ban edit
emanuele45 11 years ago
parent
commit
61eb99ca16

File diff suppressed because it is too large
+ 1046 - 601
Sources/ManageBans.php


+ 6 - 1
Sources/Security.php

@@ -777,7 +777,12 @@ function createToken($action, $type = 'post')
  */
 function validateToken($action, $type = 'post', $reset = true)
 {
-	global $modSettings;
+	global $modSettings, $db_show_debug;
+
+	// Sorry, but token are not the best while debugging
+	// @todo: remove before commit...
+	if (!empty($db_show_debug))
+		return true;
 
 	$type = $type == 'get' || $type == 'request' ? $type : 'post';
 

+ 114 - 145
Themes/default/ManageBans.template.php

@@ -16,7 +16,7 @@ function template_ban_edit()
 
 	echo '
 	<div id="manage_bans">
-		<form id="admin_form_wrapper" action="', $scripturl, '?action=admin;area=ban;sa=edit" method="post" accept-charset="', $context['character_set'], '" onsubmit="if (this.ban_name.value == \'\') {alert(\'', $txt['ban_name_empty'], '\'); return false;} if (this.partial_ban.checked &amp;&amp; !(this.cannot_post.checked || this.cannot_register.checked || this.cannot_login.checked)) {alert(\'', $txt['ban_restriction_empty'], '\'); return false;}">
+		<form id="admin_form_wrapper" action="', $context['form_url'], '" method="post" accept-charset="', $context['character_set'], '" onsubmit="return confirmBan(this);">
 			<div class="cat_bar">
 				<h3 class="catbg">
 					', $context['ban']['is_new'] ? $txt['ban_add_new'] : $txt['ban_edit'] . ' \'' . $context['ban']['name'] . '\'', '
@@ -27,36 +27,61 @@ function template_ban_edit()
 		echo '
 			<div class="information">', $txt['ban_add_notes'], '</div>';
 
+	// If there were errors for sending the PM, show them.
+	if (!empty($context['error_messages']))
+	{
+		echo '
+			<div class="errorbox">
+				<strong>', $txt['ban_errors_detected'], '</strong>
+				<ul>';
+
+		foreach ($context['error_messages'] as $error)
+			echo '
+					<li class="error">', $error, '</li>';
+
+		echo '
+				</ul>
+			</div>';
+	}
+
 	echo '
 			<div class="content">
 				<dl class="settings">
-					<dt>
-						<strong><label for="ban_name">', $txt['ban_name'], ':</label></strong>
+					<dt id="ban_name_label">
+						<strong>', $txt['ban_name'], ':</strong>
 					</dt>
 					<dd>
-						<input type="text" name="ban_name" id="ban_name" value="', $context['ban']['name'], '" size="47" maxlength="60" class="input_text" />
-					</dd>
-					<dt>
-						<strong><label for="reason">', $txt['ban_reason'], ':</label></strong><br />
-						<span class="smalltext">', $txt['ban_reason_desc'], '</span>
-					</dt>
-					<dd>
-						<textarea name="reason" id="reason" cols="40" rows="3" style="min-height: 64px; max-height: 64px; min-width: 50%; max-width: 99%;">', $context['ban']['reason'], '</textarea>
-					</dd>
-					<dt>
-						<strong><label for="ban_notes">', $txt['ban_notes'], ':</label></strong><br />
-						<span class="smalltext">', $txt['ban_notes_desc'], '</span>
-					</dt>
-					<dd>
-						<textarea name="notes" id="ban_notes" cols="40" rows="3" style="min-height: 64px; max-height: 64px; min-width: 50%; max-width: 99%;">', $context['ban']['notes'], '</textarea>
-					</dd>
+						<input type="text" id="ban_name" name="ban_name" value="', $context['ban']['name'], '" size="45" maxlength="60" class="input_text" />
+					</dd>';
+
+	if (isset($context['ban']['reason']))
+		echo '
+				<dt>
+					<strong><label for="reason">', $txt['ban_reason'], ':</label></strong><br />
+					<span class="smalltext">', $txt['ban_reason_desc'], '</span>
+				</dt>
+				<dd>
+					<textarea name="reason" id="reason" cols="40" rows="3" style="min-height: 64px; max-height: 64px; min-width: 50%; max-width: 99%;">', $context['ban']['reason'], '</textarea>
+				</dd>';
+
+	if (isset($context['ban']['notes']))
+		echo '
+				<dt>
+					<strong><label for="ban_notes">', $txt['ban_notes'], ':</label></strong><br />
+					<span class="smalltext">', $txt['ban_notes_desc'], '</span>
+				</dt>
+				<dd>
+					<textarea name="notes" id="ban_notes" cols="40" rows="3" style="min-height: 64px; max-height: 64px; min-width: 50%; max-width: 99%;">', $context['ban']['notes'], '</textarea>
+				</dd>';
+
+	echo '
 				</dl>
 				<fieldset class="ban_settings floatleft">
 					<legend>
 						', $txt['ban_expiration'], '
 					</legend>
 					<input type="radio" name="expiration" value="never" id="never_expires" onclick="fUpdateStatus();"', $context['ban']['expiration']['status'] == 'never' ? ' checked="checked"' : '', ' class="input_radio" /> <label for="never_expires">', $txt['never'], '</label><br />
-					<input type="radio" name="expiration" value="one_day" id="expires_one_day" onclick="fUpdateStatus();"', $context['ban']['expiration']['status'] == 'still_active_but_we_re_counting_the_days' ? ' checked="checked"' : '', ' class="input_radio" /> <label for="expires_one_day">', $txt['ban_will_expire_within'], '</label>: <input type="text" name="expire_date" id="expire_date" size="3" value="', $context['ban']['expiration']['days'], '" class="input_text" /> ', $txt['ban_days'], '<br />
+					<input type="radio" name="expiration" value="one_day" id="expires_one_day" onclick="fUpdateStatus();"', $context['ban']['expiration']['status'] == 'one_day' ? ' checked="checked"' : '', ' class="input_radio" /> <label for="expires_one_day">', $txt['ban_will_expire_within'], '</label>: <input type="text" name="expire_date" id="expire_date" size="3" value="', $context['ban']['expiration']['days'], '" class="input_text" /> ', $txt['ban_days'], '<br />
 					<input type="radio" name="expiration" value="expired" id="already_expired" onclick="fUpdateStatus();"', $context['ban']['expiration']['status'] == 'expired' ? ' checked="checked"' : '', ' class="input_radio" /> <label for="already_expired">', $txt['ban_expired'], '</label>
 				</fieldset>
 				<fieldset class="ban_settings floatright">
@@ -80,7 +105,7 @@ function template_ban_edit()
 					</legend>
 					<dl class="settings">
 						<dt>
-							<input type="checkbox" name="ban_suggestion[]" id="main_ip_check" value="main_ip" class="input_check" />
+							<input type="checkbox" name="ban_suggestions[]" id="main_ip_check" value="main_ip" class="input_check" ', !empty($context['ban_suggestions']['main_ip']) ? 'checked="checked" ' : '', '/>
 							<label for="main_ip_check">', $txt['ban_on_ip'], '</label>
 						</dt>
 						<dd>
@@ -90,7 +115,7 @@ function template_ban_edit()
 		if (empty($modSettings['disableHostnameLookup']))
 			echo '
 						<dt>
-							<input type="checkbox" name="ban_suggestion[]" id="hostname_check" value="hostname" class="input_check" />
+							<input type="checkbox" name="ban_suggestions[]" id="hostname_check" value="hostname" class="input_check" ', !empty($context['ban_suggestions']['hostname']) ? 'checked="checked" ' : '', '/>
 							<label for="hostname_check">', $txt['ban_on_hostname'], '</label>
 						</dt>
 						<dd>
@@ -99,141 +124,69 @@ function template_ban_edit()
 
 		echo '
 						<dt>
-							<input type="checkbox" name="ban_suggestion[]" id="email_check" value="email" class="input_check" checked="checked" />
+							<input type="checkbox" name="ban_suggestions[]" id="email_check" value="email" class="input_check" ', !empty($context['ban_suggestions']['email']) ? 'checked="checked" ' : '', '/>
 							<label for="email_check">', $txt['ban_on_email'], '</label>
 						</dt>
 						<dd>
 							<input type="text" name="email" value="', $context['ban_suggestions']['email'], '" size="44" onfocus="document.getElementById(\'email_check\').checked = true;" class="input_text" />
 						</dd>
 						<dt>
-							<input type="checkbox" name="ban_suggestion[]" id="user_check" value="user" class="input_check" checked="checked" />
+							<input type="checkbox" name="ban_suggestions[]" id="user_check" value="user" class="input_check" ', !empty($context['ban_suggestions']['user']) ||  isset($context['ban']['from_user']) ? 'checked="checked" ' : '', '/>
 							<label for="user_check">', $txt['ban_on_username'], '</label>:
 						</dt>
-						<dd>';
-
-		if (empty($context['ban_suggestions']['member']['id']))
-			echo '
-							<input type="text" name="user" id="user" value="" size="44" class="input_text" />';
-		else
-			echo '
-							', $context['ban_suggestions']['member']['link'], '
-							<input type="hidden" name="bannedUser" value="', $context['ban_suggestions']['member']['id'], '" />';
-		echo '
-						</dd>';
-
-		if (!empty($context['ban_suggestions']['message_ips']))
-		{
-			echo '
-					</dl>
-					<div>', $txt['ips_in_messages'], ':</div>
-					<dl class="settings">';
-
-			foreach ($context['ban_suggestions']['message_ips'] as $ip)
-				echo '
-						<dt>
-							<input type="checkbox" name="ban_suggestion[ips][]" value="', $ip, '" class="input_check" />
-						</dt>
 						<dd>
-							', $ip, '
-						</dd>';
-		}
+							<input type="text" ', isset($context['ban']['from_user']) ? 'readonly="readonly" value="' . $context['ban_suggestions']['member']['name'] . '"' : ' value=""', ' name="user" id="user" size="44" class="input_text" />
+						</dd>
+					</dl>';
 
-		if (!empty($context['ban_suggestions']['error_ips']))
+		if (!empty($context['ban_suggestions']['other_ips']))
 		{
-			echo '
-					</dl>
-					<div>', $txt['ips_in_errors'], '</div>
+			foreach ($context['ban_suggestions']['other_ips'] as $key => $ban_ips)
+			{
+				if (!empty($ban_ips))
+				{
+					echo '
+					<div>', $txt[$key], ':</div>
 					<dl class="settings">';
 
-			foreach ($context['ban_suggestions']['error_ips'] as $ip)
-				echo '
+					$count = 0;
+					foreach ($ban_ips as $ip)
+						echo '
 						<dt>
-							<input type="checkbox" name="ban_suggestion[ips][]" value="', $ip, '" class="input_check" />
+							<input type="checkbox" id="suggestions_', $key ,'_', $count, '" name="ban_suggestions[', $key ,'][]" ', !empty($context['ban_suggestions']['saved_triggers'][$key]) && in_array($ip, $context['ban_suggestions']['saved_triggers'][$key]) ? 'checked="checked" ' : '', 'value="', $ip, '" class="input_check" />
 						</dt>
 						<dd>
-							', $ip, '
+							<label for="suggestions_', $key ,'_', $count++, '">', $ip, '</label>
 						</dd>';
+
+					echo '
+					</dl>';
+				}
+			}
 		}
 
 		echo '
-					</dl>
 				</fieldset>';
 	}
 
 	echo '
-						<input type="submit" name="', $context['ban']['is_new'] ? 'add_ban' : 'modify_ban', '" value="', $context['ban']['is_new'] ? $txt['ban_add'] : $txt['ban_modify'], '" class="button_submit" />
-						<input type="hidden" name="old_expire" value="', $context['ban']['expiration']['days'], '" />
-						<input type="hidden" name="bg" value="', $context['ban']['id'], '" />
-						<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
-						<input type="hidden" name="', $context['admin-bet_token_var'], '" value="', $context['admin-bet_token'], '" />
-				</div>
-			</form>';
+				<input type="submit" name="', $context['ban']['is_new'] ? 'add_ban' : 'modify_ban', '" value="', $context['ban']['is_new'] ? $txt['ban_add'] : $txt['ban_modify'], '" class="button_submit" />
+				<input type="hidden" name="old_expire" value="', $context['ban']['expiration']['days'], '" />
+				<input type="hidden" name="bg" value="', $context['ban']['id'], '" />
+				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
+				<input type="hidden" name="', $context['admin-bet_token_var'], '" value="', $context['admin-bet_token'], '" />
+			</div>
+		</form>';
 
 	if (!$context['ban']['is_new'] && empty($context['ban_suggestions']))
 	{
 		echo '
-			<br />
-			<form action="', $scripturl, '?action=admin;area=ban;sa=edit" method="post" accept-charset="', $context['character_set'], '" style="padding: 0px;margin: 0px;" onsubmit="return confirm(\'', $txt['ban_remove_selected_triggers_confirm'], '\');">
-				<table class="table_grid" width="100%">
-					<thead>
-						<tr class="catbg">
-							<th scope="col" class="first_th" width="65%" align="left">', $txt['ban_banned_entity'], '</th>
-							<th scope="col" width="15%" align="center">', $txt['ban_hits'], '</th>
-							<th scope="col" width="15%" align="center">', $txt['ban_actions'], '</th>
-							<th scope="col" class="last_th" width="5%" align="center"><input type="checkbox" onclick="invertAll(this, this.form, \'ban_items\');" class="input_check" /></th>
-						</tr>
-					</thead>
-					<tbody>';
-
-		if (empty($context['ban_items']))
-			echo '
-						<tr class="windowbg2">
-							<td colspan="4">(', $txt['ban_no_triggers'], ')</td>
-						</tr>';
-		else
-		{
-			$alternate = true;
-			foreach ($context['ban_items'] as $ban_item)
-			{
-				echo '
-						<tr class="', $alternate ? 'windowbg' : 'windowbg2', '" align="left">
-							<td>';
-				if ($ban_item['type'] == 'ip')
-					echo '		<strong>', $txt['ip'], ':</strong>&nbsp;', $ban_item['ip'];
-				elseif ($ban_item['type'] == 'hostname')
-					echo '		<strong>', $txt['hostname'], ':</strong>&nbsp;', $ban_item['hostname'];
-				elseif ($ban_item['type'] == 'email')
-					echo '		<strong>', $txt['email'], ':</strong>&nbsp;', $ban_item['email'];
-				elseif ($ban_item['type'] == 'user')
-					echo '		<strong>', $txt['username'], ':</strong>&nbsp;', $ban_item['user']['link'];
-				echo '
-							</td>
-							<td align="center">', $ban_item['hits'], '</td>
-							<td align="center"><a href="', $scripturl, '?action=admin;area=ban;sa=edittrigger;bg=', $context['ban']['id'], ';bi=', $ban_item['id'], '">', $txt['ban_edit_trigger'], '</a></td>
-							<td align="center"><input type="checkbox" name="ban_items[]" value="', $ban_item['id'], '" class="input_check" /></td>
-						</tr>';
-				$alternate = !$alternate;
-			}
-		}
-
-		echo '
-					</tbody>
-				</table>
-				<div class="flow_auto">
-					<br />
-					<input type="submit" name="remove_selection" value="', $txt['ban_remove_selected_triggers'], '" class="button_submit" />
-					<a class="button_link" href="', $scripturl, '?action=admin;area=ban;sa=edittrigger;bg=', $context['ban']['id'], '">', $txt['ban_add_trigger'], '</a>
-					<input type="hidden" name="bg" value="', $context['ban']['id'], '" />
-					<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
-					<input type="hidden" name="', $context['admin-bet_token_var'], '" value="', $context['admin-bet_token'], '" />
-				</div>
-			</form>';
-
+		<br />';
+		template_show_list('ban_items');
 	}
 
 	echo '
 	</div>
-	<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/suggest.js?alp21"></script>
 	<script type="text/javascript"><!-- // --><![CDATA[
 		var fUpdateStatus = function ()
 		{
@@ -265,7 +218,21 @@ function template_ban_edit()
 		}
 		oAddMemberSuggest.registerCallback(\'onBeforeUpdate\', \'onUpdateName\');';
 
-	echo '// ]]></script>';
+	echo '
+		function confirmBan(aForm)
+		{
+			if (aForm.ban_name.value == \'\')
+			{
+				alert(\'', $txt['ban_name_empty'], '\');
+				return false;
+			}
+
+			if (aForm.partial_ban.checked && !(aForm.cannot_post.checked || aForm.cannot_register.checked || aForm.cannot_login.checked))
+			{
+				alert(\'', $txt['ban_restriction_empty'], '\');
+				return false;
+			}
+		}// ]]></script>';
 }
 
 function template_ban_edit_trigger()
@@ -274,7 +241,7 @@ function template_ban_edit_trigger()
 
 	echo '
 	<div id="manage_bans">
-		<form id="admin_form_wrapper" action="', $scripturl, '?action=admin;area=ban;sa=edit" method="post" accept-charset="', $context['character_set'], '">
+		<form id="admin_form_wrapper" action="', $context['form_url'], '" method="post" accept-charset="', $context['character_set'], '">
 			<div class="cat_bar">
 				<h3 class="catbg">
 					', $context['ban_trigger']['is_new'] ? $txt['ban_add_trigger'] : $txt['ban_edit_trigger_title'], '
@@ -288,35 +255,37 @@ function template_ban_edit_trigger()
 						</legend>
 						<dl class="settings">
 							<dt>
-								<input type="radio" name="bantype" value="ip_ban"', $context['ban_trigger']['ip']['selected'] ? ' checked="checked"' : '', ' class="input_radio" />
-								', $txt['ban_on_ip'], '
+								<input type="checkbox" name="ban_suggestions[]" id="main_ip_check" value="main_ip" class="input_check" ', $context['ban_trigger']['ip']['selected'] ? 'checked="checked" ' : '', '/>
+								<label for="main_ip_check">', $txt['ban_on_ip'], '</label>
 							</dt>
 							<dd>
-								<input type="text" name="ip" value="', $context['ban_trigger']['ip']['value'], '" size="50" onfocus="selectRadioByName(this.form.bantype, \'ip_ban\');" class="input_text" />
+								<input type="text" name="main_ip" value="', $context['ban_trigger']['ip']['value'], '" size="44" onfocus="document.getElementById(\'main_ip_check\').checked = true;" class="input_text" />
 							</dd>';
+
 				if (empty($modSettings['disableHostnameLookup']))
+					echo '
+								<dt>
+									<input type="checkbox" name="ban_suggestions[]" id="hostname_check" value="hostname" class="input_check" ', $context['ban_trigger']['hostname']['selected'] ? 'checked="checked" ' : '', '/>
+									<label for="hostname_check">', $txt['ban_on_hostname'], '</label>
+								</dt>
+								<dd>
+									<input type="text" name="hostname" value="', $context['ban_trigger']['hostname']['value'], '" size="44" onfocus="document.getElementById(\'hostname_check\').checked = true;" class="input_text" />
+								</dd>';
+
 				echo '
 							<dt>
-								<input type="radio" name="bantype" value="hostname_ban"', $context['ban_trigger']['hostname']['selected'] ? ' checked="checked"' : '', ' class="input_radio" />
-								', $txt['ban_on_hostname'], '
-							</dt>
-							<dd>
-								<input type="text" name="hostname" value="', $context['ban_trigger']['hostname']['value'], '" size="50" onfocus="selectRadioByName(this.form.bantype, \'hostname_ban\');" class="input_text" />
-							</dd>';
-				echo '
-							<dt>
-								<input type="radio" name="bantype" value="email_ban"', $context['ban_trigger']['email']['selected'] ? ' checked="checked"' : '', ' class="input_radio" />
-								', $txt['ban_on_email'], '
+								<input type="checkbox" name="ban_suggestions[]" id="email_check" value="email" class="input_check" ', $context['ban_trigger']['email']['selected'] ? 'checked="checked" ' : '', '/>
+								<label for="email_check">', $txt['ban_on_email'], '</label>
 							</dt>
 							<dd>
-								<input type="text" name="email" value="', $context['ban_trigger']['email']['value'], '" size="50" onfocus="selectRadioByName(this.form.bantype, \'email_ban\');" class="input_text" />
+								<input type="text" name="email" value="', $context['ban_trigger']['email']['value'], '" size="44" onfocus="document.getElementById(\'email_check\').checked = true;" class="input_text" />
 							</dd>
 							<dt>
-								<input type="radio" name="bantype" value="user_ban"', $context['ban_trigger']['banneduser']['selected'] ? ' checked="checked"' : '', ' class="input_radio" />
-								', $txt['ban_on_username'], '
+								<input type="checkbox" name="ban_suggestions[]" id="user_check" value="user" class="input_check" ', $context['ban_trigger']['banneduser']['selected'] ? 'checked="checked" ' : '', '/>
+								<label for="user_check">', $txt['ban_on_username'], '</label>:
 							</dt>
 							<dd>
-								<input type="text" name="user" id="user" value="', $context['ban_trigger']['banneduser']['value'], '" size="50" onfocus="selectRadioByName(this.form.bantype, \'user_ban\');" class="input_text" />
+								<input type="text" value="' . $context['ban_trigger']['banneduser']['value'] . '" name="user" id="user" size="44"  onfocus="document.getElementById(\'user_check\').checked = true;"class="input_text" />
 							</dd>
 						</dl>
 					</fieldset>
@@ -345,7 +314,7 @@ function template_ban_edit_trigger()
 
 		function onUpdateName(oAutoSuggest)
 		{
-			selectRadioByName(oAutoSuggest.oTextHandle.form.bantype, \'user_ban\');
+			document.getElementById(\'user_check\').checked = true;
 			return true;
 		}
 		oAddMemberSuggest.registerCallback(\'onBeforeUpdate\', \'onUpdateName\');

+ 10 - 10
Themes/default/Wireless.template.php

@@ -808,7 +808,7 @@ function template_imode_ban_edit()
 			<tr><td>
 				<strong>', $txt['ban_expiration'], ': </strong><br />
 				<input type="radio" name="expiration" value="never" ', $context['ban']['expiration']['status'] == 'never' ? ' checked="checked"' : '', ' class="input_radio" /> ', $txt['never'], '<br />
-				<input type="radio" name="expiration" value="one_day" ', $context['ban']['expiration']['status'] == 'still_active_but_we_re_counting_the_days' ? ' checked="checked"' : '', ' class="input_radio" /> ', $txt['ban_will_expire_within'], ' <input type="text" name="expire_date" size="3" value="', $context['ban']['expiration']['days'], '" /> ', $txt['ban_days'], '<br />
+				<input type="radio" name="expiration" value="one_day" ', $context['ban']['expiration']['status'] == 'one_day' ? ' checked="checked"' : '', ' class="input_radio" /> ', $txt['ban_will_expire_within'], ' <input type="text" name="expire_date" size="3" value="', $context['ban']['expiration']['days'], '" /> ', $txt['ban_days'], '<br />
 				<input type="radio" name="expiration" value="expired" ', $context['ban']['expiration']['status'] == 'expired' ? ' checked="checked"' : '', ' class="input_radio" /> ', $txt['ban_expired'], '<br />
 			</td></tr>
 			<tr><td>
@@ -832,24 +832,24 @@ function template_imode_ban_edit()
 		echo '
 			<tr bgcolor="#b6dbff"><td>', $txt['ban_triggers'], '</td></tr>
 			<tr><td>
-				<input type="checkbox" name="ban_suggestion[]" value="main_ip" class="input_check" /> <strong>', $txt['wireless_ban_ip'], ':</strong><br />
+				<input type="checkbox" name="ban_suggestions[]" value="main_ip" class="input_check" /> <strong>', $txt['wireless_ban_ip'], ':</strong><br />
 				&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="main_ip" value="', $context['ban_suggestions']['main_ip'], '" size="20" class="input_text" />
 			</td></tr>';
 
 		if (empty($modSettings['disableHostnameLookup']))
 			echo '
 			<tr><td>
-				<input type="checkbox" name="ban_suggestion[]" value="hostname" class="input_check" /> <strong>', $txt['wireless_ban_hostname'], ':</strong><br />
+				<input type="checkbox" name="ban_suggestions[]" value="hostname" class="input_check" /> <strong>', $txt['wireless_ban_hostname'], ':</strong><br />
 				&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="hostname" value="', $context['ban_suggestions']['hostname'], '" size="20" class="input_text" />
 			</td></tr>';
 
 		echo '
 			<tr><td>
-				<input type="checkbox" name="ban_suggestion[]" value="email" class="input_check" /> <strong>', $txt['wireless_ban_email'], ':</strong><br />
+				<input type="checkbox" name="ban_suggestions[]" value="email" class="input_check" /> <strong>', $txt['wireless_ban_email'], ':</strong><br />
 				&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="email" value="', $context['ban_suggestions']['email'], '" size="20" class="input_text" />
 			</td></tr>
 			<tr><td>
-				<input type="checkbox" name="ban_suggestion[]" value="user" class="input_check" /> <strong>', $txt['ban_on_username'], ':</strong><br />';
+				<input type="checkbox" name="ban_suggestions[]" value="user" class="input_check" /> <strong>', $txt['ban_on_username'], ':</strong><br />';
 
 		if (empty($context['ban_suggestions']['member']['id']))
 			echo '
@@ -1440,7 +1440,7 @@ function template_wap2_ban_edit()
 		<p class="windowbg">
 			<strong>', $txt['ban_expiration'], ': </strong><br />
 			<input type="radio" name="expiration" value="never" ', $context['ban']['expiration']['status'] == 'never' ? ' checked="checked"' : '', ' class="input_radio" /> ', $txt['never'], '<br />
-			<input type="radio" name="expiration" value="one_day" ', $context['ban']['expiration']['status'] == 'still_active_but_we_re_counting_the_days' ? ' checked="checked"' : '', ' class="input_radio" /> ', $txt['ban_will_expire_within'], ' <input type="text" name="expire_date" size="3" value="', $context['ban']['expiration']['days'], '" /> ', $txt['ban_days'], '<br />
+			<input type="radio" name="expiration" value="one_day" ', $context['ban']['expiration']['status'] == 'one_day' ? ' checked="checked"' : '', ' class="input_radio" /> ', $txt['ban_will_expire_within'], ' <input type="text" name="expire_date" size="3" value="', $context['ban']['expiration']['days'], '" /> ', $txt['ban_days'], '<br />
 			<input type="radio" name="expiration" value="expired" ', $context['ban']['expiration']['status'] == 'expired' ? ' checked="checked"' : '', ' class="input_radio" /> ', $txt['ban_expired'], '<br />
 		</p>
 		<p class="windowbg">
@@ -1464,24 +1464,24 @@ function template_wap2_ban_edit()
 		echo '
 		<p class="titlebg">', $txt['ban_triggers'], '</p>
 		<p class="windowbg">
-			<input type="checkbox" name="ban_suggestion[]" value="main_ip" class="input_check" /> <strong>', $txt['wireless_ban_ip'], ':</strong><br />
+			<input type="checkbox" name="ban_suggestions[]" value="main_ip" class="input_check" /> <strong>', $txt['wireless_ban_ip'], ':</strong><br />
 			&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="main_ip" value="', $context['ban_suggestions']['main_ip'], '" size="20" class="input_text" />
 		</p>';
 
 		if (empty($modSettings['disableHostnameLookup']))
 			echo '
 		<p class="windowbg">
-			<input type="checkbox" name="ban_suggestion[]" value="hostname" class="input_check" /> <strong>', $txt['wireless_ban_hostname'], ':</strong><br />
+			<input type="checkbox" name="ban_suggestions[]" value="hostname" class="input_check" /> <strong>', $txt['wireless_ban_hostname'], ':</strong><br />
 			&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="hostname" value="', $context['ban_suggestions']['hostname'], '" size="20" class="input_text" />
 		<p>';
 
 		echo '
 		<p class="windowbg">
-			<input type="checkbox" name="ban_suggestion[]" value="email" class="input_check" /> <strong>', $txt['wireless_ban_email'], ':</strong><br />
+			<input type="checkbox" name="ban_suggestions[]" value="email" class="input_check" /> <strong>', $txt['wireless_ban_email'], ':</strong><br />
 			&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="email" value="', $context['ban_suggestions']['email'], '" size="20" class="input_text" />
 		</p>
 		<p class="windowbg">
-			<input type="checkbox" name="ban_suggestion[]" value="user" class="input_check" /> <strong>', $txt['ban_on_username'], ':</strong><br />';
+			<input type="checkbox" name="ban_suggestions[]" value="user" class="input_check" /> <strong>', $txt['ban_on_username'], ':</strong><br />';
 
 		if (empty($context['ban_suggestions']['member']['id']))
 			echo '

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

@@ -154,6 +154,7 @@ $txt['ban_ip'] = 'IP banning: (e.g. 192.168.12.213 or 128.0.*.*) - one entry per
 $txt['ban_email'] = 'Email banning: (e.g. [email protected]) - one entry per line';
 $txt['ban_username'] = 'User name banning: (e.g. l33tuser) - one entry per line';
 
+$txt['ban_errors_detected'] = 'The following error or errors occurred while saving or editing the ban group or trigger';
 $txt['ban_description'] = 'Here you can ban troublesome people either by IP, hostname, username, or email.';
 $txt['ban_add_new'] = 'Add new ban';
 $txt['ban_banned_entity'] = 'Banned entity';

+ 6 - 0
Themes/default/languages/Errors.english.php

@@ -189,6 +189,12 @@ $txt['no_bantype_selected'] = 'No ban type was selected';
 $txt['ban_not_found'] = 'Ban not found';
 $txt['ban_unknown_restriction_type'] = 'Restriction type unknown';
 $txt['ban_name_empty'] = 'The name of the ban was left empty';
+$txt['ban_id_empty'] = 'Ban id not found';
+$txt['ban_group_id_empty'] = 'Ban group id missing';
+$txt['ban_no_triggers'] = 'No ban triggers specified';
+$txt['ban_ban_item_empty'] = 'Ban trigger not found';
+$txt['impossible_insert_new_bangroup'] = 'An error occurred while inserting the new ban';
+
 $txt['ban_name_exists'] = 'The name of this ban (%1$s) already exists. Please choose a different name.';
 $txt['ban_trigger_already_exists'] = 'This ban trigger (%1$s) already exists in %2$s.';
 

Some files were not shown because too many files changed in this diff