20 rows of Implementation IDs.
[irspy-moved-to-github.git] / web / htdocs / offtopic / sru-auth.html
1 %# $Id: sru-auth.html,v 1.1 2007-08-21 09:48:41 mike Exp $
2 <%doc>
3         In order to test the authentication feature of Simple2ZOOM, we
4         need an authenticator script, accessible via HTTP.  The
5         simplest way to provide that is as a simple bit of HTML::Mason
6         running under the conveniently available IRSpy distribution.
7         Since this is only for testing, a hardwired user register is
8         good enough.
9 </%doc>
10 <%args>
11 $user => undef
12 $pass => undef
13 </%args>
14 <%once>
15 our %register = (
16     mike => "fish",
17     simon => "frog 123",
18     admin => "Tom&jErry",
19 );
20 </%once>
21 <%perl>
22 if (defined $user && defined $pass && $register{$user} eq $pass) {
23     print "OK\n";
24     return;
25 } else {
26     $m->clear_buffer;
27     $m->abort(401); # "Authorization Required"
28 }
29 </%perl>