Commit graph

64 commits

Author SHA1 Message Date
Mark Weiman
7d4c0c9ffa Implement capability to pin comments above others
Adds capability to pin comments before others.

Implements FS#10863.

Signed-off-by: Mark Weiman <mark.weiman@markzz.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-12-12 15:09:47 +01:00
Lukas Fleischer
0c599b39b0 Remove redundant code
This code is no longer needed since 9746a65 (Port notification routines
to Python, 2015-06-27).

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-11-12 11:47:20 +01:00
Lukas Fleischer
9c70e10aeb Check comment length in the backend
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-10-21 22:32:29 +02:00
Lukas Fleischer
4411a55ec9 Send notifications when changing co-maintainership
Implements FS#45590.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-10-17 17:33:45 +02:00
Lukas Fleischer
2f6471b0b1 Refactor pkgbase_set_comaintainers()
This makes the code slightly more efficient and allows for easily
determining the users that were added/removed to the co-maintainer list.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-10-17 17:33:07 +02:00
Lukas Fleischer
34e7f7084a Transfer notifications when merging packages
When a package base is merged into another one, followers of the old
package base usually want to be notified about comments the new package
base as well.

Fixes FS#27687.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-09-16 22:05:40 +02:00
Lukas Fleischer
396e50bdc8 Require comments when flagging packages out-of-date
Implements FS#42827.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-09-11 22:14:26 +02:00
Lukas Fleischer
57db4814a4 Allow users to unflag packages they flagged themselves
Sometimes, a user accidentally flags a package out-of-date. Allow users
to unflag packages that they flagged themselves, thereby providing a way
to undo these actions.

Implements FS#46145.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-08-30 16:51:14 +02:00
Lukas Fleischer
e1a258bd83 Remember user ID when flagging package bases
Add a new FlaggerUID field to the database and use it to store the user
ID of the account who recently flagged a package out-of-date.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-08-30 16:44:12 +02:00
Marcel Korpel
095986b449 Do not allow empty comments
Fixes FS#45870.

Signed-off-by: Marcel Korpel <marcel.korpel@gmail.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-08-17 04:20:45 +02:00
Marcel Korpel
c7025054c6 Split pkg_comment_form.php so the outer box is not always included
For use in the new RPC interface to edit comments, the form shouldn't
always print a header. Create a new template pkg_comment_box.php that
prints form and box, change template pkg_comment_form.php to only
print the form.

Signed-off-by: Marcel Korpel <marcel.korpel@gmail.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-08-08 12:59:24 +02:00
Lukas Fleischer
e610360c95 Show popularity in package base details
Fixes FS#45600.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-08-08 12:59:24 +02:00
Marcel Korpel
9cde6b0566 Show dateline when a comment is edited or deleted
Signed-off-by: Marcel Korpel <marcel.korpel@gmail.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-08-08 12:59:24 +02:00
Marcel Korpel
e331ce273c Support comment editing in the backend
Create two new actions, do_AddComment and do_EditComment. When editing
or deleting a comment, a timestamp is added.

Signed-off-by: Marcel Korpel <marcel.korpel@gmail.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-08-08 12:59:24 +02:00
Lukas Fleischer
9746a65473 Port notification routines to Python
Use a Python script for sending notification emails. The notification
action and additional parameters are passed via command line arguments.
For comment and package request notifications, the text is passed via
stdin.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-08-08 12:59:23 +02:00
Johannes Löthberg
918f00f9a2 Let co-maintainers edit package keywords
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-20 14:27:00 +02:00
Johannes Löthberg
a5fd2bb39d Let co-maintainers unflag the package
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-20 14:27:00 +02:00
Johannes Löthberg
5eb7354e7d Add functions for getting arrays of maintainer and co-maintainer UIDs
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-20 14:26:59 +02:00
Lukas Fleischer
5fb7a74e23 Replace categories with keywords
Remove package base categories. Instead, users can now specify up to
twenty custom keywords that are taken into consideration when searching.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-14 17:58:55 +02:00
Lukas Fleischer
dd3eb28a8c Update co-maintainer list when promoting a user
When a user disowns a package and promotes a co-maintainer, remove that
new maintainer from the list of package co-maintainers. Since only the
package maintainer can manage co-maintainers, this must happen before
the actual disown operation.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-05-22 21:14:26 +02:00
Lukas Fleischer
c6e09def2b Fix processing of pkgbase_get_comaintainers()
pkgbase_get_comaintainers() returns an array of user names, not an array
of user IDs.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-05-22 21:14:24 +02:00
Lukas Fleischer
422d8026da Update co-maintainers when disowning a package
When a user disowns a package, the co-maintainer with the highest
priority automatically becomes the new maintainer. When the package is
disowned by a Trusted User or a Developer, the list of co-maintainers is
cleared.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-05-22 17:09:26 +02:00
Lukas Fleischer
0dcdc23a7f Fix the permission check in pkgbase_adopt()
Filter the affected package bases before closing any package requests.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-05-22 17:09:26 +02:00
Lukas Fleischer
2b909cb3f6 Store co-maintainer priorities
In addition to saving the list of package co-maintainers, also save
their order. This makes it possible to define a "primary" co-maintainer.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-05-22 17:09:26 +02:00
Lukas Fleischer
01bfae82ce Make the type parameter of pkgreq_by_pkgbase() optional
This simplifies the code a bit, improves maintainability and reduces the
number of SQL queries when deleting a package.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-05-21 17:10:33 +02:00
Lukas Fleischer
a53241a2f1 Automatically close requests
Close requests automatically when a package is deleted or orphaned.

Implements FS#43799.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2015-03-04 12:20:21 +01:00
Lukas Fleischer
5dca715c46 Allow users to delete their own packages
Allow users to remove their own package bases for a short period of time
after initial submission (defaults to one day).

