# HG changeset patch # User Dan # Date 1200886442 18000 # Node ID b25d34fbc7abde9c57ccd6be0022d57b5e571099 # Parent 1d0152181585beb432585f27d15182da388f8f34 Completed l10n on admin panel. Exception is Admin:ThemeManager, which is pending a rewrite. diff -r 1d0152181585 -r b25d34fbc7ab language/english/admin.json --- a/language/english/admin.json Sun Jan 20 20:27:26 2008 -0500 +++ b/language/english/admin.json Sun Jan 20 22:34:02 2008 -0500 @@ -18,7 +18,8 @@ var enano_lang = { categories: [ 'adm', 'acl', 'adminusers', - 'acphome', 'acpgc', 'acpup', 'acpft', 'acppl', 'acppm', 'acped', 'acpdb', 'acppg', 'acpum', 'acpug', 'acpcp', 'acpmm', + 'acphome', 'acpgc', 'acpup', 'acpft', 'acppl', 'acppm', 'acped', 'acpdb', 'acppg', 'acpum', 'acpug', 'acpcp', 'acpmm', 'acpsl', 'acpbc', + 'acplo', ], strings: { meta: { @@ -37,6 +38,9 @@ acpug: 'ACP: User group management', acpcp: 'ACP: COPPA support', acpmm: 'ACP: Mass e-mail', + acpsl: 'ACP: Security log', + acpbc: 'ACP: Ban control', + acplo: 'ACP: Logout page', }, adm: { cat_general: 'General', @@ -699,6 +703,69 @@ btn_send: 'Send message', msg_send_takeawhile: 'Please be warned: it may take a LONG time to send this message. Please do not stop the script until the process is finished.', }, + acpsl: { + heading_main: 'System security log', + col_type: 'Type', + col_date: 'Date', + col_username: 'Username', + col_ip: 'IP Address', + entry_admin_auth_good: 'Successful elevated authentication
Authentication level: %level%', + entry_admin_auth_bad: 'Failed elevated authentication
Attempted auth level: %level%', + entry_activ_good: 'Successful account activation', + entry_auth_good: 'Successful regular user logon', + entry_activ_bad: 'Failed account activation', + entry_auth_bad: 'Failed regular user logon', + entry_sql_inject: 'SQL injection attempt
Offending query: %query%
', + entry_db_backup: 'Database backup created
Tables: %tables%', + entry_install_enano: 'Installed Enano version %version%', + entry_upgrade_enano: 'Upgraded Enano to version %version%', + entry_illegal_page: 'Unauthorized viewing attempt
Page: %illegal_link%', + entry_upload_enable: 'Enabled file uploads', + entry_upload_disable: 'Disabled file uploads', + entry_magick_enable: 'Enabled ImageMagick for uploaded images', + entry_magick_disable: 'Disabled ImageMagick for uploaded images', + entry_filehist_enable: 'Enabled revision tracking for uploaded files', + entry_filehist_disable: 'Disabled revision tracking for uploaded files', + entry_magick_path: 'Changed path to ImageMagick executable', + entry_plugin_disable: 'Disabled plugin: %plugin%', + entry_plugin_enable: 'Enabled plugin: %plugin%', + entry_seclog_unauth: 'Unauthorized attempt to call security log fetcher', + entry_u_from_admin: 'User %username% demoted from Administrators group', + entry_u_from_mod: 'User %username% demoted from Moderators group', + entry_u_to_admin: 'User %username% added to Administrators group', + entry_u_to_mod: 'User %username% added to Moderators group', + tip_reverse_dns: 'Click for reverse DNS info', + }, + acpbc: { + err_empty: 'Please enter something to ban.', + err_invalid_ip_range: 'The IP address range you entered is invalid.', + err_demo: 'This function is disabled in the demo. Just because you don\'t like %ban_target% doesn\'t mean we don\'t like %ban_target%.', + col_type: 'Type', + col_value: 'Value', + col_regex: 'Regular Expression', + msg_no_rules: 'No ban rules yet.', + ban_type_ip: 'IP address', + ban_type_username: 'Username', + ban_type_email: 'E-mail address', + btn_delete: 'Delete', + // Some languages like Chinese don't literally have the word "yes", so this would be something + // along the lines of "This is a regular expression" / "This is not..." in Chinese. Hence the + // separation of this from a generic "yes" string. + ban_regex_yes: 'Yes', + ban_regex_no: 'No', + heading_create_new: 'Create new ban rule', + field_type: 'Type:', + field_rule: 'Rule:', + field_rule_hint: '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.', + field_reason: 'Reason to show to the banned user:', + field_regex: 'This rule is a regular expression', + field_regex_hint: '(advanced users only)', + btn_create: 'Create new ban rule', + }, + acplo: { + heading_main: 'You have now been logged out of the administration panel.', + msg_logout_complete: '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.', + } } }; 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() diff -r 1d0152181585 -r b25d34fbc7ab plugins/admin/SecurityLog.php --- a/plugins/admin/SecurityLog.php Sun Jan 20 20:27:26 2008 -0500 +++ b/plugins/admin/SecurityLog.php Sun Jan 20 22:34:02 2008 -0500 @@ -15,9 +15,12 @@ function page_Admin_SecurityLog() { global $db, $session, $paths, $template, $plugins; // Common objects + global $lang; if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN ) { - echo '

