Use Digest::MD5 instead of htdigest command if possible
authorJamie Cameron <jcameron@webmin.com>
Sat, 26 May 2007 19:56:49 +0000 (19:56 +0000)
committerJamie Cameron <jcameron@webmin.com>
Sat, 26 May 2007 19:56:49 +0000 (19:56 +0000)
htaccess-htpasswd/CHANGELOG
htaccess-htpasswd/index.cgi
htaccess-htpasswd/lang/en

index 2d9c890..84df0b5 100644 (file)
@@ -12,3 +12,5 @@ Added the ability to specify extra directives to be added to .htaccess files, th
 On Windows systems, the htpasswd.exe program is used to generate encrypted passwords.
 ---- Changes since 1.310 ----
 Added checkboxes and a button for deleting multiple directories accounts at once.
+---- Changes since 1.340 ----
+Removes the need for the htdigest command to be installed if the Digest::MD5 perl module is available.
index 0a3dd57..55ac12f 100755 (executable)
@@ -28,11 +28,15 @@ if ($missing) {
        exit;
        }
 
-# Check for htdigest command
+# Check for htdigest command, if we need it
 if ($config{'digest'} && !$htdigest_command) {
-       print &text('index_digest', "<tt>htdigest</tt>"),"<p>\n";
-       &ui_print_footer("/", $text{'index'});
-       exit;
+       eval "use Digest::MD5";
+       if ($@) {
+               print &text('index_digest2', "<tt>htdigest</tt>",
+                                            "<tt>Digest::MD5</tt>"),"<p>\n";
+               &ui_print_footer("/", $text{'index'});
+               exit;
+               }
        }
 
 @accessdirs || &error($text{'index_eaccess'});
index ef8bfdb..168e1da 100644 (file)
@@ -12,7 +12,7 @@ index_eaccess=You do not have access to any directories!
 index_search=Find existing protected directories under:
 index_md5=MD5 encryption is enabled in the module configuration, but the $1 Perl module needed for it is not installed.
 index_sha1=SHA1 encryption is enabled in the module configuration, but the $1 Perl module needed for it is not installed.
-index_digest=Digest encryption is enabled in the module configuration, but the $1 command needed for it is not installed.
+index_digest2=Digest encryption is enabled in the module configuration, but the $1 command or $2 Perl module needed for it is not installed.
 index_cpan=<a href='$1'>Click here</a> to download and install it now.
 index_delete=Un-Protect Selected Directories