Show link to missing module
authorJamie Cameron <jcameron@webmin.com>
Sun, 24 Oct 2010 00:34:02 +0000 (17:34 -0700)
committerJamie Cameron <jcameron@webmin.com>
Sun, 24 Oct 2010 00:34:02 +0000 (17:34 -0700)
cpan/download.cgi
webmin/edit_access.cgi
webmin/lang/en

index dd2ab2e..84e9922 100755 (executable)
@@ -155,6 +155,9 @@ elsif ($in{'source'} == 3) {
                }
        $need_unlink = 1;
        }
+else {
+       &error("Unknown source mode $in{'source'}");
+       }
 
 # Check if the file looks like a perl module
 foreach $pfile (@pfile) {
index d1815ab..e9083cc 100755 (executable)
@@ -30,6 +30,16 @@ if (!$@) {
        print &ui_table_row($text{'access_libwrap'},
                &ui_yesno_radio("libwrap", int($miniserv{'libwrap'})));
        }
+else {
+       $msg = &text('access_elibwrap', "<tt>Authen::Libwrap</tt>")."\n";
+       if (foreign_available("cpan")) {
+               $msg .= &text('access_libwrapcpan',
+                       "/cpan/download.cgi?source=3&cpan=Authen::Libwrap&".
+                       "mode=2&return=/$module_name/&returndesc=".
+                       &urlize($text{'index_return'}));
+               }
+       print &ui_table_row(" ", $msg);
+       }
 
 print &ui_table_end();
 print &ui_form_end([ [ "save", $text{'save'} ] ]);
index c8133b5..abd1314 100644 (file)
@@ -20,6 +20,8 @@ access_all=Allow from all addresses
 access_allow=Only allow from listed addresses
 access_deny=Deny from listed addresses
 access_libwrap=Also check TCP-wrappers <tt>hosts.allow</tt> and <tt>hosts.deny</tt> files?
+access_elibwrap=IP access control using TCP-wrappers is not available, as the $1 Perl module is not installed.
+access_libwrapcpan=<a href='$1'>Click here</a> to have Webmin automatically install the missing Perl module.
 access_err=Failed to update access list
 access_enone=No addresses entered
 access_enet='$1' is not a valid network address