From 608c48309084e4048d8226c3f7e363b240248040 Mon Sep 17 00:00:00 2001 From: Mark Weiman Date: Fri, 20 Jan 2017 01:16:39 -0500 Subject: Add user set timezones Currently, aurweb displays all dates and times in UTC time. This patch adds a capability for each logged in user to set their preferred timezone. Implements FS#48729. Signed-off-by: Mark Weiman Signed-off-by: Lukas Fleischer --- web/html/account.php | 3 +++ web/html/register.php | 2 ++ web/html/voters.php | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) (limited to 'web/html') diff --git a/web/html/account.php b/web/html/account.php index 2892f046..91e57038 100644 --- a/web/html/account.php +++ b/web/html/account.php @@ -34,6 +34,7 @@ if ($action == "UpdateAccount") { in_request("U"), in_request("T"), in_request("S"), in_request("E"), in_request("H"), in_request("P"), in_request("C"), in_request("R"), in_request("L"), + in_request("TZ"), in_request("HP"), in_request("I"), in_request("K"), in_request("PK"), in_request("J"), in_request("CN"), in_request("UN"), in_request("ON"), in_request("ID"), @@ -89,6 +90,7 @@ if (isset($_COOKIE["AURSID"])) { "", $row["RealName"], $row["LangPreference"], + $row["Timezone"], $row["Homepage"], $row["IRCNick"], $row["PGPKey"], @@ -141,6 +143,7 @@ if (isset($_COOKIE["AURSID"])) { in_request("C"), in_request("R"), in_request("L"), + in_request("TZ"), in_request("HP"), in_request("I"), in_request("K"), diff --git a/web/html/register.php b/web/html/register.php index 6c6d52e6..843fea97 100644 --- a/web/html/register.php +++ b/web/html/register.php @@ -31,6 +31,7 @@ if (in_request("Action") == "NewAccount") { '', in_request("R"), in_request("L"), + in_request("TZ"), in_request("HP"), in_request("I"), in_request("K"), @@ -53,6 +54,7 @@ if (in_request("Action") == "NewAccount") { '', in_request("R"), in_request("L"), + in_request("TZ"), in_request("HP"), in_request("I"), in_request("K"), diff --git a/web/html/voters.php b/web/html/voters.php index 8833be1e..997186d8 100644 --- a/web/html/voters.php +++ b/web/html/voters.php @@ -20,7 +20,7 @@ if (has_credential(CRED_PKGBASE_LIST_VOTERS)):
  • 0): ?> - () + ()
  • -- cgit v1.2.3-24-g4f1b From fc2ecff949ced53849e0ae10923d02d74b895c32 Mon Sep 17 00:00:00 2001 From: Mark Weiman Date: Fri, 20 Jan 2017 01:16:41 -0500 Subject: account.php: Reformat process_account_form() call Modify the call to process_account_form() to only having one parameter per line. Signed-off-by: Mark Weiman Signed-off-by: Lukas Fleischer --- web/html/account.php | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'web/html') diff --git a/web/html/account.php b/web/html/account.php index 91e57038..0b757612 100644 --- a/web/html/account.php +++ b/web/html/account.php @@ -31,13 +31,25 @@ if ($action == "UpdateAccount") { /* Update the details for the existing account */ list($success, $update_account_message) = process_account_form( "edit", "UpdateAccount", - in_request("U"), in_request("T"), in_request("S"), - in_request("E"), in_request("H"), in_request("P"), - in_request("C"), in_request("R"), in_request("L"), + in_request("U"), + in_request("T"), + in_request("S"), + in_request("E"), + in_request("H"), + in_request("P"), + in_request("C"), + in_request("R"), + in_request("L"), in_request("TZ"), - in_request("HP"), in_request("I"), in_request("K"), - in_request("PK"), in_request("J"), in_request("CN"), - in_request("UN"), in_request("ON"), in_request("ID"), + in_request("HP"), + in_request("I"), + in_request("K"), + in_request("PK"), + in_request("J"), + in_request("CN"), + in_request("UN"), + in_request("ON"), + in_request("ID"), $row["Username"]); } } -- cgit v1.2.3-24-g4f1b From ac745f656d4c8d19cdcf8d843d6855c6b45a3974 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Fri, 3 Feb 2017 23:52:31 +0100 Subject: Split out the search form from pkg_search_page() This makes it easier to display search results without showing the search form. Signed-off-by: Lukas Fleischer --- web/html/packages.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'web/html') diff --git a/web/html/packages.php b/web/html/packages.php index 1b892781..8fd3266a 100644 --- a/web/html/packages.php +++ b/web/html/packages.php @@ -80,8 +80,9 @@ $(document).ready(function() { Date: Sat, 4 Feb 2017 00:04:22 +0100 Subject: Refactor pkg_search_page() * Pass search parameters using an associative array instead of $_GET. * Add a boolean parameter to enable and disable headers/footers. Signed-off-by: Lukas Fleischer --- web/html/packages.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'web/html') diff --git a/web/html/packages.php b/web/html/packages.php index 8fd3266a..ec6fc757 100644 --- a/web/html/packages.php +++ b/web/html/packages.php @@ -99,9 +99,9 @@ if (isset($pkgid)) { $_GET['SO'] = 'd'; } if (isset($_COOKIE["AURSID"])) { - pkg_search_page($_COOKIE["AURSID"]); + pkg_search_page($_GET, true, $_COOKIE["AURSID"]); } else { - pkg_search_page(); + pkg_search_page($_GET, true); } } -- cgit v1.2.3-24-g4f1b From b6aced9692dae4145b8848fb1da495901434a667 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Sat, 4 Feb 2017 00:28:37 +0100 Subject: pkg_search_results.php: Split out package results box Do not print the wrapper div container when calling pkg_search_page(). Signed-off-by: Lukas Fleischer --- web/html/packages.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'web/html') diff --git a/web/html/packages.php b/web/html/packages.php index ec6fc757..113a1145 100644 --- a/web/html/packages.php +++ b/web/html/packages.php @@ -98,11 +98,13 @@ if (isset($pkgid)) { $_GET['SB'] = 'p'; $_GET['SO'] = 'd'; } + echo '
    '; if (isset($_COOKIE["AURSID"])) { pkg_search_page($_GET, true, $_COOKIE["AURSID"]); } else { pkg_search_page($_GET, true); } + echo '
    '; } html_footer(AURWEB_VERSION); -- cgit v1.2.3-24-g4f1b From 1049f9319131d7f6ffea6c1863739c39e3b30a8f Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Sat, 4 Feb 2017 00:13:09 +0100 Subject: Add dashboard For logged in users, the home page is replaced with an overview of the packages the user maintains or co-maintains. Signed-off-by: Lukas Fleischer --- web/html/home.php | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) (limited to 'web/html') diff --git a/web/html/home.php b/web/html/home.php index 475370bb..ff9caa7c 100644 --- a/web/html/home.php +++ b/web/html/home.php @@ -8,13 +8,42 @@ check_sid(); include_once('stats.inc.php'); -html_header( __("Home") ); +if (isset($_COOKIE["AURSID"])) { + html_header( __("Dashboard") ); +} else { + html_header( __("Home") ); +} ?>
    + +

    +

    + 50, + 'SeB' => 'm', + 'K' => username_from_sid($_COOKIE["AURSID"]), + 'SB' => 'l', + 'SO' => 'd' + ); + pkg_search_page($params, false, $_COOKIE["AURSID"]); + ?> +

    + 50, + 'SeB' => 'c', + 'K' => username_from_sid($_COOKIE["AURSID"]), + 'SB' => 'l', + 'SO' => 'd' + ); + pkg_search_page($params, false, $_COOKIE["AURSID"]); + ?> +

    AUR

    +
    +

    @@ -122,6 +153,7 @@ html_header( __("Home") );

    +
    @@ -140,7 +172,7 @@ html_header( __("Home") );
    - +
    -- cgit v1.2.3-24-g4f1b From a1890d400b2eefeaf20c80701951af6b2a8ff55e Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Sat, 4 Feb 2017 11:04:26 +0100 Subject: Add links to all owned packages to the dashboard In addition to showing the 50 most recent maintained and co-maintained packages, add links to all packages one owns or co-maintains. Signed-off-by: Lukas Fleischer --- web/html/home.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'web/html') diff --git a/web/html/home.php b/web/html/home.php index ff9caa7c..08ae59f6 100644 --- a/web/html/home.php +++ b/web/html/home.php @@ -21,7 +21,7 @@ if (isset($_COOKIE["AURSID"])) {

    -

    +

    (">)

    50, @@ -32,7 +32,7 @@ if (isset($_COOKIE["AURSID"])) { ); pkg_search_page($params, false, $_COOKIE["AURSID"]); ?> -

    +

    (">)

    50, -- cgit v1.2.3-24-g4f1b From d45585e36d6cbd9483f4a5b18cbbc346757ca6a0 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Tue, 7 Feb 2017 08:20:34 +0100 Subject: Add flagged packages to the dashboard Implement a table that shows all packages which are flagged out-of-date and either maintained or co-maintained by the currently logged in user. Signed-off-by: Lukas Fleischer --- web/html/home.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'web/html') diff --git a/web/html/home.php b/web/html/home.php index 08ae59f6..62409af7 100644 --- a/web/html/home.php +++ b/web/html/home.php @@ -21,6 +21,18 @@ if (isset($_COOKIE["AURSID"])) {

    +

    + 50, + 'SeB' => 'M', + 'K' => username_from_sid($_COOKIE["AURSID"]), + 'outdated' => 'on', + 'SB' => 'l', + 'SO' => 'a' + ); + pkg_search_page($params, false, $_COOKIE["AURSID"]); + ?>

    (">)

    Date: Tue, 7 Feb 2017 08:29:53 +0100 Subject: pkgreq_results.php: Split out package results box Do not include the wrapper div container in the template. Signed-off-by: Lukas Fleischer --- web/html/pkgreq.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'web/html') diff --git a/web/html/pkgreq.php b/web/html/pkgreq.php index 8348a4f3..e0ef6cfd 100644 --- a/web/html/pkgreq.php +++ b/web/html/pkgreq.php @@ -77,7 +77,9 @@ if (isset($base_id)) { $SID = $_COOKIE['AURSID']; html_header(__("Requests")); + echo '
    '; include('pkgreq_results.php'); + echo '
    '; } html_footer(AURWEB_VERSION); -- cgit v1.2.3-24-g4f1b From 403241baa34c75ed4942926cf667094f6036b773 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Tue, 7 Feb 2017 08:44:14 +0100 Subject: pkgreq_results.php: Add a flag to hide headers Introduce a new boolean flag that can be used to disable extended headers, pagination and forms. Signed-off-by: Lukas Fleischer --- web/html/pkgreq.php | 1 + 1 file changed, 1 insertion(+) (limited to 'web/html') diff --git a/web/html/pkgreq.php b/web/html/pkgreq.php index e0ef6cfd..f981c25d 100644 --- a/web/html/pkgreq.php +++ b/web/html/pkgreq.php @@ -78,6 +78,7 @@ if (isset($base_id)) { html_header(__("Requests")); echo '
    '; + $show_headers = true; include('pkgreq_results.php'); echo '
    '; } -- cgit v1.2.3-24-g4f1b From 2bc208c13e3a48980e295bd0b444c99ada163865 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Tue, 7 Feb 2017 08:51:15 +0100 Subject: Add requests to dashboard Add a new table which shows all package requests affecting the currently logged in user. Signed-off-by: Lukas Fleischer --- web/html/home.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'web/html') diff --git a/web/html/home.php b/web/html/home.php index 62409af7..381cb71f 100644 --- a/web/html/home.php +++ b/web/html/home.php @@ -33,6 +33,12 @@ if (isset($_COOKIE["AURSID"])) { ); pkg_search_page($params, false, $_COOKIE["AURSID"]); ?> +

    +

    (">)

    Date: Tue, 7 Feb 2017 08:54:50 +0100 Subject: Move my packages to separate dashboard sections Signed-off-by: Lukas Fleischer --- web/html/home.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'web/html') diff --git a/web/html/home.php b/web/html/home.php index 381cb71f..16525419 100644 --- a/web/html/home.php +++ b/web/html/home.php @@ -18,8 +18,8 @@ if (isset($_COOKIE["AURSID"])) {
    +
    -

    -

    (">)

    +
    +
    +

    (">)

    50, @@ -50,7 +52,9 @@ if (isset($_COOKIE["AURSID"])) { ); pkg_search_page($params, false, $_COOKIE["AURSID"]); ?> -

    (">)

    +
    +
    +

    (">)

    50, @@ -61,7 +65,9 @@ if (isset($_COOKIE["AURSID"])) { ); pkg_search_page($params, false, $_COOKIE["AURSID"]); ?> - +
    + +

    AUR

    -
    -

    -- cgit v1.2.3-24-g4f1b From 3a167a109b240ef7c8c2fa7363156456c6861521 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Sat, 11 Feb 2017 22:21:03 +0100 Subject: Move package search links on the dashboard Move the package search links below the section headings. Signed-off-by: Lukas Fleischer --- web/html/home.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'web/html') diff --git a/web/html/home.php b/web/html/home.php index 16525419..ee7caf77 100644 --- a/web/html/home.php +++ b/web/html/home.php @@ -41,7 +41,8 @@ if (isset($_COOKIE["AURSID"])) { ?>
    -

    (">)

    +

    +

    ">

    50, @@ -54,7 +55,8 @@ if (isset($_COOKIE["AURSID"])) { ?>
    -

    (">)

    +

    +

    ">

    50, -- cgit v1.2.3-24-g4f1b From 92049e8061d71dfe89b4cbd53a39d7ae74ac328a Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Wed, 15 Feb 2017 07:20:50 +0100 Subject: Hide old requests from the dashboard Only show package requests created less than 6 months ago on the dashboard. Signed-off-by: Lukas Fleischer --- web/html/home.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'web/html') diff --git a/web/html/home.php b/web/html/home.php index ee7caf77..26754916 100644 --- a/web/html/home.php +++ b/web/html/home.php @@ -35,7 +35,9 @@ if (isset($_COOKIE["AURSID"])) { ?>

    -- cgit v1.2.3-24-g4f1b From e724b123ec003aab4a24ace4e7eea934a6dad395 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Wed, 15 Feb 2017 21:59:20 +0100 Subject: pkgbase.php: Add default title Instead of triggering a PHP warning and using an empty title if no package base is specified, use a default title. Signed-off-by: Lukas Fleischer --- web/html/pkgbase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'web/html') diff --git a/web/html/pkgbase.php b/web/html/pkgbase.php index 11fdf74a..23aa6c83 100644 --- a/web/html/pkgbase.php +++ b/web/html/pkgbase.php @@ -30,7 +30,7 @@ if (!isset($base_id) || !isset($pkgbase_name)) { } /* Set the title to package base name. */ -$title = $pkgbase_name; +$title = isset($pkgbase_name) ? $pkgbase_name : __("Package Bases"); /* Grab the list of package base IDs to be operated on. */ $ids = array(); -- cgit v1.2.3-24-g4f1b From 5059056567161d616496a015804094371bfb5b48 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Wed, 15 Feb 2017 22:05:03 +0100 Subject: Fix several PHP short open tags Use " --- web/html/pkgdel.php | 2 +- web/html/pkgdisown.php | 2 +- web/html/pkgflag.php | 2 +- web/html/pkgmerge.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'web/html') diff --git a/web/html/pkgdel.php b/web/html/pkgdel.php index 21a2677c..591ccce8 100644 --- a/web/html/pkgdel.php +++ b/web/html/pkgdel.php @@ -12,7 +12,7 @@ html_header(__("Package Deletion")); if (has_credential(CRED_PKGBASE_DELETE)): ?>
    -

    :

    +

    :

    ', htmlspecialchars($pkgbase_name), ''); ?> diff --git a/web/html/pkgdisown.php b/web/html/pkgdisown.php index f24a2d6d..036fe6d8 100644 --- a/web/html/pkgdisown.php +++ b/web/html/pkgdisown.php @@ -15,7 +15,7 @@ $comaintainers = pkgbase_get_comaintainers($base_id); if (has_credential(CRED_PKGBASE_DISOWN, $maintainer_uids)): ?>

    -

    :

    +

    :

    ', htmlspecialchars($pkgbase_name), ''); ?> diff --git a/web/html/pkgflag.php b/web/html/pkgflag.php index f50c2085..44849d88 100644 --- a/web/html/pkgflag.php +++ b/web/html/pkgflag.php @@ -43,7 +43,7 @@ html_header(__("Flag Package Out-Of-Date")); if (has_credential(CRED_PKGBASE_FLAG)): ?>

    -

    :

    +

    :

    ', htmlspecialchars($pkgbase_name), ''); ?> diff --git a/web/html/pkgmerge.php b/web/html/pkgmerge.php index c0ce655c..e8e7ca93 100644 --- a/web/html/pkgmerge.php +++ b/web/html/pkgmerge.php @@ -12,7 +12,7 @@ html_header(__("Package Merging")); if (has_credential(CRED_PKGBASE_DELETE)): ?>

    -

    :

    +

    :

    ', htmlspecialchars($pkgbase_name), ''); ?> -- cgit v1.2.3-24-g4f1b From 29a48708bb7c3e00e80275a6b898f557f63dff69 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Fri, 24 Feb 2017 19:52:28 +0100 Subject: Use bcrypt to hash passwords Replace the default hash function used for storing passwords by password_hash() which internally uses bcrypt. Legacy MD5 hashes are still supported and are immediately converted to the new format when a user logs in. Since big parts of the authentication system needed to be rewritten in this context, this patch also includes some simplification and refactoring of all code related to password checking and resetting. Fixes FS#52297. Signed-off-by: Lukas Fleischer --- web/html/passreset.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'web/html') diff --git a/web/html/passreset.php b/web/html/passreset.php index cb2f6bcd..e89967d4 100644 --- a/web/html/passreset.php +++ b/web/html/passreset.php @@ -34,10 +34,7 @@ if (isset($_GET['resetkey'], $_POST['email'], $_POST['password'], $_POST['confir } if (empty($error)) { - $salt = generate_salt(); - $hash = salted_hash($password, $salt); - - $error = password_reset($hash, $salt, $resetkey, $email); + $error = password_reset($password, $resetkey, $email); } } elseif (isset($_POST['email'])) { $email = $_POST['email']; -- cgit v1.2.3-24-g4f1b