Commit graph

504 commits

Author SHA1 Message Date
Lukas Fleischer
a93363ac08 Add a packager field to packages
Store the last packager in addition to storing the submitter and the
maintainer of a package. This allows for checking who last updated a
package, even if the package has been disowned.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-05-06 20:52:32 +02:00
Lukas Fleischer
e161c4f94b Fix vote/notify link on the package details page
Call pkgbase_user_voted() and pkgbase_user_notify() using the package
base ID instead of using the package ID.

Fixes FS#40165.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-05-01 09:29:55 +02:00
Lukas Fleischer
9553790cfc Support multiple licenses per package
Split out package licenses into two separate tables in order to support
multiple licenses per package. The code on the package details page is
adjusted accordingly.

UPGRADING contains instructions on how to convert existing licenses in
the database to the new layout.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-26 14:48:19 +02:00
Lukas Fleischer
38eb8d2a3a Display package groups on the details page
The groups field is hidden if a package doesn't belong to any group.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-26 14:21:55 +02:00
Lukas Fleischer
3720bdf6b2 Display package relations on the details page
This adds information from the following three fields to the package
details page:

* conflicts
* provides
* replaces

If either of these fields is empty, it is not displayed.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-26 13:34:17 +02:00
Lukas Fleischer
e582cfe182 Collapse long dependency lists
Collapse package dependency lists with more than 20 entries and add a
link to show the full list.

The JavaScript code for this originates from the archweb project. Note
that the full list is shown when JavaScript is disabled or unavailable.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-18 23:57:46 +02:00
Lukas Fleischer
895907579e Display dependency type of package dependencies
This adds a label to makedepends, checkdepends and optdepends on the
package details page. makedepends are labelled with "(make)",
checkdepends with "(check)" and optdepends are labeled with
"(optional)", followed by the optdepend description.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-17 21:10:58 +02:00
Lukas Fleischer
f08bfa5d01 pkg_search_results.php: Link to account when logged in
Replace the maintainer package search links with links to the
maintainer's account when browsing the search results as a logged-in
user.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05 16:52:15 +02:00
Lukas Fleischer
676595f9bf Prefix package functions with pkg_/pkgbase_
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05 15:55:31 +02:00
Lukas Fleischer
d16f7cf712 Use snake case for all package functions
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05 15:54:21 +02:00
Lukas Fleischer
f461344211 Move package actions to package bases
Package actions now operate on package bases instead of packages. Move
all actions to the correct locations.

This also fixes some issues with comment notifications.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05 13:54:06 +02:00
Lukas Fleischer
c1c77836a8 Allow for searching by package base name
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05 13:51:28 +02:00
Lukas Fleischer
afb02a10c6 pkg_details.php: Add link to package base details
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05 12:21:36 +02:00
Lukas Fleischer
f7d13b5b36 Add package base detail pages
This adds package base details pages, similar to the package details
pages. Each package base details page contains general information
(package base name, category, submitter, maintainer, ...) and links to
all the corresponding packages. As on the package details pages,
comments and links to several package actions are also provided.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05 12:21:36 +02:00
Lukas Fleischer
d35cf67f7b Store comments on a per-package base basis
Move comments from the Packages table to PackageBases. Sharing comments
makes sense since they almost always refer to a source package.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05 12:21:35 +02:00
Lukas Fleischer
def35942af Modernize the account search form
Replace the table layout with field sets, labels and CSS formatting.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-02-09 01:57:18 +01:00
Lukas Fleischer
69557a7ca7 Show user's last login on the account details page
This is only visible to Trusted Users and developers.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-02-09 01:49:35 +01:00
Lukas Fleischer
8c07c091e8 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>
2014-02-09 01:43:37 +01:00
Lukas Fleischer
fb7bde3a6c Add support for anonymous comments
This allows for removing users without also removing the corresponding
comments. Instead, all comments from deleted users will be displayed as
"Anonymous comment".

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-02-04 18:48:23 +01:00
Lukas Fleischer
6ee1321211 Hide intermediate voting results
In order to make votes as neutral as possible, current yes/no votes
should not be shown until the voting period is over.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-02-03 21:53:21 +01:00
Lukas Fleischer
44ac24d394 tu_details.php: Fix unknown result check
Quorum is a decimal field, so checking "!$quorum" does not work. Use the
number of active TUs instead which is how we already check whether
participation information is available in other places.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-02-03 21:45:28 +01:00
canyonknight
42c9957e41 account_details.php: Add link to edit a user's account
This improves the ability to edit a user's account directly through
UI features rather than manually appending 'edit' to the URL or
searching for the account and selecting edit.

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-02-03 21:16:36 +01:00
canyonknight
1e9d539acf Further optimize voters.php to only need the package name
* Extends changes in 81d4cc13dc
* Modify getvotes() to use the package name rather than package ID
* Rename getvotes() to votes_for_pkgname() for clarity with new changes
* Modify routing framework and links to now use package names for voters.php

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-01-22 18:27:42 +01:00
canyonknight
dbf1d474f7 Convert adopt/disown package action link to form
* Changes adopting/disowning packages to use GET instead of POST
* Uses CSS to make form submit button look like a link
* Complements commit 3bc951e3d8

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-09-08 13:53:47 +02:00
Lukas Fleischer
54ad28369a tu_list.php: Hide table if no results are found
Instead of showing a table with a single "No results found." entry, do
not show the table at all and display the text "No results found." in a
<p></p> container.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-09-03 12:58:54 +02:00
Lukas Fleischer
3130a887e8 Move "Add Proposal" link to "Current Votes"
The page this links to allows for adding an item to the list of current
votes. Move the link accordingly.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-09-03 12:53:58 +02:00
Lukas Fleischer
69b98efa35 Re-add CRSF tokens to most package actions
We fixed all known CRSF vulnerabilities in commit 2c93f0a (Implement
token system to fix CSRF vulnerabilities, 2012-06-23). c349cb2 (Add
virtual path support for package actions, 2012-07-17) partly reverted
this by injecting a valid CRSF token when virtual paths are in use.

