+# Check if the user is signed in. If not, redirect to the signin form and
+# save their place to return to later.
+sub needsignin ($$) { #{{{
+ my $q=shift;
+ my $session=shift;
+
+ if (! defined $session->param("name") ||
+ ! userinfo_get($session->param("name"), "regdate")) {
+ if (! defined $session->param("postsignin")) {
+ $session->param(postsignin => $ENV{QUERY_STRING});
+ }
+ cgi_signin($q, $session);
+ cgi_savesession($session);
+ exit;
+ }
+} #}}}
+