Changeset 207

Show
Ignore:
Timestamp:
05/18/06 16:42:10 (3 years ago)
Author:
ogawa
Message:

Fix: captcha.pl pointed to wrong data_folder and output_folder.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • captcha/trunk/plugins/captcha/captcha.pl

    r206 r207  
    1212use MT; 
    1313use MT::Template::Context; 
     14use File::Spec; 
     15use File::Basename; 
    1416use Authen::Captcha; 
    1517use base 'MT::Plugin'; 
     
    2628MT->add_plugin($plugin); 
    2729 
    28 my $captcha = Authen::Captcha->new(data_folder => './data', 
    29                                    output_folder => './images'); 
     30my $dirname = dirname(__FILE__); 
     31my $captcha = Authen::Captcha->new( 
     32   data_folder => File::Spec->catdir($dirname, 'data'), 
     33   output_folder => File::Spec->catdir($dirname, 'images') 
     34); 
     35 
    3036MT->add_callback('CommentThrottleFilter', 5, $plugin, \&captcha_test); 
    3137MT::Template::Context->add_tag(CaptchaJsURL => \&captcha_js_url); 
     
    5056    my $path = MT::ConfigMgr->instance->CGIPath; 
    5157    $path .= '/' unless $path =~ m!/$!; 
    52     $path . 'plugins/captcha/captcha_js.cgi'; # ad hoc 
     58    $path . 'plugins/captcha/captcha_js.cgi'; 
    5359} 
    5460