Skip to content
This repository has been archived by the owner on Sep 24, 2024. It is now read-only.

Commit

Permalink
Internationalize the show users page
Browse files Browse the repository at this point in the history
  • Loading branch information
rdmark committed Jan 6, 2024
1 parent 2d163a7 commit 7fe85aa
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
15 changes: 10 additions & 5 deletions lang/en
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@

lang=en
index_root=Webmin Home
index_title=Netatalk AFP Server
index_module=Module Index
interfaces_title=Netatalk Interfaces
servers_title=Virtual Servers
users_title=Connected Users
edit_file_share_title=Edit File Share
Expand Down Expand Up @@ -57,7 +55,7 @@ server_header=Servers
index_server=Servers
init_failed=Command "$1" failed

edit_header=Create New Apple File Share
edit_header=Create New File Share
edit_tableheader=Common Options
edit_adv_tableheader=Advanced Options
edit_sharename=Share name
Expand Down Expand Up @@ -175,8 +173,6 @@ give_correct_path=Please give correct path
indicate_sharename=Please indicate sharename
copy_failed=Failed to copy file
delete_failed=Can't delete file
not_valid_path=Not Valid Path
no_path=No Path
error_illegal_char=Name contains illegal characters

help_volume=Volume Config Help
Expand All @@ -192,3 +188,12 @@ manual_etest=Configuration file error detected : $1
test_config=1
test_always=0
test_manual=0

users_disconnect_success=User disconnected
users_disconnect_fail=Could not disconnect user!
users_connected_users=There are currently $1 user(s) connected.
users_table_user=User
users_table_connected=Connected Since
users_table_pid=PID
users_table_action=Action
users_button_disconnect=Disconnect
19 changes: 13 additions & 6 deletions show_users.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ ui_print_header(undef, $text{'users_title'}, "", "configs", 1);
if($in{kill}) {
$in{kill} =~ s/\D//gi;
if(kill(15,$in{kill})) {
print "<h4>User disconnected</h4>\n";
print "<h4>$text{'users_disconnect_success'}</h4>\n";
} else {
print "<h4>User <blink>NOT</blink> disconnected !</h4>\n";
print "<h4>$text{'users_disconnect_fail'}</h4>\n";
}
}

Expand All @@ -44,14 +44,21 @@ for (qx(ps aux)) {
}
}

print "<p>There are currently " . scalar(@users) . " users connected.</p>\n";
print "<p>",&text('users_connected_users', scalar(@users)),"</p>\n";
print "<table width=\"100%\" border>\n";
print "<tr $tb><td style=\"width: 25%;\"><b>User</b></td><td style=\"width: 25%;\"><b>Connected Since</b></td><td style=\"width: 25%;\"><b>PID</b></td><td style=\"width: 25%;\"><b>Action</b></td></tr>\n";
print "<tr $tb>\n";
print "<td style=\"width: 25%;\"><b>$text{'users_table_user'}</b></td>\n";
print "<td style=\"width: 25%;\"><b>$text{'users_table_connected'}</b></td>\n";
print "<td style=\"width: 25%;\"><b>$text{'users_table_pid'}</b></td>\n";
print "<td style=\"width: 25%;\"><b>$text{'users_table_action'}</b></td></tr>\n";
foreach my $user (sort @users) {
#username,PID,date
my @line = split(":::", $user);
print "<tr $cb><td>$line[0] </td><td>$line[2]</td><td>$line[1]</td><td>";
print "<form action=\"show_users.cgi\"><input type=hidden name=kill value=\"$line[1]\"><input type=submit value=\"Disconnect\"></form>";
print "<tr $tc><td>$line[0] </td><td>$line[2]</td><td>$line[1]</td><td>";
print "<form action=\"show_users.cgi\">\n";
print "<input type=hidden name=kill value=\"$line[1]\">\n";
print "<input type=submit value=\"$text{'users_button_disconnect'}\">\n";
print "</form>\n";
print "</td></tr>\n";
}
print "</table>\n";
Expand Down

0 comments on commit 7fe85aa

Please sign in to comment.