Author: sparky
Date: Tue Nov  3 23:55:47 2009
New Revision: 10940

Modified:
   toys/rsget.pl/README.config
   toys/rsget.pl/RSGet/Captcha.pm
Log:
- changed captcha_save_results setting into a directory


Modified: toys/rsget.pl/README.config
==============================================================================
--- toys/rsget.pl/README.config (original)
+++ toys/rsget.pl/README.config Tue Nov  3 23:55:47 2009
@@ -68,5 +68,5 @@
 # be verbose (useful for debugging):
 #verbose = 2
 
-# save captcha images (useful for debugging):
-#captcha_save_results = 1
+# save captcha images (useful for debugging) in ~/.rsget.pl/captcha directory:
+#captcha_save_results = ${RSGET_DIR}/captcha

Modified: toys/rsget.pl/RSGet/Captcha.pm
==============================================================================
--- toys/rsget.pl/RSGet/Captcha.pm      (original)
+++ toys/rsget.pl/RSGet/Captcha.pm      Tue Nov  3 23:55:47 2009
@@ -16,8 +16,7 @@
 def_settings(
        captcha_save_results => {
                desc => "Save captcha results, for captcha debugging.",
-               default => 0,
-               allowed => qr/\d+/,
+               type => "PATH",
        },
 );
 
@@ -98,8 +97,9 @@
        my $name = $self->{captcha_md5};
        delete $self->{captcha_md5};
 
-       return unless setting( "captcha_save_results" );
        return unless $name;
+       my $capdir = setting( "captcha_save_results" );
+       return unless $capdir;
 
        my $subdir;
        if ( not defined $result ) {
@@ -113,7 +113,7 @@
        }
 
        my $getter = RSGet::Plugin::from_pkg( $self->{_pkg} );
-       my $dir = "captcha/$getter->{short}/$subdir";
+       my $dir = "$capdir/captcha/$getter->{short}/$subdir";
        mkpath( $dir ) unless -d $dir;
 
        my $file = "$dir/$name";
_______________________________________________
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to