parsegame(): Support for saving away sgf copies for debugging
[asr.git] / useradd.pl
blobb9d6f1c889770e05b0a2537288dbdf8d4a03109f
1 #!/usr/bin/perl
3 use strict;
4 use warnings;
5 use ASR;
6 use POSIX qw/strftime/;
7 use Carp qw/cluck/;
8 $SIG{__WARN__} = sub { cluck $_[0] };
10 my $ctx = ASR::Ladder->new;
12 $ctx->header('Adding user');
14 if ($ctx->param('pwd') ne $ctx->{adminpw}) {
15 print $ctx->p('Invalid password.');
16 $ctx->footer;
17 exit;
20 if ($ctx->db_do('INSERT INTO player SET nick=?', {}, $ctx->param('nick'))) {
21 print $ctx->p('KGS nick '.$ctx->param('nick').' added.')
22 } else {
23 print $ctx->p('Insert failed.');
26 $ctx->footer;