X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/54f600af14bf6dc067ffc30ec6f22d517001fe99..8496dd9fb405eda149995615ead0a94a83298b91:/IkiWiki/Plugin/websetup.pm diff --git a/IkiWiki/Plugin/websetup.pm b/IkiWiki/Plugin/websetup.pm index d444c0a3d..c4b75c4b3 100644 --- a/IkiWiki/Plugin/websetup.pm +++ b/IkiWiki/Plugin/websetup.pm @@ -102,7 +102,7 @@ sub showfields ($$$@) { } my $section=defined $plugin - ? sprintf(gettext("%s plugin:"), $plugininfo{section}).$plugin + ? sprintf(gettext("%s plugin:"), $plugininfo{section})." ".$plugin : "main"; my %enabledfields; my $shownfields=0; @@ -265,6 +265,8 @@ 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")); @@ -291,7 +293,7 @@ sub showform ($$) { ], action => $config{cgiurl}, template => {type => 'div'}, - stylesheet => IkiWiki::baseurl()."style.css", + stylesheet => 1, ); $form->field(name => "do", type => "hidden", value => "setup", @@ -448,8 +450,8 @@ sub showform ($$) { 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); @@ -501,9 +503,10 @@ sub formbuilder_setup (@) { 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; }