]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/blogspam.pm
po: Allow enabling via web setup.
[git.ikiwiki.info.git] / IkiWiki / Plugin / blogspam.pm
index 626c8ec42acc8f69297d416ef358e66702a153b3..8db3780e8888ee9c9188881e80ae26b6715436ff 100644 (file)
@@ -18,6 +18,7 @@ sub getsetup () {
                plugin => {
                        safe => 1,
                        rebuild => 0,
                plugin => {
                        safe => 1,
                        rebuild => 0,
+                       section => "auth",
                },
                blogspam_pagespec => {
                        type => 'pagespec',
                },
                blogspam_pagespec => {
                        type => 'pagespec',
@@ -57,6 +58,7 @@ sub checkconfig () {
 
 sub checkcontent (@) {
        my %params=@_;
 
 sub checkcontent (@) {
        my %params=@_;
+       my $session=$params{session};
        
        if (exists $config{blogspam_pagespec}) {
                return undef
        
        if (exists $config{blogspam_pagespec}) {
                return undef
@@ -87,7 +89,7 @@ sub checkcontent (@) {
        push @options, "exclude=stopwords";
 
        my %req=(
        push @options, "exclude=stopwords";
 
        my %req=(
-               ip => $ENV{REMOTE_ADDR},
+               ip => $session->remote_addr(),
                comment => defined $params{diff} ? $params{diff} : $params{content},
                subject => defined $params{subject} ? $params{subject} : "",
                name => defined $params{author} ? $params{author} : "",
                comment => defined $params{diff} ? $params{diff} : $params{content},
                subject => defined $params{subject} ? $params{subject} : "",
                name => defined $params{author} ? $params{author} : "",