blob: 5b469e555638f717e1e8d0e4148c86b349304f35 [file] [log] [blame]
Copybara botbe50d492023-11-30 00:16:42 +01001<?php
2// @description: Program used to upgrade the database after the implementation of issue #39.
3
4require_once(__DIR__."/../core.php");
5
6if (php_sapi_name() != "cli") {
7 security::notFound();
8 exit();
9}
10
11echo "========================\n";
12echo "2_ratelimitingsignin.php\n";
13echo "========================\n\n";
14
15echo "[info] Adding new database schema...\n";
16if (!mysqli_query($con, "CREATE TABLE signinattempts (
17 username VARCHAR(100) NOT NULL,
18 KEY username (username),
19 remoteip VARBINARY(16) NOT NULL,
20 KEY remoteip (remoteip),
21 remoteipblock VARBINARY(16) NOT NULL,
22 KEY remoteipblock (remoteipblock),
23 signinattempttime DATETIME NOT NULL,
24 KEY signinattempttime (signinattempttime)
25)")) die("[fatal error] Couldn't add new database: ".mysqli_error($con)."\n");
26
27echo "[info] Done\n";