[aur-dev] [PATCH 1/3] Remove LastVoted column
This has been introduced by commit aae43d9 (started working on package comments, 2005-03-05) but it seems to be of no practical use. Remove the field to save some space. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de> --- schema/aur-schema.sql | 1 - web/lib/acctfuncs.inc.php | 3 --- web/lib/pkgfuncs.inc.php | 6 ------ web/template/account_details.php | 6 ------ web/template/account_search_results.php | 2 -- web/template/search_accounts_form.php | 1 - 6 files changed, 19 deletions(-) diff --git a/schema/aur-schema.sql b/schema/aur-schema.sql index c01701c..86f7563 100644 --- a/schema/aur-schema.sql +++ b/schema/aur-schema.sql @@ -32,7 +32,6 @@ CREATE TABLE Users ( LangPreference VARCHAR(5) NOT NULL DEFAULT 'en', IRCNick VARCHAR(32) NOT NULL DEFAULT '', PGPKey VARCHAR(40) NULL DEFAULT NULL, - LastVoted BIGINT UNSIGNED NOT NULL DEFAULT 0, LastLogin BIGINT UNSIGNED NOT NULL DEFAULT 0, LastLoginIPAddress INTEGER UNSIGNED NOT NULL DEFAULT 0, InactivityTS BIGINT UNSIGNED NOT NULL DEFAULT 0, diff --git a/web/lib/acctfuncs.inc.php b/web/lib/acctfuncs.inc.php index f705574..0207bbd 100644 --- a/web/lib/acctfuncs.inc.php +++ b/web/lib/acctfuncs.inc.php @@ -373,9 +373,6 @@ function search_results_page($UTYPE,$O=0,$SB="",$U="",$T="", case 'i': $q.= "ORDER BY IRCNick, AccountTypeID "; break; - case 'v': - $q.= "ORDER BY LastVoted, Username "; - break; default: $q.= "ORDER BY Username, AccountTypeID "; break; diff --git a/web/lib/pkgfuncs.inc.php b/web/lib/pkgfuncs.inc.php index 59cc975..5800a26 100644 --- a/web/lib/pkgfuncs.inc.php +++ b/web/lib/pkgfuncs.inc.php @@ -1072,12 +1072,6 @@ function pkg_vote ($atype, $ids, $action=true) { $dbh->exec($q); if ($action) { - $q = "UPDATE Users SET LastVoted = UNIX_TIMESTAMP() "; - $q.= "WHERE ID = $uid"; - $dbh->exec($q); - } - - if ($action) { return array(true, __("Your votes have been cast for the selected packages.")); } else { return array(true, __("Your votes have been removed from the selected packages.")); diff --git a/web/template/account_details.php b/web/template/account_details.php index 680a52e..5ba01d9 100644 --- a/web/template/account_details.php +++ b/web/template/account_details.php @@ -44,12 +44,6 @@ </td> </tr> <tr> - <th><?= __("Last Voted") . ":" ?></th> - <td> - <?= $row["LastVoted"] ? date("Y-m-d", $row["LastVoted"]) : __("Never"); ?> - </td> - </tr> - <tr> <th>Links:</th> <td><ul> <li><a href="<?= get_uri('/packages/'); ?>?K=<?= $row['Username'] ?>&SeB=m"><?= __("View this user's packages") ?></a></li> diff --git a/web/template/account_search_results.php b/web/template/account_search_results.php index ae7c112..bd4ee29 100644 --- a/web/template/account_search_results.php +++ b/web/template/account_search_results.php @@ -13,7 +13,6 @@ else: <th><?= __("Real Name") ?></th> <th><?= __("IRC Nick") ?></th> <th><?= __("PGP Key Fingerprint") ?></th> - <th><?= __("Last Voted") ?></th> <th><?= __("Edit Account") ?></th> </tr> </thead> @@ -42,7 +41,6 @@ else: <td><?php $row["RealName"] ? print htmlspecialchars($row["RealName"],ENT_QUOTES) : print " " ?></td> <td><?php $row["IRCNick"] ? print htmlspecialchars($row["IRCNick"],ENT_QUOTES) : print " " ?></td> <td><?php $row["PGPKey"] ? print html_format_pgp_fingerprint($row["PGPKey"]) : print " " ?></td> - <td><?php $row["LastVoted"] ? print date("Y-m-d", $row["LastVoted"]) : print __("Never") ?></td> <td> <?php if ($UTYPE == "Trusted User" && $row["AccountType"] == "Developer"): diff --git a/web/template/search_accounts_form.php b/web/template/search_accounts_form.php index 202b1aa..d7f54be 100644 --- a/web/template/search_accounts_form.php +++ b/web/template/search_accounts_form.php @@ -57,7 +57,6 @@ <option value="t"><?= __("Account Type"); ?></option> <option value="r"><?= __("Real Name"); ?></option> <option value="i"><?= __("IRC Nick"); ?></option> - <option value="v"><?= __("Last vote"); ?></option> </select> </td> </tr> -- 1.8.5.4
This is only visible to Trusted Users and developers. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de> --- web/template/account_details.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/web/template/account_details.php b/web/template/account_details.php index 5ba01d9..a4e20c9 100644 --- a/web/template/account_details.php +++ b/web/template/account_details.php @@ -43,6 +43,14 @@ <?= $row["InactivityTS"] ? __("Inactive since") . ' ' . date("Y-m-d H:i", $row["InactivityTS"]) : __("Active"); ?> </td> </tr> + <?php if ($atype == "Trusted User" || $atype == "Developer"): ?> + <tr> + <th><?= __("Last Login") . ":" ?></th> + <td> + <?= $row["LastLogin"] ? date("Y-m-d", $row["LastLogin"]) : __("Never"); ?> + </td> + </tr> + <?php endif; ?> <tr> <th>Links:</th> <td><ul> -- 1.8.5.4
Replace the table layout with field sets, labels and CSS formatting. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de> --- web/template/search_accounts_form.php | 120 ++++++++++++++-------------------- 1 file changed, 48 insertions(+), 72 deletions(-) diff --git a/web/template/search_accounts_form.php b/web/template/search_accounts_form.php index d7f54be..3531eb0 100644 --- a/web/template/search_accounts_form.php +++ b/web/template/search_accounts_form.php @@ -1,75 +1,51 @@ <br /> <form action="<?= get_uri('/accounts/'); ?>" method="post"> - <table> - - <tr> - <td align="left"><?= __("Username"); ?>:</td> - <td align="left"> - <input type="text" size="30" maxlength="64" name="U" /> - </td> - </tr> - - <tr> - <td align="left"><?= __("Account Type"); ?>:</td> - <td align="left"> - <select name="T"> - <option value=""><?= __("Any type"); ?></option> - <option value="u"><?= __("Normal user"); ?></option> - <option value="t"><?= __("Trusted user"); ?></option> - <option value="d"><?= __("Developer"); ?></option> - </select> - </td> - </tr> - - <tr> - <td align="left"><?= __("Account Suspended"); ?>:</td> - <td align="left"> - <input type="checkbox" name="S" /> - </td> - </tr> - - <tr> - <td align="left"><?= __("Email Address"); ?>:</td> - <td align="left"> - <input type="text" size="30" maxlength="64" name="E" /> - </td> - </tr> - - <tr> - <td align="left"><?= __("Real Name"); ?>:</td> - <td align="left"> - <input type="text" size="30" maxlength="32" name="R" /> - </td> - </tr> - - <tr> - <td align="left"><?= __("IRC Nick"); ?>:</td> - <td align="left"> - <input type="text" size="30" maxlength="32" name="I" /> - </td> - </tr> - - <tr> - <td align="left"><?= __("Sort by"); ?>:</td> - <td align="left"> - <select name="SB"> - <option value="u"><?= __("Username"); ?></option> - <option value="t"><?= __("Account Type"); ?></option> - <option value="r"><?= __("Real Name"); ?></option> - <option value="i"><?= __("IRC Nick"); ?></option> - </select> - </td> - </tr> - - <tr> - <td> </td> - <td align="left"> - <br /> - <input type="hidden" name="Action" value="SearchAccounts" /> - <input type="submit" class="button" value="<?= __("Search"); ?>" /> - <input type="reset" class="button" value="<?= __("Reset"); ?>" /> - </td> - </tr> - - </table> + <fieldset> + <input type="hidden" name="Action" value="SearchAccounts" /> + </fieldset> + <fieldset> + <p> + <label for="id_username"><?= __("Username"); ?>:</label> + <input type="text" size="30" maxlength="64" name="U" id="id_username" /> + </p> + <p> + <label for="id_type"><?= __("Account Type"); ?>:</label> + <select name="T" id="id_type"> + <option value=""><?= __("Any type"); ?></option> + <option value="u"><?= __("Normal user"); ?></option> + <option value="t"><?= __("Trusted user"); ?></option> + <option value="d"><?= __("Developer"); ?></option> + </select> + </p> + <p> + <label for="id_suspended"><?= __("Account Suspended"); ?>:</label> + <input type="checkbox" name="S" id="id_suspended" /> + </p> + <p> + <label for="id_email"><?= __("Email Address"); ?>:</label> + <input type="text" size="30" maxlength="64" name="E" id="id_email" /> + </p> + <p> + <label for="id_realname"><?= __("Real Name"); ?>:</label> + <input type="text" size="30" maxlength="32" name="R" id="id_realname" /> + </p> + <p> + <label for="id_irc"><?= __("IRC Nick"); ?>:</label> + <input type="text" size="30" maxlength="32" name="I" id="id_irc" /> + </p> + <p> + <label for="id_sortby"><?= __("Sort by"); ?>:</label> + <select name="SB" id="id_sortby"> + <option value="u"><?= __("Username"); ?></option> + <option value="t"><?= __("Account Type"); ?></option> + <option value="r"><?= __("Real Name"); ?></option> + <option value="i"><?= __("IRC Nick"); ?></option> + </select> + </p> + <p> + <label></label> + <input type="submit" class="button" value="<?= __("Search"); ?>" /> + <input type="reset" class="button" value="<?= __("Reset"); ?>" /> + </p> + </fieldset> </form> -- 1.8.5.4
participants (1)
-
Lukas Fleischer