-sub match_creation_year ($$$) { #{{{
- return ((gmtime($IkiWiki::pagectime{shift()}))[5] + 1900 == shift);
+sub match_creation_year ($$;@) { #{{{
+ if ((gmtime($IkiWiki::pagectime{shift()}))[5] + 1900 == shift) {
+ return IkiWiki::SuccessReason->new("creation_year matched");
+ }
+ else {
+ return IkiWiki::FailReason->new("creation_year did not match");
+ }
+} #}}}
+
+sub match_user ($$;@) { #{{{
+ shift;
+ my $user=shift;
+ my %params=@_;
+
+ return IkiWiki::FailReason->new("cannot match user") unless exists $params{user};
+ if ($user eq $params{user}) {
+ return IkiWiki::SuccessReason->new("user is $user")
+ }
+ else {
+ return IkiWiki::FailReason->new("user is not $user");
+ }