+use POSIX;
+use IkiWiki 2.00;
+
-+sub import { #{{{
++sub import {
+ hook(type => "checkconfig", id => "blogpost", call => \&checkconfig);
+ hook(type => "authcgi", id => "blogpost", call => \&authcgi);
+ hook(type => "canedit", id => "blogpost", call => \&canedit);
-+} # }}}
++}
+
-+sub checkconfig () { #{{{
++sub checkconfig () {
+ if (! defined $config{blogformat}){
+ $config{blogformat} = 'posts/%Y/%m/%d/$title';
+ }
+ if (! defined $config{blogusers}) {
+ $config{blogusers} = (); # disallow all posting by default
+ }
-+} #}}}
++}
+
-+sub authcgi ($$) { #{{{
++sub authcgi ($$) {
+ my $cgi=shift;
+ my $session=shift;
+
+ $cgi->param("page", $page);
+ }
+
-+} #}}}
++}
+
-+sub blogpage ($) { #{{{
++sub blogpage ($) {
+ my $title=shift;
+ my $page=POSIX::strftime $config{blogformat}, localtime;
+ $page =~ s/\$title/$title/;
+ return $page;
-+} #}}}
++}
+
-+sub canedit ($$$) { #{{{
++sub canedit ($$$) {
+ my $page=shift;
+ my $cgi=shift;
+ my $session=shift;
+ return "" if ($config{blogusers} eq "*" ||
+ grep {$_ eq $user} $config{blogusers});
+ return ("not allowed to blog, $user");
-+} #}}}
++}
+
+1
Index: IkiWiki.pm
our $version='unknown'; # VERSION_AUTOREPLACE done by Makefile, DNE
</pre>
-[[!tag patch]]
+[[!tag patch patch/core]]