aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/CGI.pm
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2010-05-08 15:57:39 -0400
committerJoey Hess <joey@kitenet.net>2010-05-08 15:57:39 -0400
commitc3e9215e1fcb604c3ee01119fdf7cf13724c3812 (patch)
treed52efb71b310fdd70a7f7e2799132605d4fd4391 /IkiWiki/CGI.pm
parentf735e2d1b3ced6dc1e246e61be0256302ff5eb14 (diff)
downloadikiwiki-c3e9215e1fcb604c3ee01119fdf7cf13724c3812.tar
ikiwiki-c3e9215e1fcb604c3ee01119fdf7cf13724c3812.tar.gz
moved non-openid signin form into same page as openid selector; show/hide as buttons are pressed
Diffstat (limited to 'IkiWiki/CGI.pm')
-rw-r--r--IkiWiki/CGI.pm23
1 files changed, 18 insertions, 5 deletions
diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm
index 49a505514..b98e9e0a1 100644
--- a/IkiWiki/CGI.pm
+++ b/IkiWiki/CGI.pm
@@ -22,7 +22,7 @@ sub printheader ($) {
}
}
-sub showform ($$$$;@) {
+sub prepform {
my $form=shift;
my $buttons=shift;
my $session=shift;
@@ -35,6 +35,16 @@ sub showform ($$$$;@) {
});
}
+ return $form;
+}
+
+sub showform ($$$$;@) {
+ my $form=prepform(@_);
+ shift;
+ my $buttons=shift;
+ my $session=shift;
+ my $cgi=shift;
+
printheader($session);
print misctemplate($form->title, $form->render(submit => $buttons), @_);
}
@@ -90,9 +100,10 @@ sub needsignin ($$) {
}
}
-sub cgi_signin ($$) {
+sub cgi_signin ($$;$) {
my $q=shift;
my $session=shift;
+ my $returnhtml=shift;
decode_cgi_utf8($q);
eval q{use CGI::FormBuilder};
@@ -112,9 +123,6 @@ sub cgi_signin ($$) {
);
my $buttons=["Login"];
- if ($q->param("do") ne "signin" && !$form->submitted) {
- $form->text(gettext("You need to log in first."));
- }
$form->field(name => "do", type => "hidden", value => "signin",
force => 1);
@@ -129,6 +137,11 @@ sub cgi_signin ($$) {
$form->validate;
}
+ if ($returnhtml) {
+ $form=prepform($form, $buttons, $session, $q);
+ return $form->render(submit => $buttons);
+ }
+
showform($form, $buttons, $session, $q);
}