mirror of
https://github.com/webmin/webmin.git
synced 2025-07-20 16:48:46 +00:00
Work on iscsi authentication
This commit is contained in:
BIN
blue-theme/iscsi-server/images/users.gif
Normal file
BIN
blue-theme/iscsi-server/images/users.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.3 KiB |
@ -1,4 +1,5 @@
|
||||
targets_file=/etc/iscsi/targets
|
||||
auths_file=/etc/iscsi/auths
|
||||
iscsi_server=/usr/sbin/iscsi-target
|
||||
pid_file=/var/run/iscsi-target.pid
|
||||
init_name=netbsd-iscsi
|
||||
|
@ -1,4 +1,5 @@
|
||||
targets_file=/usr/local/etc/iscsi/targets
|
||||
auths_file=/usr/local/etc/iscsi/auths
|
||||
iscsi_server=/usr/local/bin/iscsi-target
|
||||
pid_file=/var/run/iscsi-target.pid
|
||||
init_name=iscsi_target
|
||||
|
@ -1,4 +1,5 @@
|
||||
targets_file=iSCSI server targets file,0
|
||||
auths_file=iSCSI server authentication file,0
|
||||
iscsi_server=Full path to iSCSI server,0
|
||||
pid_file=Full path to PID file,0
|
||||
init_name=Bootup script name,0
|
||||
|
BIN
iscsi-server/images/users.gif
Normal file
BIN
iscsi-server/images/users.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 390 B |
@ -474,5 +474,31 @@ foreach my $o (keys %$opts) {
|
||||
&save_iscsi_options_string(join(" ", @str));
|
||||
}
|
||||
|
||||
# list_iscsi_users()
|
||||
# Parses the auths file and returns an array of users
|
||||
sub list_iscsi_users
|
||||
{
|
||||
my @rv;
|
||||
my $fh = "AUTHS";
|
||||
my $lnum = 0;
|
||||
&open_readfile($fh, $config{'auths_file'}) || return ( );
|
||||
while(<$fh>) {
|
||||
s/\r|\n//;
|
||||
s/\s+$//;
|
||||
my ($user, $mode, $pass, @rest) = split(/:/, $_);
|
||||
if ($user) {
|
||||
my $uinfo = { 'user' => $user,
|
||||
'mode' => $mode,
|
||||
'pass' => $pass,
|
||||
'rest' => \@rest,
|
||||
'line' => $lnum };
|
||||
push(@rv, $uinfo);
|
||||
}
|
||||
$lnum++;
|
||||
}
|
||||
close($fh);
|
||||
return @rv;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
@ -138,6 +138,10 @@ manual_desc=Use the text box below to edit the iSCSI server configuration file $
|
||||
manual_err=Failed to save configuration file
|
||||
manual_edata=No contents entered!
|
||||
|
||||
users_title=iSCSI Authentication
|
||||
users_none=No iSCSI users have been created yet. Clients will be able to access shared devices without authenticating.
|
||||
users_add=Add a new iSCSI user.
|
||||
|
||||
desc_extent=Device to share $1
|
||||
desc_device=Device combination $1
|
||||
desc_target=Sharing target $1
|
||||
|
37
iscsi-server/list_users.cgi
Normal file
37
iscsi-server/list_users.cgi
Normal file
@ -0,0 +1,37 @@
|
||||
#!/usr/local/bin/perl
|
||||
# List all iscsi users
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
require './iscsi-server-lib.pl';
|
||||
our (%text);
|
||||
my @users = &list_iscsi_users();
|
||||
|
||||
&ui_print_header(undef, $text{'users_title'}, "");
|
||||
|
||||
my @links = ( "<a href='edit_user.cgi?new=1'>$text{'users_add'}</a>" );
|
||||
if (@users) {
|
||||
unshift(@links, &select_all_link("d"), &select_invert_link("d"));
|
||||
print &ui_form_start("delete_devices.cgi");
|
||||
print &ui_links_row(\@links);
|
||||
my @tds = ( "width=5" );
|
||||
print &ui_columns_start([ undef,
|
||||
$text{'users_name'},
|
||||
$text{'users_mode'} ], 100, 0, \@tds);
|
||||
foreach my $e (@users) {
|
||||
print &ui_checked_columns_row([
|
||||
"<a href='edit_user.cgi?user=$e->{'user'}'>".
|
||||
&html_escape($e->{'user'})."</a>",
|
||||
uc($e->{'mode'}),
|
||||
], \@tds, "d", $e->{'user'});
|
||||
}
|
||||
print &ui_columns_end();
|
||||
print &ui_links_row(\@links);
|
||||
print &ui_form_end([ [ undef, $text{'users_delete'} ] ]);
|
||||
}
|
||||
else {
|
||||
print "<b>$text{'users_none'}</b><p>\n";
|
||||
print &ui_links_row(\@links);
|
||||
}
|
||||
|
||||
&ui_print_footer("", $text{'index_return'});
|
Reference in New Issue
Block a user