X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/12c5786df4e74c143f24398b8d0028000b61daba..b7d7abf2b490b1b599f318358dc2d299bef179af:/IkiWiki.pm?ds=inline diff --git a/IkiWiki.pm b/IkiWiki.pm index ad41215c1..241a7c036 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -13,7 +13,8 @@ use open qw{:utf8 :std}; use vars qw{%config %links %oldlinks %pagemtime %pagectime %pagecase %pagestate %renderedfiles %oldrenderedfiles %pagesources - %destsources %depends %hooks %forcerebuild $gettext_obj}; + %destsources %depends %hooks %forcerebuild $gettext_obj + %loaded_plugins}; use Exporter q{import}; our @EXPORT = qw(hook debug error template htmlpage add_depends pagespec_match @@ -115,7 +116,7 @@ sub getsetup () { #{{{ openid signinedit lockedit conditional recentchanges parentlinks}], description => "plugins to enable by default", - safe => 1, + safe => 0, rebuild => 1, }, add_plugins => { @@ -284,6 +285,13 @@ sub getsetup () { #{{{ safe => 0, # regexp rebuild => 1, }, + banned_users => { + type => "string", + default => [], + description => "users who cannot use the wiki", + safe => 1, + rebuild => 0, + }, wiki_file_prune_regexps => { type => "internal", default => [qr/(^|\/)\.\.(\/|$)/, qr/^\./, qr/\/\./, @@ -412,13 +420,6 @@ sub checkconfig () { #{{{ $config{wikistatedir}="$config{srcdir}/.ikiwiki" unless exists $config{wikistatedir}; - - if ($config{rcs}) { - loadplugin($config{rcs}); - } - else { - loadplugin("norcs"); - } if (defined $config{umask}) { umask(possibly_foolish_untaint($config{umask})); @@ -455,6 +456,16 @@ sub loadplugins () { #{{{ } loadplugin($_) foreach @{$config{default_plugins}}, @{$config{add_plugins}}; + + if ($config{rcs}) { + if (exists $IkiWiki::hooks{rcs}) { + error(gettext("cannot use multiple rcs plugins")); + } + loadplugin($config{rcs}); + } + if (! exists $IkiWiki::hooks{rcs}) { + loadplugin("norcs"); + } run_hooks(getopt => sub { shift->() }); if (grep /^-/, @ARGV) { @@ -476,6 +487,7 @@ sub loadplugin ($) { #{{{ if (defined $dir && -x "$dir/plugins/$plugin") { require IkiWiki::Plugin::external; import IkiWiki::Plugin::external "$dir/plugins/$plugin"; + $loaded_plugins{$plugin}=1; return 1; } } @@ -485,6 +497,7 @@ sub loadplugin ($) { #{{{ if ($@) { error("Failed to load plugin $mod: $@"); } + $loaded_plugins{$plugin}=1; return 1; } #}}}