diff --git a/user_admin.php b/user_admin.php
index a5c8ebd39..5d158ae77 100644
--- a/user_admin.php
+++ b/user_admin.php
@@ -25,11 +25,11 @@
include('./include/auth.php');
$user_actions = array(
- 1 => 'Delete',
- 2 => 'Copy',
- 3 => 'Enable',
- 4 => 'Disable',
- 5 => 'Batch Copy'
+ 1 => __('Delete'),
+ 2 => __('Copy'),
+ 3 => __('Enable'),
+ 4 => __('Disable'),
+ 5 => __('Batch Copy')
);
set_default_action();
@@ -295,12 +295,12 @@ function form_actions() {
if ((get_nfilter_request_var('drp_action') == '1') && (sizeof($user_array))) { /* delete */
print "
- Default Graph Policy for this User
+
@@ -890,7 +890,7 @@ function graph_perms_edit($tab, $header_label) {
print $nav;
- $display_text = array('Graph Title', 'ID', 'Effective Policy');
+ $display_text = array(__('Graph Title'), __('ID'), __('Effective Policy'));
html_header_checkbox($display_text, false);
@@ -907,7 +907,7 @@ function graph_perms_edit($tab, $header_label) {
/* put the nav bar on the bottom as well */
print $nav;
} else {
- print ' No Matching Graphs Found ';
+ print '' . __('No Matching Graphs Found') . ' ';
}
html_end_box(false);
@@ -917,13 +917,13 @@ function graph_perms_edit($tab, $header_label) {
if ($policy['policy_graphs'] == 1) {
$assoc_actions = array(
- 1 => 'Revoke Access',
- 2 => 'Grant Access'
+ 1 => __('Revoke Access'),
+ 2 => __('Grant Access')
);
}else{
$assoc_actions = array(
- 1 => 'Grant Access',
- 2 => 'Revoke Access'
+ 1 => __('Grant Access'),
+ 2 => __('Revoke Access')
);
}
@@ -984,7 +984,7 @@ function graph_perms_edit($tab, $header_label) {
print $nav;
- $display_text = array('Name', 'Description', 'Member', 'ID', 'Policies (Graph/Device/Template)', 'Enabled');
+ $display_text = array(__('Name'), __('Description'), __('Member'), __('ID'), __('Policies (Graph/Device/Template)'), __('Enabled'));
html_header_checkbox($display_text, false);
@@ -993,10 +993,10 @@ function graph_perms_edit($tab, $header_label) {
form_alternate_row('line' . $g['id'], true);
form_selectable_cell("" . (strlen(get_request_var('filter')) ? preg_replace('/(' . preg_quote(get_request_var('filter')) . ')/i', "\\1 ", htmlspecialchars($g['name'])) : htmlspecialchars($g['name'])) . ' ', $g['id']);
form_selectable_cell((strlen(get_request_var('filter')) ? preg_replace('/(' . preg_quote(get_request_var('filter')) . ')/i', "\\1 ", htmlspecialchars($g['description'])) : htmlspecialchars($g['description'])), $g['id']);
- form_selectable_cell($g['user_id'] > 0 ? 'Member':'Non Member', $g['id']);
+ form_selectable_cell($g['user_id'] > 0 ? __('Member'):__('Non Member'), $g['id']);
form_selectable_cell(($g['id']), $g['id']);
- form_selectable_cell(($g['policy_graphs'] == 1 ? 'ALLOW':'DENY') . '/' . ($g['policy_hosts'] == 1 ? 'ALLOW':'DENY') . '/' . ($g['policy_graph_templates'] == 1 ? 'ALLOW':'DENY'), $g['id']);
- form_selectable_cell($g['enabled'] == 'on' ? 'Enabled':'Disabled', $g['id']);
+ form_selectable_cell(($g['policy_graphs'] == 1 ? __('ALLOW'):__('DENY')) . '/' . ($g['policy_hosts'] == 1 ? __('ALLOW'):__('DENY')) . '/' . ($g['policy_graph_templates'] == 1 ? __('ALLOW'):__('DENY')), $g['id']);
+ form_selectable_cell($g['enabled'] == 'on' ? __('Enabled'):__('Disabled'), $g['id']);
form_checkbox_cell($g['name'], $g['id']);
form_end_row();
}
@@ -1004,7 +1004,7 @@ function graph_perms_edit($tab, $header_label) {
/* put the nav bar on the bottom as well */
print $nav;
} else {
- print 'No Matching User Groups Found ';
+ print '' . __('No Matching User Groups Found') . ' ';
}
html_end_box(false);
@@ -1013,8 +1013,8 @@ function graph_perms_edit($tab, $header_label) {
form_hidden_box('associate_groups', '1', '');
$assoc_actions = array(
- 1 => 'Assign Membership',
- 2 => 'Remove Membership'
+ 1 => __('Assign Membership'),
+ 2 => __('Remove Membership')
);
/* draw the dropdown containing a list of available actions for this form */
@@ -1031,12 +1031,12 @@ function graph_perms_edit($tab, $header_label) {
form_start('user_admin.php', 'policy');
/* box: device permissions */
- html_start_box('Default Device Policy', '100%', '', '3', 'center', '');
+ html_start_box(__('Default Device Policy'), '100%', '', '3', 'center', '');
?>
- Default Device Policy for this User
+
@@ -1111,7 +1111,7 @@ function graph_perms_edit($tab, $header_label) {
print $nav;
- $display_text = array('Description', 'ID', 'Effective Policy', 'Graphs', 'Data Sources', 'Status', 'Hostname');
+ $display_text = array(__('Description'), __('ID'), __('Effective Policy'), __('Graphs'), __('Data Sources'), __('Status'), __('Hostname'));
html_header_checkbox($display_text, false);
@@ -1122,15 +1122,15 @@ function graph_perms_edit($tab, $header_label) {
form_selectable_cell(round(($host['id']), 2), $host['id']);
if (empty($host['user_id']) || $host['user_id'] == NULL) {
if ($policy['policy_hosts'] == 1) {
- form_selectable_cell('Access Granted ', $host['id']);
+ form_selectable_cell('' . __('Access Granted') . ' ', $host['id']);
}else{
- form_selectable_cell('Access Restricted ', $host['id']);
+ form_selectable_cell('' . __('Access Restricted') . ' ', $host['id']);
}
} else {
if ($policy['policy_hosts'] == 1) {
- form_selectable_cell('Access Restricted ', $host['id']);
+ form_selectable_cell('' . __('Access Restricted') . ' ', $host['id']);
}else{
- form_selectable_cell('Access Granted ', $host['id']);
+ form_selectable_cell('' . __('Access Granted') . ' ', $host['id']);
}
}
form_selectable_cell((isset($host_graphs[$host['id']]) ? $host_graphs[$host['id']] : 0), $host['id']);
@@ -1144,7 +1144,7 @@ function graph_perms_edit($tab, $header_label) {
/* put the nav bar on the bottom as well */
print $nav;
} else {
- print ' No Matching Devices Found ';
+ print '' . __('No Matching Devices Found') . ' ';
}
html_end_box(false);
@@ -1154,13 +1154,13 @@ function graph_perms_edit($tab, $header_label) {
if ($policy['policy_hosts'] == 1) {
$assoc_actions = array(
- 1 => 'Revoke Access',
- 2 => 'Grant Access'
+ 1 => __('Revoke Access'),
+ 2 => __('Grant Access')
);
}else{
$assoc_actions = array(
- 1 => 'Grant Access',
- 2 => 'Revoke Access'
+ 1 => __('Grant Access'),
+ 2 => __('Revoke Access')
);
}
@@ -1178,12 +1178,12 @@ function graph_perms_edit($tab, $header_label) {
form_start('user_admin.php', 'policy');
/* box: device permissions */
- html_start_box('Default Graph Template Policy', '100%', '', '3', 'center', '');
+ html_start_box(__('Default Graph Template Policy'), '100%', '', '3', 'center', '');
?>
- Default Graph Template Policy for this User
+
@@ -1252,7 +1252,7 @@ function graph_perms_edit($tab, $header_label) {
print $nav;
- $display_text = array('Template Name', 'ID', 'Effective Policy', 'Total Graphs');
+ $display_text = array(__('Template Name'), __('ID'), __('Effective Policy'), __('Total Graphs'));
html_header_checkbox($display_text, false);
@@ -1263,15 +1263,15 @@ function graph_perms_edit($tab, $header_label) {
form_selectable_cell($g['id'], $g['id']);
if (empty($g['user_id']) || $g['user_id'] == NULL) {
if ($policy['policy_graph_templates'] == 1) {
- form_selectable_cell('Access Granted ', $g['id']);
+ form_selectable_cell('' . __('Access Granted') . ' ', $g['id']);
}else{
- form_selectable_cell('Access Restricted ', $g['id']);
+ form_selectable_cell('' . __('Access Restricted') . ' ', $g['id']);
}
} else {
if ($policy['policy_graph_templates'] == 1) {
- form_selectable_cell('Access Restricted ', $g['id']);
+ form_selectable_cell('' . __('Access Restricted') . ' ', $g['id']);
}else{
- form_selectable_cell('Access Granted ', $g['id']);
+ form_selectable_cell('' . __('Access Granted') . ' ', $g['id']);
}
}
form_selectable_cell($g['totals'], $g['id']);
@@ -1282,7 +1282,7 @@ function graph_perms_edit($tab, $header_label) {
/* put the nav bar on the bottom as well */
print $nav;
} else {
- print ' No Matching Graph Templates Found ';
+ print '' . __('No Matching Graph Templates Found') . ' ';
}
html_end_box(false);
@@ -1292,13 +1292,13 @@ function graph_perms_edit($tab, $header_label) {
if ($policy['policy_graph_templates'] == 1) {
$assoc_actions = array(
- 1 => 'Revoke Access',
- 2 => 'Grant Access'
+ 1 => __('Revoke Access'),
+ 2 => __('Grant Access')
);
}else{
$assoc_actions = array(
- 1 => 'Grant Access',
- 2 => 'Revoke Access'
+ 1 => __('Grant Access'),
+ 2 => __('Revoke Access')
);
}
@@ -1316,12 +1316,12 @@ function graph_perms_edit($tab, $header_label) {
form_start('user_admin.php', 'policy');
/* box: device permissions */
- html_start_box('Default Tree Policy', '100%', '', '3', 'center', '');
+ html_start_box(__('Default Tree Policy'), '100%', '', '3', 'center', '');
?>
- Default Tree Policy for this User
+
@@ -1384,7 +1384,7 @@ function graph_perms_edit($tab, $header_label) {
print $nav;
- $display_text = array('Tree Name', 'ID', 'Effective Policy');
+ $display_text = array(__('Tree Name'), __('ID'), __('Effective Policy'));
html_header_checkbox($display_text, false);
@@ -1395,15 +1395,15 @@ function graph_perms_edit($tab, $header_label) {
form_selectable_cell($t['id'], $t['id']);
if (empty($t['user_id']) || $t['user_id'] == NULL) {
if ($policy['policy_graphs'] == 1) {
- form_selectable_cell('Access Granted ', $t['id']);
+ form_selectable_cell('' . __('Access Granted') . ' ', $t['id']);
}else{
- form_selectable_cell('Access Restricted ', $t['id']);
+ form_selectable_cell('' . __('Access Restricted') . ' ', $t['id']);
}
} else {
if ($policy['policy_graphs'] == 1) {
- form_selectable_cell('Access Restricted ', $t['id']);
+ form_selectable_cell('' . __('Access Restricted') . ' ', $t['id']);
}else{
- form_selectable_cell('Access Granted ', $t['id']);
+ form_selectable_cell('' . __('Access Granted') . ' ', $t['id']);
}
}
form_checkbox_cell($t['name'], $t['id']);
@@ -1413,7 +1413,7 @@ function graph_perms_edit($tab, $header_label) {
/* put the nav bar on the bottom as well */
print $nav;
} else {
- print ' No Matching Trees Found ';
+ print '' . __('No Matching Trees Found') . ' ';
}
html_end_box(false);
@@ -1423,13 +1423,13 @@ function graph_perms_edit($tab, $header_label) {
if ($policy['policy_graph_templates'] == 1) {
$assoc_actions = array(
- 1 => 'Revoke Access',
- 2 => 'Grant Access'
+ 1 => __('Revoke Access'),
+ 2 => __('Grant Access')
);
}else{
$assoc_actions = array(
- 1 => 'Grant Access',
- 2 => 'Revoke Access'
+ 1 => __('Grant Access'),
+ 2 => __('Revoke Access')
);
}
@@ -1456,8 +1456,8 @@ function user_realms_edit($header_label) {
$all_realms = $user_auth_realms;
print "
-
- \n
+
+ \n
\n";
/* do cacti realms first */
@@ -1515,7 +1515,7 @@ function user_realms_edit($header_label) {
ON pc.directory = pr.plugin
ORDER BY pc.name, pr.display');
- print "\n";
+ print "\n";
print "\n";
if (sizeof($realms)) {
$last_plugin = 'none';
@@ -1571,7 +1571,7 @@ function user_realms_edit($header_label) {
print " \n";
}
- print "Legacy 1.x Plugins \n";
+ print "" . __('Legacy 1.x Plugins') . " \n";
foreach($all_realms as $realm => $name) {
if (sizeof(db_fetch_assoc_prepared('SELECT realm_id FROM user_auth_realm WHERE user_id = ? AND realm_id = ?', array(get_request_var('id', 0), $realm))) > 0) {
$old_value = 'on';
@@ -1606,7 +1606,7 @@ function settings_edit($header_label) {
form_start('user_admin.php');
- html_start_box("User Settings $header_label", '100%', '', '3', 'center', '');
+ html_start_box(__('User Settings %s', $header_label), '100%', '', '3', 'center', '');
while (list($tab_short_name, $tab_fields) = each($settings_user)) {
$collapsible = true;
@@ -1720,14 +1720,14 @@ function user_edit() {
/* present a tabbed interface */
$tabs = array(
- 'general' => 'General',
- 'realms' => 'Permissions',
- 'permsgr' => 'Group Membership',
- 'permsg' => 'Graph Perms',
- 'permsd' => 'Device Perms',
- 'permste' => 'Template Perms',
- 'permstr' => 'Tree Perms',
- 'settings' => 'User Settings'
+ 'general' => __('General'),
+ 'realms' => __('Permissions'),
+ 'permsgr' => __('Group Membership'),
+ 'permsg' => __('Graph Perms'),
+ 'permsd' => __('Device Perms'),
+ 'permste' => __('Template Perms'),
+ 'permstr' => __('Tree Perms'),
+ 'settings' => __('User Settings')
);
/* set the default tab */
@@ -1750,7 +1750,7 @@ function user_edit() {
" href='" . htmlspecialchars($config['url_path'] .
'user_admin.php?action=user_edit&id=' . get_request_var('id') .
'&tab=' . $tab_short_name) .
- "'>$tabs[$tab_short_name]\n";
+ "'>" . $tabs[$tab_short_name] . "\n";
}
api_plugin_hook('user_admin_tab');
@@ -1764,7 +1764,7 @@ function user_edit() {
form_start('user_admin.php');
- html_start_box("User Management $header_label", '100%', '', '3', 'center', '');
+ html_start_box(__('User Management %s', $header_label), '100%', '', '3', 'center', '');
draw_edit_form(
array(
@@ -1796,12 +1796,12 @@ function user_edit() {
$('#passconfirm').remove();
}else if ($('#password').val().length < minChars) {
$('#pass').remove();
- $('#password').after('Password Too Short ');
+ $('#password').after(' ');
}else{
$.post('user_admin.php?action=checkpass', { password: $('#password').val(), password_confim: $('#password_confirm').val(), __csrf_magic: csrfMagicToken } ).done(function(data) {
if (data == 'ok') {
$('#pass').remove();
- $('#password').after('Password Validation Passes ');
+ $('#password').after(' ');
checkPasswordConfirm();
}else{
$('#pass').remove();
@@ -1815,10 +1815,10 @@ function user_edit() {
if ($('#password_confirm').val().length > 0) {
if ($('#password').val() != $('#password_confirm').val()) {
$('#passconfirm').remove();
- $('#password_confirm').after('Passwords do Not Match ');
+ $('#password_confirm').after(' ');
}else{
$('#passconfirm').remove();
- $('#password_confirm').after('Passwords Match ');
+ $('#password_confirm').after(' ');
}
}else{
$('#passconfirm').remove();
@@ -1942,7 +1942,7 @@ function user() {
- Search
+
'>
- Users
+
- ':'>') . __('Default');?>
+ ':'>') . __('Default');?>>
0) {
foreach ($item_rows as $key => $value) {
@@ -1978,10 +1978,10 @@ function user() {
-
+ ' title=''>
-
+ ' title=''>
@@ -2024,28 +2024,29 @@ function user() {
print $nav;
$display_text = array(
- 'username' => array('User Name', 'ASC'),
- 'full_name' => array('Full Name', 'ASC'),
- 'enabled' => array('Enabled', 'ASC'),
- 'realm' => array('Realm', 'ASC'),
- 'policy_graphs' => array('Graph Policy', 'ASC'),
- 'policy_hosts' => array('Device Policy', 'ASC'),
- 'policy_graph_templates' => array('Template Policy', 'ASC'),
- 'dtime' => array('Last Login', 'DESC'));
+ 'username' => array(__('User Name'), 'ASC'),
+ 'full_name' => array(__('Full Name'), 'ASC'),
+ 'enabled' => array(__('Enabled'), 'ASC'),
+ 'realm' => array(__('Realm'), 'ASC'),
+ 'policy_graphs' => array(__('Graph Policy'), 'ASC'),
+ 'policy_hosts' => array(__('Device Policy'), 'ASC'),
+ 'policy_graph_templates' => array(__('Template Policy'), 'ASC'),
+ 'dtime' => array(__('Last Login'), 'DESC')
+ );
html_header_sort_checkbox($display_text, get_request_var('sort_column'), get_request_var('sort_direction'), false);
if (sizeof($user_list) > 0) {
foreach ($user_list as $user) {
if (empty($user['dtime']) || ($user['dtime'] == '12/31/1969')) {
- $last_login = 'N/A';
+ $last_login = __('N/A');
}else{
$last_login = strftime('%A, %B %d, %Y %H:%M:%S ', strtotime($user['dtime']));;
}
if ($user['enabled'] == 'on') {
- $enabled = 'Yes';
+ $enabled = __('Yes');
}else{
- $enabled = 'No';
+ $enabled = __('No');
}
form_alternate_row('line' . $user['id'], true);
@@ -2055,9 +2056,9 @@ function user() {
form_selectable_cell((strlen(get_request_var('filter')) ? preg_replace('/(' . preg_quote(get_request_var('filter')) . ')/i', "\\1 ", htmlspecialchars($user['full_name'])) : htmlspecialchars($user['full_name'])), $user['id']);
form_selectable_cell($enabled, $user['id']);
form_selectable_cell($auth_realms[$user['realm']], $user['id']);
- form_selectable_cell(($user['policy_graphs'] == 1 ? 'ALLOW':'DENY'), $user['id']);
- form_selectable_cell(($user['policy_hosts'] == 1 ? 'ALLOW':'DENY'), $user['id']);
- form_selectable_cell(($user['policy_graph_templates'] == 1 ? 'ALLOW':'DENY'), $user['id']);
+ form_selectable_cell(($user['policy_graphs'] == 1 ? __('ALLOW'):__('DENY')), $user['id']);
+ form_selectable_cell(($user['policy_hosts'] == 1 ? __('ALLOW'):__('DENY')), $user['id']);
+ form_selectable_cell(($user['policy_graph_templates'] == 1 ? __('ALLOW'):__('DENY')), $user['id']);
form_selectable_cell($last_login, $user['id']);
form_checkbox_cell($user['username'], $user['id']);
form_end_row();
@@ -2065,12 +2066,11 @@ function user() {
print $nav;
}else{
- print 'No Users ';
+ print '' . __('No Users') . ' ';
}
html_end_box(false);
draw_actions_dropdown($user_actions);
-
}
function process_graph_request_vars() {
@@ -2276,7 +2276,7 @@ function graph_filter($header_label) {
@@ -2285,18 +2285,18 @@ function graph_filter($header_label) {
@@ -2385,7 +2385,7 @@ function group_filter($header_label) {
@@ -2394,13 +2394,13 @@ function group_filter($header_label) {
@@ -2473,7 +2473,7 @@ function device_filter($header_label) {
@@ -2482,18 +2482,18 @@ function device_filter($header_label) {
@@ -2578,7 +2578,7 @@ function template_filter($header_label) {
@@ -2587,17 +2587,17 @@ function template_filter($header_label) {
@@ -2665,7 +2665,7 @@ function tree_filter($header_label) {
@@ -2674,13 +2674,13 @@ function tree_filter($header_label) {
@@ -2752,7 +2752,7 @@ function member_filter($header_label) {
@@ -2761,13 +2761,13 @@ function member_filter($header_label) {