Completed l10n on admin panel. Exception is Admin:ThemeManager, which is pending a rewrite.
authorDan
Sun, 20 Jan 2008 22:34:02 -0500
changeset 358 b25d34fbc7ab
parent 357 1d0152181585
child 359 e0787bb6285b
Completed l10n on admin panel. Exception is Admin:ThemeManager, which is pending a rewrite.
language/english/admin.json
plugins/SpecialAdmin.php
plugins/admin/SecurityLog.php
--- 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. <b>Please do not stop the script until the process is finished.</b>',
     },
+    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<br /><small>Authentication level: %level%</small>',
+      entry_admin_auth_bad: 'Failed elevated authentication<br /><small>Attempted auth level: %level%</small>',
+      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<div style="max-width: 90%; clip: rect(0px,auto,auto,0px); overflow: auto; display: block; font-size: smaller;">Offending query: %query%</div>',
+      entry_db_backup: 'Database backup created<br /><small>Tables: %tables%</small>',
+      entry_install_enano: 'Installed Enano version %version%',
+      entry_upgrade_enano: 'Upgraded Enano to version %version%',
+      entry_illegal_page: 'Unauthorized viewing attempt<br /><small>Page: %illegal_link%</small>',
+      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 <i>you</i> don\'t like %ban_target% doesn\'t mean <i>we</i> 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.</p><p>Return to the <a href="%mainpage_link%">Main Page</a>.',
+    }
   }
 };
 
--- 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 '<div class="error-box">Please enter something to ban.</div>';
+      echo '<div class="error-box">' . $lang->get('acpbc_err_empty') . '</div>';
     }
     else
     {
@@ -1993,7 +1994,7 @@
         $entry = trim($entry);
         if ( empty($entry) )
         {
-          echo '<div class="error-box">Malformed entry.</div>';
+          echo '<div class="error-box">' . $lang->get('acpbc_err_invalid_ip_range') . '</div>';
           $error = true;
           break;
         }
@@ -2033,35 +2034,66 @@
   }
   else if ( isset($_POST['create']) && defined('ENANO_DEMO_MODE') )
   {
-    echo '<div class="error-box">This function is disabled in the demo. Just because <i>you</i> don\'t like ' . htmlspecialchars($_POST['value']) . ' doesn\'t mean <i>we</i> don\'t like ' . htmlspecialchars($_POST['value']) . '.</div>';
+    echo '<div class="error-box">' . $lang->get('acpbc_err_demo', array('ban_target' => htmlspecialchars($_POST['value']))) . '</div>';
   }
   $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 '<div class="tblholder" style="max-height: 800px; clip: rect(0px,auto,auto,0px); overflow: auto;">
           <table border="0" cellspacing="1" cellpadding="4">';
-  echo '<tr><th>Type</th><th>Value</th><th>Regular Expression</th><th></th></tr>';
-  if($db->numrows() < 1) echo '<td class="row1" colspan="4">No ban rules yet.</td>';
+  echo '<tr>
+          <th>' . $lang->get('acpbc_col_type') . '</th>
+          <th>' . $lang->get('acpbc_col_value') . '</th>
+          <th>' . $lang->get('acpbc_col_regex') . '</th>
+          <th></th>
+        </tr>';
+  if ( $db->numrows() < 1 )
+  {
+    echo '<td class="row1" colspan="4">' . $lang->get('acpbc_msg_no_rules') . '</td>';
+  }
   $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 '<tr><td class="'.$cls.'">'.$t.'</td><td class="'.$cls.'">'.$r['ban_value'].'</td><td class="'.$cls.'">'.$g.'</td><td class="'.$cls.'"><a href="'.makeUrlNS('Special', 'Administration', 'module='.$paths->nslist['Admin'].'BanControl&amp;action=delete&amp;id='.$r['ban_id']).'">Delete</a></td></tr>';
+    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'] ) ? '<b>' . $lang->get('acpbc_ban_regex_yes') . '</b>' : $lang->get('acpbc_ban_regex_no');
+    echo '<tr>
+            <td class="'.$cls.'">'.$t.'</td>
+            <td class="'.$cls.'">'.htmlspecialchars($r['ban_value']).'</td>
+            <td class="'.$cls.'">'.$g.'</td>
+            <td class="'.$cls.'"><a href="'.makeUrlNS('Special', 'Administration', 'module='.$paths->nslist['Admin'].'BanControl&amp;action=delete&amp;id='.$r['ban_id']).'">' . $lang->get('acpbc_btn_delete') . '</a></td>
+          </tr>';
   }
   $db->free_result();
   echo '</table></div>';
-  echo '<h3>Create new ban rule</h3>';
+  echo '<h3>' . $lang->get('acpbc_heading_create_new') . '</h3>';
   echo '<form action="'.makeUrl($paths->nslist['Special'].'Administration', 'module='.$paths->cpage['module']).'" method="post">';
   ?>
