Changeset 5821 for trunk/MailerContrib/lib/Foswiki/Contrib/MailerContrib.pm
- Timestamp:
- 12/18/09 11:14:24 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MailerContrib/lib/Foswiki/Contrib/MailerContrib.pm
r5752 r5821 27 27 28 28 our $VERSION = '$Rev$'; 29 our $RELEASE = ' 8 Dec 2009';29 our $RELEASE = '18 Dec 2009'; 30 30 our $SHORTDESCRIPTION = 'Supports e-mail notification of changes'; 31 31 … … 38 38 $Foswiki::cfg{MailerContrib}{EmailFilterIn} ||= 39 39 $Foswiki::regex{emailAddrRegex}; 40 }41 42 # Plugin init method, used to initialise handlers43 sub initPlugin {44 Foswiki::Func::registerRESTHandler('notify', \&_restNotify);45 return 1;46 }47 48 # Run mailnotify using a rest handler49 sub _restNotify {50 my ( $session, $plugin, $verb, $response ) = @_;51 52 if (!Foswiki::Func::isAnAdmin()) {53 $response->header( -status => 403, -type => 'text/plain' );54 $response->print("Only administrators can do that");55 } else {56 # Don't use the $response; we want to see things happening57 local $| = 1; # autoflush on58 require CGI;59 print CGI::header( -status => 200, -type => 'text/plain' );60 my $query = Foswiki::Func::getCgiQuery();61 my $nonews = $query->param('nonews');62 my $nochanges = $query->param('nochanges');63 my @exwebs = split(',', $query->param('excludewebs') || '');64 my @webs = split(',', $query->param('webs') || '');65 $verbose = 1; # watchen das blinken lights66 mailNotify( \@webs, $verbose, \@exwebs, $nonews, $nochanges );67 }68 return undef;69 40 } 70 41
Note: See TracChangeset
for help on using the changeset viewer.
