Allow smb credentials in a separate file
authorJamie Cameron <jcameron@webmin.com>
Mon, 21 Jul 2008 02:28:27 +0000 (02:28 +0000)
committerJamie Cameron <jcameron@webmin.com>
Mon, 21 Jul 2008 02:28:27 +0000 (02:28 +0000)
mount/CHANGELOG
mount/lang/en
mount/linux-lib.pl

index 9275b9d..dde79c1 100644 (file)
@@ -17,3 +17,5 @@ Added support for HFS and FATX filesystems under Linux.
 Partitions specified using the UUID notation in /etc/fstab are now supported, as seen on Ubuntu Linux.
 ---- Changes since 1.330 ----
 Mounted filesystems can now be displayed on Intel macs, without needing the gcc program.
+---- Changes since 1.420 ----
+SMBFS authentication credentials can be stored in a separate file, thanks to a patch by Rob Shinn.
index c857f4e..dd346d0 100644 (file)
@@ -313,6 +313,7 @@ linux_secs=seconds
 linux_smbwarn=Warning! Filesystem was not mounted from Webmin, so existing options are not available
 linux_username=Login Name
 linux_password=Login Password
+linux_credentials=Credentials File
 linux_sname=Server Name
 linux_wg=Workgroup
 linux_auto=Automatic
index 51c9115..0aba425 100644 (file)
@@ -1499,7 +1499,17 @@ elsif ($_[0] eq $smbfs_fs || $_[0] eq "cifs") {
        print "<td><b>$text{'linux_password'}</b></td>\n";
        printf "<td><input type=password name=smbfs_passwd size=15 value=\"%s\"></td> </tr>\n",
                $support == 4 ? $options{'password'} : $options{'passwd'};
-
+       
+       print "<td><b>$text{'linux_credentials'}</b></td>\n";
+       if ($support == 4) {
+               printf "<td><input name=smbfs_creds size=30 value=\"%s\"> ",
+                       defined($options{"credentials"}) ? $options{'credentials'} : "";
+               
+               if ($access{'browse'}) {
+                       print &file_chooser_button("smbfs_creds", 0);
+                       }
+               }
+       print "</td>\n";
        if (!$access{'simopts'}) {
                if ($support != 2) {
                        print "<tr> <td><b>$text{'linux_uid'}</b></td>\n";
@@ -2062,6 +2072,13 @@ elsif ($_[0] eq $smbfs_fs || $_[0] eq "cifs") {
                $options{$support == 4 ? 'password' : 'passwd'} = $in{smbfs_passwd};
                }
 
+       if ($support == 4) {    
+               delete($options{'credentials'});
+               if ($in{smbfs_creds}) {
+                       $options{'credentials'} = $in{smbfs_creds};
+                       }
+               }
+
        if (!$access{'simopts'}) {
                if ($support != 2) {
                        delete($options{uid});