Error: Not authenticated

It looks like your administration session is invalid or you are not authorized to access this administration page. Please re-authenticate to continue.

'; + $login_link = makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true); + echo '

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

'; + echo '

' . $lang->get('adm_err_not_auth_body', array( 'login_link' => $login_link )) . '

'; return; } @@ -26,7 +29,7 @@ // die('Security log is disabled in demo mode.'); // } - echo '

System security log

'; + echo '

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

'; // Not calling the real fetcher because we have to paginate the results $offset = ( isset($_GET['offset']) ) ? intval($_GET['offset']) : 0; @@ -49,7 +52,12 @@ 50, array('time_id' => 'seclog_format_inner'), '
- ', + + + + + + ', '
TypeDateUsernameIP Address
' . $lang->get('acpsl_col_type') . '' . $lang->get('acpsl_col_date') . '' . $lang->get('acpsl_col_username') . '' . $lang->get('acpsl_col_ip') . '
' ); @@ -113,6 +121,7 @@ $r =& $f; } global $db, $session, $paths, $template, $plugins; // Common objects + global $lang; $return = ''; static $cls = 'row2'; if ( substr($_SERVER['REMOTE_ADDR'], 0, 8) != '192.168.' && defined('ENANO_DEMO_MODE') ) @@ -135,33 +144,33 @@ $return .= ''; switch($r['action']) { - case "admin_auth_good": $return .= 'Successful elevated authentication'; if ( !empty($r['page_text']) ) { $level = $session->userlevel_to_string( intval($r['page_text']) ); $return .= "
Authentication level: $level"; } break; - case "admin_auth_bad": $return .= 'Failed elevated authentication'; if ( !empty($r['page_text']) ) { $level = $session->userlevel_to_string( intval($r['page_text']) ); $return .= "
Attempted auth level: $level"; } break; - case "activ_good": $return .= 'Successful account activation'; break; - case "auth_good": $return .= 'Successful regular user logon'; break; - case "activ_bad": $return .= 'Failed account activation'; break; - case "auth_bad": $return .= 'Failed regular user logon'; break; - case "sql_inject": $return .= 'SQL injection attempt
Offending query: ' . htmlspecialchars($r['page_text']) . '
'; break; - case "db_backup": $return .= 'Database backup created
Tables: ' . $r['page_text'] . ''; break; - case "install_enano": $return .= "Installed Enano version {$r['page_text']}"; break; - case "upgrade_enano": $return .= "Upgraded Enano to version {$r['page_text']}"; break; - case "illegal_page": $return .= "Unauthorized viewing attempt
Page: {$illegal_link}"; break; - case "upload_enable": $return .= "Enabled file uploads"; break; - case "upload_disable": $return .= "Disabled file uploads"; break; - case "magick_enable": $return .= "Enabled ImageMagick for uploaded images"; break; - case "magick_disable": $return .= "Disabled ImageMagick for uploaded images"; break; - case "filehist_enable": $return .= "Enabled revision tracking for uploaded files"; break; - case "filehist_disable": $return .= "Disabled revision tracking for uploaded files"; break; - case "magick_path": $return .= "Changed path to ImageMagick executable"; break; - case "plugin_disable": $return .= "Disabled plugin: {$r['page_text']}"; break; - case "plugin_enable": $return .= "Enabled plugin: {$r['page_text']}"; break; - case "seclog_unauth": $return .= "Unauthorized attempt to call security log fetcher"; break; - case "u_from_admin": $return .= "User {$r['page_text']} demoted from Administrators group"; break; - case "u_from_mod": $return .= "User {$r['page_text']} demoted from Moderators group"; break; - case "u_to_admin": $return .= "User {$r['page_text']} added to Administrators group"; break; - case "u_to_mod": $return .= "User {$r['page_text']} added to Moderators group"; break; + case "admin_auth_good" : $return .= $lang->get('acpsl_entry_admin_auth_good' , array('level' => $session->userlevel_to_string( intval($r['page_text']) ))); break; + case "admin_auth_bad" : $return .= $lang->get('acpsl_entry_admin_auth_bad' , array('level' => $session->userlevel_to_string( intval($r['page_text']) ))); break; + case "activ_good" : $return .= $lang->get('acpsl_entry_activ_good') ; break; + case "auth_good" : $return .= $lang->get('acpsl_entry_auth_good') ; break; + case "activ_bad" : $return .= $lang->get('acpsl_entry_activ_bad') ; break; + case "auth_bad" : $return .= $lang->get('acpsl_entry_auth_bad') ; break; + case "sql_inject" : $return .= $lang->get('acpsl_entry_sql_inject' , array('query' => htmlspecialchars($r['page_text']))); break; + case "db_backup" : $return .= $lang->get('acpsl_entry_db_backup' , array('tables' => $r['page_text'])) ; break; + case "install_enano" : $return .= $lang->get('acpsl_entry_install_enano' , array('version' => $r['page_text'])); break; // version is in $r['page_text'] + case "upgrade_enano" : $return .= $lang->get('acpsl_entry_upgrade_enano' , array('version' => $r['page_text'])); break; // version is in $r['page_text'] + case "illegal_page" : $return .= $lang->get('acpsl_entry_illegal_page' , array('illegal_link' => $illegal_link)) ; break; + case "upload_enable" : $return .= $lang->get('acpsl_entry_upload_enable') ; break; + case "upload_disable" : $return .= $lang->get('acpsl_entry_upload_disable') ; break; + case "magick_enable" : $return .= $lang->get('acpsl_entry_magick_enable') ; break; + case "magick_disable" : $return .= $lang->get('acpsl_entry_magick_disable') ; break; + case "filehist_enable" : $return .= $lang->get('acpsl_entry_filehist_enable') ; break; + case "filehist_disable": $return .= $lang->get('acpsl_entry_filehist_disable'); break; + case "magick_path" : $return .= $lang->get('acpsl_entry_magick_path') ; break; + case "plugin_disable" : $return .= $lang->get('acpsl_entry_plugin_disable' , array('plugin' => $r['page_text'])) ; break; + case "plugin_enable" : $return .= $lang->get('acpsl_entry_plugin_enable' , array('plugin' => $r['page_text'])) ; break; + case "seclog_unauth" : $return .= $lang->get('acpsl_entry_seclog_unauth') ; break; + case "u_from_admin" : $return .= $lang->get('acpsl_entry_u_from_admin' , array('username' => $r['page_text'])) ; break; + case "u_from_mod" : $return .= $lang->get('acpsl_entry_u_from_mod' , array('username' => $r['page_text'])) ; break; + case "u_to_admin" : $return .= $lang->get('acpsl_entry_u_to_admin' , array('username' => $r['page_text'])) ; break; + case "u_to_mod" : $return .= $lang->get('acpsl_entry_u_to_mod' , array('username' => $r['page_text'])) ; break; } - $return .= ''.enano_date('d M Y h:i a', $r['time_id']).''.$r['author'].''.$r['edit_summary'].''; + $return .= ''.enano_date('d M Y h:i a', $r['time_id']).''.$r['author'].''.$r['edit_summary'].''; return $return; }