mirror of
https://github.com/webmin/webmin.git
synced 2026-06-20 19:30:30 +01:00
Option to find master based on workgroup https://sourceforge.net/tracker/?func=detail&atid=117457&aid=3606665&group_id=17457
This commit is contained in:
@@ -24,3 +24,5 @@ Improved support for filesystems on partitions identified by volume ID when the
|
||||
Show the used disk space for each filesystem on the main page.
|
||||
---- Changes since 1.580 ----
|
||||
Updated the UI for Linux and most other operating systems to use Webmin's new UI functions, for a more consistent look.
|
||||
---- Changes since 1.620 ----
|
||||
Added a Module Config option to find the master CIFS server for browsing from a workgroup name.
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
line1=Configurable options,11
|
||||
browse_server=Server to request browse list from,3,localhost
|
||||
browse_server=Server to request CIFS browse list from,10,-localhost,*-Workgroup below,Other server
|
||||
browse_group=CIFS workgroup for browse list,0
|
||||
long_fstypes=Show long filesystem type names,1,1-Yes,0-No
|
||||
sort_mode=Sort filesystems by,1,2-Mount point,1-Type,0-Order in files
|
||||
show_used=Show used disk space in filesystems list,1,1-Yes,0-No
|
||||
|
||||
@@ -44,7 +44,7 @@ edit_dos_opt=DOS-based filesystems options
|
||||
edit_hpfs_opt=hpfs specific options
|
||||
edit_iso9660_opt=ISO9660 specific options
|
||||
edit_autofs_opt=autofs specific options
|
||||
edit_smbfs_opt=SMB filesystems options
|
||||
edit_smbfs_opt=CIFS filesystems options
|
||||
edit_reiserfs_opt=Reiserfs specific options
|
||||
edit_tmpfs_opt=tmpfs specific options
|
||||
edit_xfs_opt=xfs specific options
|
||||
@@ -92,8 +92,10 @@ nfs_seldirv4=For an NFSv4 mount, you should select '/'
|
||||
nfs_dir=Directory
|
||||
nfs_clients=Clients
|
||||
|
||||
smb_choose=Choose SMB Server..
|
||||
smb_choose=Choose CIFS Server..
|
||||
smb_elist=Failed to retrieve server list from $1. Maybe the server does not allow browsing
|
||||
smb_eworkgroup=No workgroup set on the Module Config page
|
||||
smb_emaster=No browse master was found for workgroup $1
|
||||
smb_ehost=The server $1 does not exist
|
||||
smb_edown=The server $1 is down, unreachable or is not a file server
|
||||
smb_sel=Select a Windows Networking server to mount from..
|
||||
|
||||
@@ -18,7 +18,35 @@ window.close();
|
||||
EOF
|
||||
|
||||
# call smbclient
|
||||
$host = $config{'browse_server'} ? $config{'browse_server'} : "localhost";
|
||||
if ($config{'browse_server'} eq "*") {
|
||||
# Get from workgroup
|
||||
if ($config{'browse_group'}) {
|
||||
# Find master for workgroup
|
||||
$out = &backquote_command(
|
||||
$config{'nmblookup_path'}." -N ".
|
||||
$config{'browse_group'}." 2>&1 </dev/null");
|
||||
if ($out =~ /(^|\n)([0-9\.]+)\s/) {
|
||||
$host = $2;
|
||||
}
|
||||
else {
|
||||
print "<b>",&text('smb_emaster', $config{'browse_group'}),"</b>\n";
|
||||
exit;
|
||||
}
|
||||
}
|
||||
else {
|
||||
# No idea what to do
|
||||
print "<b>",&text('smb_eworkgroup'),"</b>\n";
|
||||
exit;
|
||||
}
|
||||
}
|
||||
elsif ($config{'browse_server'}) {
|
||||
# Fixed host
|
||||
$host = $config{'browse_server'};
|
||||
}
|
||||
else {
|
||||
# Poll local samba
|
||||
$host = "localhost";
|
||||
}
|
||||
&execute_command("$config{'smbclient_path'} -d 0 -L $host -N",
|
||||
undef, \$out, \$out);
|
||||
if ($?) {
|
||||
@@ -45,17 +73,16 @@ if ($out =~ /Server\s+Comment\n.*\n((.+\n)+)/) {
|
||||
}
|
||||
|
||||
if (@names) {
|
||||
print "<b>$text{'smb_sel'}</b><br>\n";
|
||||
print "<table border width=100%>\n";
|
||||
print "<tr $tb> <td><b>$text{'smb_name'}</b></td> ",
|
||||
"<td><b>$text{'smb_desc'}</b></td> </tr>\n";
|
||||
print "<b>$text{'smb_sel'}</b><p>\n";
|
||||
print &ui_columns_start([ $text{'smb_name'}, $text{'smb_desc'} ]);
|
||||
for($i=0; $i<@names; $i++) {
|
||||
print "<tr $cb>\n";
|
||||
print "<td><a href=\"\" onClick='choose(\"$names[$i]\"); ",
|
||||
"return false'>$names[$i]</a></td>\n";
|
||||
print "<td>$comms[$i]</td> </tr>\n";
|
||||
print &ui_columns_row([
|
||||
"<a href=\"\" onClick='choose(\"$names[$i]\"); ".
|
||||
"return false'>$names[$i]</a></td>\n",
|
||||
&html_escape($comms[$i]),
|
||||
]);
|
||||
}
|
||||
print "</table>\n";
|
||||
print &ui_columns_end();
|
||||
}
|
||||
else {
|
||||
print "<b>$text{'smb_none'}</b>.<p>\n";
|
||||
|
||||
@@ -39,21 +39,20 @@ if ($out =~ /Sharename\s+Type\s+Comment\n((.+\n)+)/) {
|
||||
}
|
||||
}
|
||||
if (@names) {
|
||||
print "<b>$text{'smb_sel2'}</b><br>\n";
|
||||
print "<table border width=100%>\n";
|
||||
print "<tr $tb> <td><b>$text{'smb_share'}</b></td> ",
|
||||
"<td><b>$text{'smb_comment'}</b></td> </tr>\n";
|
||||
print "<b>$text{'smb_sel2'}</b><p>\n";
|
||||
print &ui_columns_start([ $text{'smb_share'},
|
||||
$text{'smb_comment'} ]);
|
||||
for($i=0; $i<@names; $i++) {
|
||||
print "<tr $cb> <td><a href=\"\" ",
|
||||
"onClick='choose(\"$names[$i]\"); ".
|
||||
"return false'>$names[$i]</a></td>\n";
|
||||
printf "<td>%s</td> </tr>\n",
|
||||
$comms[$i] =~ /\S/ ? $comms[$i] : "<br>";
|
||||
print &ui_columns_row([
|
||||
"<a href=\"\" onClick='choose(\"$names[$i]\"); ".
|
||||
"return false'>$names[$i]</a>",
|
||||
&html_escape($comms[$i]),
|
||||
]);
|
||||
}
|
||||
print "</table>\n";
|
||||
print &ui_columns_end();
|
||||
}
|
||||
else {
|
||||
print "<b>",&text('smb_noshares', $in{'server'}),"</b>\n";
|
||||
print "<b>",&text('smb_noshares', $in{'server'}),"</b><p>\n";
|
||||
}
|
||||
|
||||
&popup_footer();
|
||||
|
||||
Reference in New Issue
Block a user