X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/7da971f722850fb657576e7bb791d3b8fa604072..a42de69fbb3e775dd407d24bf90534a07219710a:/doc/todo/blogpost_plugin.mdwn?ds=sidebyside diff --git a/doc/todo/blogpost_plugin.mdwn b/doc/todo/blogpost_plugin.mdwn index e91263f15..69df27271 100644 --- a/doc/todo/blogpost_plugin.mdwn +++ b/doc/todo/blogpost_plugin.mdwn @@ -51,13 +51,13 @@ Index: IkiWiki/Plugin/blogpost.pm +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'; + } @@ -72,9 +72,9 @@ Index: IkiWiki/Plugin/blogpost.pm + if (! defined $config{blogusers}) { + $config{blogusers} = (); # disallow all posting by default + } -+} #}}} ++} + -+sub authcgi ($$) { #{{{ ++sub authcgi ($$) { + my $cgi=shift; + my $session=shift; + @@ -115,28 +115,28 @@ Index: IkiWiki/Plugin/blogpost.pm + $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 "" unless pagespec_match($page, $config{blogpagespec}); ++ return undef unless pagespec_match($page, $config{blogpagespec}); + my $user=$session->param("name"); + IkiWiki::needsignin($cgi, $session) unless defined $user; + + return "" if ($config{blogusers} eq "*" || + grep {$_ eq $user} $config{blogusers}); + return ("not allowed to blog, $user"); -+} #}}} ++} + +1 Index: IkiWiki.pm @@ -151,4 +151,6 @@ Index: IkiWiki.pm %config %links %renderedfiles %pagesources %destsources); our $VERSION = 2.00; # plugin interface version, next is ikiwiki version our $version='unknown'; # VERSION_AUTOREPLACE done by Makefile, DNE - \ No newline at end of file + + +[[!tag patch patch/core]]