summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@archlinux.org>2016-03-13 13:17:15 +0100
committerLukas Fleischer <lfleischer@archlinux.org>2016-03-13 13:17:15 +0100
commit3ec3dfb6aa7464a9220a75592d6246ac931c0ff1 (patch)
treebef4d6dab9f6f45ba287ac784b1d0bfa8ff94739
parent2dfa72131bfbc96584b78b597f86471874108a89 (diff)
parent32c8d0c3f837950518f886ed9baef00e98740049 (diff)
downloadaurweb-3ec3dfb6aa7464a9220a75592d6246ac931c0ff1.tar.xz
Merge branch 'maint'
-rw-r--r--schema/aur-schema.sql2
-rw-r--r--upgrading/4.2.1.txt5
-rw-r--r--web/lib/acctfuncs.inc.php4
-rw-r--r--web/template/stats/updates_table.php2
4 files changed, 9 insertions, 4 deletions
diff --git a/schema/aur-schema.sql b/schema/aur-schema.sql
index 1a141c1..aa5ed9d 100644
--- a/schema/aur-schema.sql
+++ b/schema/aur-schema.sql
@@ -35,7 +35,7 @@ CREATE TABLE Users (
IRCNick VARCHAR(32) NOT NULL DEFAULT '',
PGPKey VARCHAR(40) NULL DEFAULT NULL,
LastLogin BIGINT UNSIGNED NOT NULL DEFAULT 0,
- LastLoginIPAddress INTEGER UNSIGNED NOT NULL DEFAULT 0,
+ LastLoginIPAddress VARCHAR(40) NULL DEFAULT NULL,
InactivityTS BIGINT UNSIGNED NOT NULL DEFAULT 0,
RegistrationTS TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
CommentNotify TINYINT(1) NOT NULL DEFAULT 1,
diff --git a/upgrading/4.2.1.txt b/upgrading/4.2.1.txt
new file mode 100644
index 0000000..83c8d46
--- /dev/null
+++ b/upgrading/4.2.1.txt
@@ -0,0 +1,5 @@
+1. Convert the LastLoginIPAddress column to VARCHAR(40):
+
+----
+ALTER TABLE Users MODIFY LastLoginIPAddress VARCHAR(40) NULL DEFAULT NULL;
+----
diff --git a/web/lib/acctfuncs.inc.php b/web/lib/acctfuncs.inc.php
index be0981f..0eb021e 100644
--- a/web/lib/acctfuncs.inc.php
+++ b/web/lib/acctfuncs.inc.php
@@ -557,8 +557,8 @@ function try_login() {
}
$q = "UPDATE Users SET LastLogin = UNIX_TIMESTAMP(), ";
- $q.= "LastLoginIPAddress = " . $dbh->quote(ip2long($_SERVER['REMOTE_ADDR'])) . " ";
- $q.= "WHERE ID = '$userID'";
+ $q.= "LastLoginIPAddress = " . $dbh->quote($_SERVER['REMOTE_ADDR']) . " ";
+ $q.= "WHERE ID = $userID";
$dbh->exec($q);
/* Set the SID cookie. */
diff --git a/web/template/stats/updates_table.php b/web/template/stats/updates_table.php
index 4e2d39d..580583b 100644
--- a/web/template/stats/updates_table.php
+++ b/web/template/stats/updates_table.php
@@ -1,4 +1,4 @@
-<h3><?= __("Recent Updates") ?> <span class="more">(<a href="<?= get_uri('/packages/') ?>?SB=l&amp;SO=d"><?= _('more') ?></a>)</span></h3>
+<h3><?= __("Recent Updates") ?> <span class="more">(<a href="<?= get_uri('/packages/') ?>?SB=l&amp;SO=d"><?= __('more') ?></a>)</span></h3>
<a href="<?= get_uri('/rss/') ?>" title="Arch Package Updates RSS Feed" class="rss-icon"><img src="/images/rss.svg" alt="RSS Feed" /></a>