11 my $dbh = DBI->connect($remoteglotconf::dbistr, $remoteglotconf::dbiuser, $remoteglotconf::dbipass)
13 $dbh->{RaiseError} = 1;
16 my $password = Encode::decode_utf8($cgi->param('password'));
17 if (!defined($password) || $password ne $remoteglotconf::adminpass) {
18 print CGI->header(-type=>'text/plain; charset=utf-8', -status=>'403 Denied');
23 $dbh->do('INSERT INTO game_extensions ( fen, history, player_w, player_b, ts, next_move ) VALUES ( ?, ?, ?, ?, CURRENT_TIMESTAMP, ? )',
25 Encode::decode_utf8($cgi->param('fen')),
26 Encode::decode_utf8($cgi->param('history')),
27 Encode::decode_utf8($cgi->param('player_w')),
28 Encode::decode_utf8($cgi->param('player_b')),
29 Encode::decode_utf8($cgi->param('move')));
30 system("sudo", "touch", $remoteglotconf::json_output);
32 print CGI->header(-type=>'text/plain; charset=utf-8');