}
my $section=defined $plugin
- ? sprintf(gettext("%s plugin:"), $plugininfo{section}).$plugin
+ ? sprintf(gettext("%s plugin:"), $plugininfo{section})." ".$plugin
: "main";
my %enabledfields;
my $shownfields=0;
sub disable_plugin ($) {
my $plugin=shift;
- if (grep { $_ eq $plugin } @{$config{add_plugins}}) {
- $config{add_plugins}=[grep { $_ ne $plugin } @{$config{add_plugins}}];
- }
- else {
- push @{$config{disable_plugins}}, $plugin;
- }
+ $config{add_plugins}=[grep { $_ ne $plugin } @{$config{add_plugins}}];
+ push @{$config{disable_plugins}}, $plugin;
}
sub showform ($$) {
my $cgi=shift;
my $session=shift;
+ IkiWiki::needsignin($cgi, $session);
+
if (! defined $session->param("name") ||
! IkiWiki::is_admin($session->param("name"))) {
error(gettext("you are not logged in as an admin"));
],
action => $config{cgiurl},
template => {type => 'div'},
- stylesheet => IkiWiki::baseurl()."style.css",
+ stylesheet => 1,
);
$form->field(name => "do", type => "hidden", value => "setup",
IkiWiki::unlockwiki();
# Print the top part of a standard misctemplate,
- # then show the rebuild or refresh.
- my $divider="xxx";
+ # then show the rebuild or refresh, live.
+ my $divider="\0";
my $html=IkiWiki::misctemplate("setup", $divider);
IkiWiki::printheader($session);
my ($head, $tail)=split($divider, $html, 2);
my %params=@_;
my $form=$params{form};
- if ($form->title eq "preferences") {
- push @{$params{buttons}}, "Wiki Setup";
- if ($form->submitted && $form->submitted eq "Wiki Setup") {
+ if ($form->title eq "preferences" &&
+ IkiWiki::is_admin($params{session}->param("name"))) {
+ push @{$params{buttons}}, "Setup";
+ if ($form->submitted && $form->submitted eq "Setup") {
showform($params{cgi}, $params{session});
exit;
}