Implements FS#43648.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2015-03-04 12:16:33 +01:00
Lukas Fleischer
fc23a9bd50 Add support for package base co-maintainers
This allows for having multiple co-maintainers for AUR packages.
Co-maintainers have push access to the package base Git repository but
are not allowed to change the package base category, disown the package
or modify the list of co-maintainers. The primary maintainer of an AUR
package can edit the list of co-maintainers from the Package Actions
box.

Implements FS#17911.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2015-01-07 12:21:21 +01:00
Lukas Fleischer
74edb6fea9 Use Git repositories to store packages
* Remove package submission page from the web interface.
* Replace PKGBUILD and tarball links with links to cgit.
* Remove the "URLPath" field from RPC replies.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-12-27 12:42:12 +01:00
Lukas Fleischer
5ebf534ba7 Avoid double slashes in notification email body
Refactor some of the URI generation code to avoid double slashes in
absolute URIs.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-12-13 15:28:54 +01:00
Lukas Fleischer
571b74b901 Always use virtual URLs
Support for non-virtual URLs has been broken for a long time and is no
longer used on the official AUR setup.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-11-21 11:43:31 +01:00
Lukas Fleischer
76343fb915 Use an INI-style configuration file
Replace web/lib/config.inc.php with an INI-style configuration file.
This allows us to get rid of several globals and makes it easier to use
the same configuration file in external scripts.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-10-24 10:03:54 +02:00
Lukas Fleischer
c64b51f2ee voters.php: Show time stamps if available
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-10-17 09:53:02 +02:00
Lukas Fleischer
e9ebcc4479 Add a time stamp to package base votes
This can potentially be used to identify trending packages.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-10-16 18:15:45 +02:00
Lukas Fleischer
0613a637b3 Fix notification handling on submission and adoption
Automatically add users to the notification list when adopting a
package. This used to work bug was broken by 03c6304 (Rework permission
handling, 2014-07-15). Fixes FS#41426.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-08-06 00:09:05 +02:00
Lukas Fleischer
c70b340c41 Close requests before accepting
When auto-accepting a request, we need to close the package request
before performing the actual action (disown/deletion/merge). Otherwise,
the former maintainer is not included in the Cc list of the
acceptance/rejection notification email.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-07-29 17:59:26 +02:00
Lukas Fleischer
daceef50eb Make deleted comments visible to Trusted Users
This allows Trusted Users to check whether a user posted a politically
incorrect comment, even if he already deleted it.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-07-25 11:30:32 +02:00
Lukas Fleischer
d03f7a890f Fix pkgbase_votes_from_name()
In 676595f (Prefix package functions with pkg_/pkgbase_, 2014-04-05),
votes_for_pkgname() was renamed to pkgbase_votes_from_name() without
changing the semantics. Slightly adapt the implementation and interpret
the argument as a package base name instead of a package name. Also fix
the call site.

Reported-by: Felix Yan <felixonmars@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-07-16 19:22:58 +02:00
Lukas Fleischer
03c6304e19 Rework permission handling
Add a new function has_credential() that checks whether the currently
logged in user is allowed to perform a given action. Moving all
permission handling to this central place makes adding new user groups
and adjusting permissions much more convenient.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-07-15 22:56:57 +02:00
Lukas Fleischer
111d836912 Display number of pending requests in actions box
For packages with pending package requests, display the number of
requests above the "File Request" link.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-07-04 12:28:12 +02:00
Lukas Fleischer
4645bcbacb Allow for adding a comment when closing a request
This allows Trusted Users to optionally add a comment when closing a
request. The comment is included in the notification email that is sent
to the requests mailing list.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-07-04 11:10:50 +02:00
Lukas Fleischer
8a465182ba Allow for selecting a reason when closing a request
When closing a package request, Trusted Users can now pick a reason
("Accepted" or "Rejected"). This allows for marking a request as
accepted, even if the corresponding package base has already been
deleted.

Also, the notification email now always explicitly states whether a
request has been accepted or closed in the message body.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-07-04 11:10:37 +02:00
Lukas Fleischer
0d513e1468 Be explicit about accepted requests in emails
When sending notification emails after closing a request, be explicit
about whether the request has been accepted or not.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-07-01 20:06:41 +02:00
Lukas Fleischer
a48739508c Fix broken indentation in pkgbase_delete_comment()
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-06-30 08:57:05 +02:00
Lukas Fleischer
74a82bb2fb Rename package request functions to pkgreq_*()
Since these functions now reside in a separate module, use the module
name as function name prefix.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-06-30 08:49:46 +02:00
Lukas Fleischer
dde0482d10 Split out package request functions
Move package request functions to a separate unit pkgreqfuncs.inc.php.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-06-30 08:47:59 +02:00
Lukas Fleischer
278e6be4eb Prefix request notification mails with ID
Add a "[PRQ#n]" prefix to each package request notification mail. PRQ is
an abbreviation for "Package Request" and n is replaced with the
corresponding package request ID.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-06-25 21:54:36 +02:00
Lukas Fleischer
c8818a693d Send notification mail when closing a request
The mail is sent to the request mailing list and to the current package
maintainer.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-06-25 21:48:22 +02:00
Lukas Fleischer
0e84667c33 Add threading headers to request notification mails
This allows for grouping mails that belong to the same request.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-06-25 21:45:02 +02:00
Lukas Fleischer
91e6b5cb2f Add support for merge requests
This adds a new "Merge" category to the list of available request types
and also adds a new "Merge into" field that is hidden via JavaScript
when "Deletion" or "Orphan" is selected.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-06-25 11:38:02 +02:00