-  Type: <select name="type"><option value="<?php echo BAN_IP; ?>">IP address</option><option value="<?php echo BAN_USER; ?>">Username</option><option value="<?php echo BAN_EMAIL; ?>">E-mail address</option></select><br />
-  Rule: <input type="text" name="value" size="30" /><br />
-  <small>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.</small><br />
-  Reason to show to the banned user: <textarea name="reason" rows="7" cols="40"></textarea><br />
-  <input type="checkbox" name="regex" id="regex" />  <label for="regex">This rule is a regular expression</label> (advanced users only)<br />
-  <input type="submit" style="font-weight: bold;" name="create" value="Create new ban rule" />
+  
+  <?php echo $lang->get('acpbc_field_type'); ?>
+    <select name="type">
+      <option value="<?php echo BAN_IP; ?>"><?php echo $lang->get('acpbc_ban_type_ip'); ?></option>
+      <option value="<?php echo BAN_USER; ?>"><?php echo $lang->get('acpbc_ban_type_username'); ?></option>
+      <option value="<?php echo BAN_EMAIL; ?>"><?php echo $lang->get('acpbc_ban_type_email'); ?></option>
+    </select>
+    <br />
+    
+  <?php echo $lang->get('acpbc_field_rule'); ?>
+    <input type="text" name="value" size="30" /><br />
+    <small><?php echo $lang->get('acpbc_field_rule_hint'); ?></small><br />
+    
+  <?php echo $lang->get('acpbc_field_reason'); ?>
+    <textarea name="reason" rows="7" cols="40"></textarea><br />
+    
+  <label><input type="checkbox" name="regex" id="regex" /> <?php echo $lang->get('acpbc_field_regex'); ?></label>
+    <?php echo $lang->get('acpbc_field_regex_hint'); ?><br />
+    
+  <input type="submit" style="font-weight: bold;" name="create" value="<?php echo $lang->get('acpbc_btn_create'); ?>" />
   <?php
   echo '</form>';
 }
@@ -2079,7 +2111,8 @@
   }
   
   $session->logout(USER_LEVEL_ADMIN);
-  echo '<h3>You have now been logged out of the administration panel.</h3><p>You will continue to be logged into the website, but you will need to re-authenticate before you can access the administration panel again.</p><p>Return to the <a href="'.makeUrl(getConfig('main_page')).'">Main Page</a>.</p>';
+  echo '<h3>' . $lang->get('acplo_heading_main') . '</h3>
+         <p>' . $lang->get('acplo_msg_logout_complete', array('mainpage_link' => makeUrl(getConfig('main_page')))) . '</p>';
 }
 
 function page_Special_Administration()
--- 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 '<h3>Error: Not authenticated</h3><p>It looks like your administration session is invalid or you are not authorized to access this administration page. Please <a href="' . makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true) . '">re-authenticate</a> to continue.</p>';
+    $login_link = makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true);
+    echo '<h3>' . $lang->get('adm_err_not_auth_title') . '</h3>';
+    echo '<p>' . $lang->get('adm_err_not_auth_body', array( 'login_link' => $login_link )) . '</p>';
     return;
   }
   
@@ -26,7 +29,7 @@
   //   die('Security log is disabled in demo mode.');
   // }
   
-  echo '<h3>System security log</h3>';
+  echo '<h3>' . $lang->get('acpsl_heading_main') . '</h3>';
   
   // 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'),
       '<div class="tblholder" style="/* max-height: 500px; clip: rect(0px,auto,auto,0px); overflow: auto; */"><table border="0" cellspacing="1" cellpadding="4" width="100%">
-       <tr><th style="width: 60%;">Type</th><th>Date</th><th>Username</th><th>IP Address</th></tr>',
+       <tr>
+         <th style="width: 60%;">' . $lang->get('acpsl_col_type') . '</th>
+         <th>' . $lang->get('acpsl_col_date') . '</th>
+         <th>' . $lang->get('acpsl_col_username') . '</th>
+         <th>' . $lang->get('acpsl_col_ip') . '</th>
+       </tr>',
       '</table></div>'
     );
   
@@ -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 .= '<tr><td class="'.$cls.'">';
   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 .= "<br /><small>Authentication level: $level</small>"; } break;
-    case "admin_auth_bad":   $return .= 'Failed elevated authentication'; if ( !empty($r['page_text']) ) { $level = $session->userlevel_to_string( intval($r['page_text']) ); $return .= "<br /><small>Attempted auth level: $level</small>"; } 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<div style="max-width: 90%; clip: rect(0px,auto,auto,0px); overflow: auto; display: block; font-size: smaller;">Offending query: ' . htmlspecialchars($r['page_text']) . '</div>'; break;
-    case "db_backup":        $return .= 'Database backup created<br /><small>Tables: ' . $r['page_text'] . '</small>'; 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<br /><small>Page: {$illegal_link}</small>"; 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 .= '</td><td class="'.$cls.'">'.enano_date('d M Y h:i a', $r['time_id']).'</td><td class="'.$cls.'">'.$r['author'].'</td><td class="'.$cls.'" style="cursor: pointer;" onclick="ajaxReverseDNS(this);" title="Click for reverse DNS info">'.$r['edit_summary'].'</td></tr>';
+  $return .= '</td><td class="'.$cls.'">'.enano_date('d M Y h:i a', $r['time_id']).'</td><td class="'.$cls.'">'.$r['author'].'</td><td class="'.$cls.'" style="cursor: pointer;" onclick="ajaxReverseDNS(this);" title="' . $lang->get('acpsl_tip_reverse_dns') . '">'.$r['edit_summary'].'</td></tr>';
   return $return;
 }