Support long email addresses

According to RFC 3696 (and the associated errata), an email address can
be up to 256 characters long. Change the database field and the length
limit on all input fields accordingly.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
Lukas Fleischer 2015-10-25 10:52:30 +01:00
parent f9ac67f691
commit d52b2f50b9
4 changed files with 9 additions and 3 deletions

View file

@ -25,7 +25,7 @@ CREATE TABLE Users (
AccountTypeID TINYINT UNSIGNED NOT NULL DEFAULT 1,
Suspended TINYINT UNSIGNED NOT NULL DEFAULT 0,
Username VARCHAR(32) NOT NULL,
Email VARCHAR(64) NOT NULL,
Email VARCHAR(256) NOT NULL,
HideEmail TINYINT UNSIGNED NOT NULL DEFAULT 0,
Passwd CHAR(32) NOT NULL,
Salt CHAR(32) NOT NULL DEFAULT '',

View file

@ -9,3 +9,9 @@ CREATE TABLE OfficialProviders (
) ENGINE = InnoDB;
CREATE UNIQUE INDEX ProviderNameProvides ON OfficialProviders (Name, Provides);
----
2. Resize the email address field:
----
ALTER TABLE Users MODIFY Email VARCHAR(256) NOT NULL;
----

View file

@ -29,7 +29,7 @@ html_header('AUR ' . __("Login"));
<?php endif; ?>
<p>
<label for="id_username"><?= __('User name or email address') . ':'; ?></label>
<input id="id_username" type="text" name="user" size="30" maxlength="<?= config_get_int('options', 'username_max_len'); ?>" value="<?php if (isset($_POST['user'])) { print htmlspecialchars($_POST['user'], ENT_QUOTES); } ?>" autofocus="autofocus" />
<input id="id_username" type="text" name="user" size="30" maxlength="<?= max(config_get_int('options', 'username_max_len'), 256); ?>" value="<?php if (isset($_POST['user'])) { print htmlspecialchars($_POST['user'], ENT_QUOTES); } ?>" autofocus="autofocus" />
</p>
<p>
<label for="id_password"><?= __('Password') . ':'; ?></label>

View file

@ -69,7 +69,7 @@
<p>
<label for="id_email"><?= __("Email Address") ?>:</label>
<input type="text" size="30" maxlength="64" name="E" id="id_email" value="<?= htmlspecialchars($E,ENT_QUOTES) ?>" /> (<?= __("required") ?>)
<input type="text" size="30" maxlength="256" name="E" id="id_email" value="<?= htmlspecialchars($E,ENT_QUOTES) ?>" /> (<?= __("required") ?>)
</p>
<p>