This patch allows for keeping the virtual path feature, while
reintroducing POST forms and CRSF tokens. Actions like package flagging,
votes and notifications are no longer prone to CRSF (see FS#35437 for
details).

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-08-27 02:27:19 +02:00
Lukas Fleischer
3bc951e3d8 pkg_details: Convert most action links to forms
Use forms and POST instead of GET for following actions:

* Flagging/Unflagging a package out-of-date
* Voting for a package and removing votes
* Enabling/Disabling notifications

Use CSS to make the submit buttons of these forms look like links.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-08-27 02:10:13 +02:00
Lukas Fleischer
431bf2f2f3 tu_details.php: Avoid division by zero
Do not divide by zero if the number of active TUs is unknown.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-08-26 18:02:37 +02:00
Lukas Fleischer
a4a170e58e Move "Past Votes" navigation to "Past Votes" box
These are navigation links and do not belong to the action box.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-08-26 17:53:24 +02:00
Lukas Fleischer
2dd3d04f45 Add "Last Votes by TU" list
This shows a list of all Trusted Users and the vote ID of the last
proposal each of the TUs voted on. This list is sorted by vote ID.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-08-26 17:34:31 +02:00
Lukas Fleischer
fb76aab8cf tu_details.php: Display vote result
This adds an field that indicates whether the vote was accepted or
rejected, based on the rules specified in the TU Bylaws.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-08-22 17:48:18 +02:00
Lukas Fleischer
481ff2335c tu_details.php: Avoid inline computations
Compute the total number of votes and the participation at the beginning
of the template instead of doing it inside the template itself.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-08-22 17:48:18 +02:00
Lukas Fleischer
86fa42f399 Show participation in vote details
This is calculated by dividing the sum of all votes by the total number
of TUs (where the number of TUs is measured when the vote starts).

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-08-22 17:47:53 +02:00
Lukas Fleischer
6844f6c1d2 Allow for setting an account's inactivity status
This adds a field to the users table and corresponding fields to the
account edit and display forms that allow for setting an (in-)activity
status.

This might turn out to be useful if a user is on vacation and can not
respond to update/orphan/deletion requests.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-08-22 17:43:13 +02:00
Lukas Fleischer
f1a4b508e5 Enforce e-mail validation during registration
Remove the password field from the account creation form and always send
a password reset request via e-mail instead. This ensures that only
users with valid e-mail addresses are able to login.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-03-19 14:03:34 +01:00
Lukas Fleischer
21e6c3f65f Fix default selection on the account edit page
We used a mixture of account type IDs and account type descriptions on
the account edit page. This resulted in the account type field always
defaulting to "Normal user" after an invalid form had been submitted.

Consistently use account type IDs to avoid this.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-02-10 12:11:36 +01:00
Lukas Fleischer
8b791dee91 Merge branch 'maint' 2013-01-30 09:25:42 +01:00
canyonknight
e4ad05533f pkg_details.php: Add missing translatable string
Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-01-30 09:25:27 +01:00
Lukas Fleischer
49e6184508 Merge branch 'maint' 2013-01-19 12:21:26 +01:00
canyonknight
d23a870671 user_table.php: Remove unused link parameter
Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-01-19 12:21:12 +01:00
Marcel Korpel
398fdb67ea We live in 2013 now
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-01-19 12:20:50 +01:00
Marcel Korpel
8e1051932e Add description meta-element to package pages
Implements FS#33294

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2013-01-19 12:18:13 +01:00
canyonknight
4161e14796 pkg_details.php: Fix potential XSS for package names and dep conditions
Package names and dep conditions can be specially crafted for an XSS
attack. Properly sanitize these variables on the package details page.

In addition, avoid including dep conditions as part of a package link.

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-11-07 00:59:28 +01:00
Lukas Fleischer
630f1cbae8 Avoid use of "$_SERVER['REQUEST_URI']"
Use the routing library to build proper URIs instead of relying on the
"REQUEST_URI" server variable which can be manipulated and might return
bogus URIs.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-11-04 19:19:32 +01:00
Lukas Fleischer
73656e17bd pkg_details.php: Remove plural from the adopt/disown button
Fixes FS#32455.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-11-04 17:08:35 +01:00
Lukas Fleischer
274182a424 Add missing internationalization to a few strings
Fixes FS#32449.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-11-04 17:08:31 +01:00
Lukas Fleischer
4e4db4133b header.php: Do not lowercase language selection entries
Commit 091c2b5f55 introduced lower casing
to the language drop-down list. Revert this and use htmlspecialchars()
to escape language entries instead.

Addresses FS#32453.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-11-04 16:49:47 +01:00
Lukas Fleischer
6897bb0097 Implement word-wrap for package statistics
Word-wrap labels in the package statistics box, just as we wrap package
names in the "Recent Updates" box.

Addresses FS#32160.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-10-28 02:17:54 +02:00
Dan McGee
5222bf0932 Use HTTPS links everywhere for Arch sites
The main site, wiki, and BBS are using HTTPS exclusively, so link
directly to the correct protocol rather than forcing a redirect.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2012-10-22 12:33:11 +02:00