Commit graph

77 commits

Author SHA1 Message Date
Lukas Fleischer
5553d01ab3 Check query return value in pkgbase_user_notify()
Instead of unconditionally calling fetch on the return value of query(),
error out early if the value evaluates to false.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-04-18 08:37:31 +02:00
Lukas Fleischer
06cf067d4f Squelch warning in pkgbase_vote()
Do not trigger a PHP warning if there are no votes to be added or
removed.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-02-27 20:11:15 +01:00
Lukas Fleischer
483c8f5178 Remove bogus if-statement from pkgbase_delete()
The variable $action is always undefined in pkgbase_delete() which makes
the if-statement always true and triggers a warning whenever a package
base is removed.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-02-27 19:56:30 +01:00
Lukas Fleischer
31754909b1 Fix user name in disown notifications
Do not overwrite the $uid variable when updating co-maintainers.

Fixes FS#52225.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-02-24 21:25:03 +01:00
Mark Weiman
3e442a0f7d Remove all usage of UNIX_TIMESTAMP in web interface
UNIX_TIMESTAMP is not part of the SQL standard. Instead, all usage in
the web interface is changed to use PHP's time() function.

Signed-off-by: Mark Weiman <mark.weiman@markzz.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-11-10 18:31:20 +01:00
Lukas Fleischer
b757246e33 pkgbasefuncs.inc.php: Remove debug statement
Remove a leftover var_dump() invocation that was introduced in commit
5fb7a74 (Replace categories with keywords, 2015-06-13).

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-06-02 08:37:43 +02:00
Lukas Fleischer
6ec4a3589e Send notifications when changing ownership
Add a new option that makes it possible to subscribe to package
ownership changes (adoption/disownment).

Fixes FS#15412.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-02-21 20:01:13 +01:00
Mark Weiman
c23914fc1d Unset $pinned unconditionally when displaying comments
In pkg_comments.php, the $pinned variable is used to determine whether
the template is supposed to print all comments or pinned comments only.
If the $pinned variable is unset, the top 10 comments are printed,
followed by an "All comments" link. If the $pinned variable is set, the
pinned comments are printed and the "All comments" link below the
comment listing is skipped. Thus, we need to make sure that this
variable is always unset at the time we include the template to display
all comments, even if it was empty before.

Fixes FS#48194.

Signed-off-by: Mark Weiman <mark.weiman@markzz.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-02-19 18:18:48 +01:00
Lukas Fleischer
3412de21d3 Rename the CommentNotify table to PackageNotifications
As a preparatory step to adding support for package notifications on
events other than comments, rename the database table accordingly.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-02-07 10:39:22 +01:00
Marcel Korpel
bd85441cf6 Add comment undeletion functionality
Only Developers and Trusted Users can undelete comments.

Signed-off-by: Marcel Korpel <marcel.korpel@gmail.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-01-23 11:50:03 +01:00
Mark Weiman
e9fe1a9eb1 Add link to flag OOD comment
Implements: FS#46546

Signed-off-by: Mark Weiman <mark.weiman@markzz.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-12-15 17:46:18 +01:00
Lukas Fleischer
51407d4a29 Store current date and time when deleting comments
Instead of modifying EditedTS when a comment is deleted, use a separate
field DelTS. Use this field to determine whether a comment has been
deleted, instead of checking DelUsersID which might be unset when the
corresponding user is deleted.

Fixes FS#47362.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-12-13 21:19:31 +01:00
Lukas Fleischer
e45609cf66 notify: Do not pass notification texts via pipes
Directly retrieve comments from the database instead of additionally
passing them via stdin.

Fixes FS#46742.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-12-13 10:22:58 +01:00
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