diff -r 1d0152181585 -r b25d34fbc7ab plugins/SpecialAdmin.php --- a/plugins/SpecialAdmin.php Sun Jan 20 20:27:26 2008 -0500 +++ b/plugins/SpecialAdmin.php Sun Jan 20 22:34:02 2008 -0500 @@ -1969,7 +1969,8 @@ if(isset($_GET['action']) && $_GET['action'] == 'delete' && isset($_GET['id']) && $_GET['id'] != '') { $e = $db->sql_query('DELETE FROM '.table_prefix.'banlist WHERE ban_id=' . intval($_GET['id']) . ''); - if(!$e) $db->_die('The ban list entry was not deleted.'); + if ( !$e ) + $db->_die('The ban list entry was not deleted.'); } if(isset($_POST['create']) && !defined('ENANO_DEMO_MODE')) { @@ -1981,7 +1982,7 @@ } else if ( empty($value) ) { - echo '
Please enter something to ban.
'; + echo '
' . $lang->get('acpbc_err_empty') . '
'; } else { @@ -1993,7 +1994,7 @@ $entry = trim($entry); if ( empty($entry) ) { - echo '
Malformed entry.
'; + echo '
' . $lang->get('acpbc_err_invalid_ip_range') . '
'; $error = true; break; } @@ -2033,35 +2034,66 @@ } else if ( isset($_POST['create']) && defined('ENANO_DEMO_MODE') ) { - echo '
This function is disabled in the demo. Just because you don\'t like ' . htmlspecialchars($_POST['value']) . ' doesn\'t mean we don\'t like ' . htmlspecialchars($_POST['value']) . '.
'; + echo '
' . $lang->get('acpbc_err_demo', array('ban_target' => htmlspecialchars($_POST['value']))) . '
'; } $q = $db->sql_query('SELECT ban_id,ban_type,ban_value,is_regex FROM '.table_prefix.'banlist ORDER BY ban_type;'); - if(!$q) $db->_die('The banlist data could not be selected.'); + if ( !$q ) + $db->_die('The banlist data could not be selected.'); echo '
'; - echo ''; - if($db->numrows() < 1) echo ''; + echo ' + + + + + '; + if ( $db->numrows() < 1 ) + { + echo ''; + } $cls = 'row2'; - while($r = $db->fetchrow()) + while ( $r = $db->fetchrow() ) { $cls = ( $cls == 'row1' ) ? 'row2' : 'row1'; - if($r['ban_type']==BAN_IP) $t = 'IP address'; - elseif($r['ban_type']==BAN_USER) $t = 'Username'; - elseif($r['ban_type']==BAN_EMAIL) $t = 'E-mail address'; - if($r['is_regex']) $g = 'Yes'; else $g = 'No'; - echo ''; + if ( $r['ban_type'] == BAN_IP ) + $t = $lang->get('acpbc_ban_type_ip'); + else if ( $r['ban_type'] == BAN_USER ) + $t = $lang->get('acpbc_ban_type_username'); + else if ( $r['ban_type'] == BAN_EMAIL ) + $t = $lang->get('acpbc_ban_type_email'); + $g = ( $r['is_regex'] ) ? '' . $lang->get('acpbc_ban_regex_yes') . '' : $lang->get('acpbc_ban_regex_no'); + echo ' + + + + + '; } $db->free_result(); echo '
TypeValueRegular Expression
No ban rules yet.
' . $lang->get('acpbc_col_type') . '' . $lang->get('acpbc_col_value') . '' . $lang->get('acpbc_col_regex') . '
' . $lang->get('acpbc_msg_no_rules') . '
'.$t.''.$r['ban_value'].''.$g.'Delete
'.$t.''.htmlspecialchars($r['ban_value']).''.$g.'' . $lang->get('acpbc_btn_delete') . '
'; - echo '

Create new ban rule

'; + echo '

' . $lang->get('acpbc_heading_create_new') . '

'; echo '
'; ?> - Type:
- Rule:
- You can ban multiple IP addresses, users, or e-mail addresses by separating entries with a single comma (User1,User2). Do not put a space after the comma. For IP addresses, you may specify ranges like 172|192.168.4-30|90-167.1-90, which will turn into 172 and 192 . 168 . 4-30 and 90-167 . 1 - 90, which matches 18,899 IP addresses.
- Reason to show to the banned user:
- (advanced users only)
- + + get('acpbc_field_type'); ?> + +
+ + get('acpbc_field_rule'); ?> +
+ get('acpbc_field_rule_hint'); ?>
+ + get('acpbc_field_reason'); ?> +
+ + + get('acpbc_field_regex_hint'); ?>
+ + '; } @@ -2079,7 +2111,8 @@ } $session->logout(USER_LEVEL_ADMIN); - echo '

You have now been logged out of the administration panel.

You will continue to be logged into the website, but you will need to re-authenticate before you can access the administration panel again.

Return to the Main Page.

'; + echo '

' . $lang->get('acplo_heading_main') . '

+

' . $lang->get('acplo_msg_logout_complete', array('mainpage_link' => makeUrl(getConfig('main_page')))) . '

'; } function page_Special_Administration()