X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/8fa8bd0adb034f05131648dcb7b14011672649e8..07a1796d3bf52bca9a325cf517f742ff44b49921:/IkiWiki.pm diff --git a/IkiWiki.pm b/IkiWiki.pm index 73280abf1..a0b902794 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -69,15 +69,16 @@ sub defaultconfig () { #{{{ setup => undef, adminuser => undef, adminemail => undef, - plugin => [qw{mdwn inline htmlscrubber passwordauth signinedit + plugin => [qw{mdwn inline htmlscrubber passwordauth openid signinedit lockedit conditional}], timeformat => '%c', locale => undef, sslcookie => 0, httpauth => 0, userdir => "", - usedirs => 0, + usedirs => 1, numbacklinks => 10, + account_creation_password => "", } #}}} sub checkconfig () { #{{{ @@ -178,7 +179,7 @@ sub log_message ($$) { #{{{ $log_open=1; } eval { - Sys::Syslog::syslog($type, "%s", join(" ", @_)); + Sys::Syslog::syslog($type, "[$config{wikiname}] %s", join(" ", @_)); }; } elsif (! $config{cgi}) { @@ -362,8 +363,14 @@ sub bestlink ($$) { #{{{ } } while $cwd=~s!/?[^/]+$!!; - if (length $config{userdir} && exists $links{"$config{userdir}/".lc($link)}) { - return "$config{userdir}/".lc($link); + if (length $config{userdir}) { + my $l = "$config{userdir}/".lc($link); + if (exists $links{$l}) { + return $l; + } + elsif (exists $pagecase{lc $l}) { + return $pagecase{lc $l}; + } } #print STDERR "warning: page $page, broken link: $link\n"; @@ -644,12 +651,14 @@ sub preprocess ($$$;$$) { #{{{ return $content; } #}}} -sub filter ($$) { #{{{ +sub filter ($$$) { #{{{ my $page=shift; + my $destpage=shift; my $content=shift; run_hooks(filter => sub { - $content=shift->(page => $page, content => $content); + $content=shift->(page => $page, destpage => $destpage, + content => $content); }); return $content; @@ -1005,29 +1014,29 @@ sub pagespec_match ($$;@) { #{{{ package IkiWiki::FailReason; -use overload ( - '""' => sub { return ${$_[0]} }, - '0+' => sub { return 0 }, +use overload ( #{{{ + '""' => sub { ${$_[0]} }, + '0+' => sub { 0 }, '!' => sub { bless $_[0], 'IkiWiki::SuccessReason'}, fallback => 1, -); +); #}}} -sub new { +sub new { #{{{ bless \$_[1], $_[0]; -} +} #}}} package IkiWiki::SuccessReason; -use overload ( - '""' => sub { return ${$_[0]} }, - '0+' => sub { return 1 }, +use overload ( #{{{ + '""' => sub { ${$_[0]} }, + '0+' => sub { 1 }, '!' => sub { bless $_[0], 'IkiWiki::FailReason'}, fallback => 1, -); +); #}}} -sub new { +sub new { #{{{ bless \$_[1], $_[0]; -} +}; #}}} package IkiWiki::PageSpec;