+
+sub check_banned ($$) { #{{{
+ my $q=shift;
+ my $session=shift;
+
+ my $name=$session->param("name");
+ if (defined $name) {
+ # XXX banned in userinfo is deprecated, should be removed
+ # eventually, and only banned_users be checked.
+ if (userinfo_get($session->param("name"), "banned") ||
+ grep { $name eq $_ } @{$config{banned_users}}) {
+ print $q->header(-status => "403 Forbidden");
+ $session->delete();
+ print gettext("You are banned.");
+ cgi_savesession($session);
+ exit;
+ }
+ }
+}