diff --git a/mount/CHANGELOG b/mount/CHANGELOG
index efaac68a0..b5df954a3 100644
--- a/mount/CHANGELOG
+++ b/mount/CHANGELOG
@@ -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.
diff --git a/mount/config.info b/mount/config.info
index 134343ebf..3141ce618 100644
--- a/mount/config.info
+++ b/mount/config.info
@@ -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
diff --git a/mount/lang/en b/mount/lang/en
index da3953f6d..2a951195b 100644
--- a/mount/lang/en
+++ b/mount/lang/en
@@ -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..
diff --git a/mount/smb_server.cgi b/mount/smb_server.cgi
index 20cd98e55..dafa83a1b 100755
--- a/mount/smb_server.cgi
+++ b/mount/smb_server.cgi
@@ -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 ",&text('smb_emaster', $config{'browse_group'}),"\n";
+ exit;
+ }
+ }
+ else {
+ # No idea what to do
+ print "",&text('smb_eworkgroup'),"\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 "$text{'smb_sel'}
\n";
- print "
| $text{'smb_name'} | ", - "$text{'smb_desc'} |
| $names[$i] | \n"; - print "$comms[$i] |
\n";
diff --git a/mount/smb_share.cgi b/mount/smb_share.cgi
index 1bef8259c..c17b9e0ac 100755
--- a/mount/smb_share.cgi
+++ b/mount/smb_share.cgi
@@ -39,21 +39,20 @@ if ($out =~ /Sharename\s+Type\s+Comment\n((.+\n)+)/) {
}
}
if (@names) {
- print "$text{'smb_sel2'}
\n";
- print "
| $text{'smb_share'} | ", - "$text{'smb_comment'} |
| $names[$i] | \n"; - printf "%s |
\n"; } &popup_footer();