summaryrefslogtreecommitdiffstats
path: root/web/lib/pkgbasefuncs.inc.php
AgeCommit message (Collapse)AuthorFilesLines
2015-12-13notify: Do not pass notification texts via pipesLukas Fleischer1-2/+3
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-12Implement capability to pin comments above othersMark Weiman1-5/+75
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-11-12Remove redundant codeLukas Fleischer1-15/+1
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-10-21Check comment length in the backendLukas Fleischer1-0/+4
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-10-17Send notifications when changing co-maintainershipLukas Fleischer1-0/+2
Implements FS#45590. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-10-17Refactor pkgbase_set_comaintainers()Lukas Fleischer1-6/+20
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-09-16Transfer notifications when merging packagesLukas Fleischer1-0/+14
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-11Require comments when flagging packages out-of-dateLukas Fleischer1-6/+8
Implements FS#42827. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-08-30Allow users to unflag packages they flagged themselvesLukas Fleischer1-1/+2
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-30Remember user ID when flagging package basesLukas Fleischer1-2/+2
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-17Do not allow empty commentsMarcel Korpel1-0/+10
Fixes FS#45870. Signed-off-by: Marcel Korpel <marcel.korpel@gmail.com> Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-08-08Split pkg_comment_form.php so the outer box is not always includedMarcel Korpel1-1/+1
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-08Show popularity in package base detailsLukas Fleischer1-1/+1
Fixes FS#45600. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-08-08Show dateline when a comment is edited or deletedMarcel Korpel1-3/+6
Signed-off-by: Marcel Korpel <marcel.korpel@gmail.com> Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-08-08Support comment editing in the backendMarcel Korpel1-1/+33
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-08Port notification routines to PythonLukas Fleischer1-96/+10
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-06-20Let co-maintainers edit package keywordsJohannes Löthberg1-1/+2
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com> Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-20Let co-maintainers unflag the packageJohannes Löthberg1-1/+2
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com> Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-20Add functions for getting arrays of maintainer and co-maintainer UIDsJohannes Löthberg1-0/+35
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com> Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-14Replace categories with keywordsLukas Fleischer1-66/+44
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-05-22Update co-maintainer list when promoting a userLukas Fleischer1-13/+20
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-22Fix processing of pkgbase_get_comaintainers()Lukas Fleischer1-6/+9
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-22Update co-maintainers when disowning a packageLukas Fleischer1-0/+18
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-22Fix the permission check in pkgbase_adopt()Lukas Fleischer1-10/+18
Filter the affected package bases before closing any package requests. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-05-22Store co-maintainer prioritiesLukas Fleischer1-2/+5
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-21Make the type parameter of pkgreq_by_pkgbase() optionalLukas Fleischer1-4/+1
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-03-04Automatically close requestsLukas Fleischer1-1/+30
Close requests automatically when a package is deleted or orphaned. Implements FS#43799. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2015-03-04Allow users to delete their own packagesLukas Fleischer1-2/+3
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-01-07Add support for package base co-maintainersLukas Fleischer1-0/+64
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>
2014-12-27Use Git repositories to store packagesLukas Fleischer1-39/+0
* 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-13Avoid double slashes in notification email bodyLukas Fleischer1-3/+2
Refactor some of the URI generation code to avoid double slashes in absolute URIs. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-11-21Always use virtual URLsLukas Fleischer1-1/+0
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-10-24Use an INI-style configuration fileLukas Fleischer1-14/+3
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-17voters.php: Show time stamps if availableLukas Fleischer1-1/+1
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-10-16Add a time stamp to package base votesLukas Fleischer1-3/+3
This can potentially be used to identify trending packages. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-08-06Fix notification handling on submission and adoptionLukas Fleischer1-1/+1
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-07-29Close requests before acceptingLukas Fleischer1-8/+20
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-25Make deleted comments visible to Trusted UsersLukas Fleischer1-6/+14
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-16Fix pkgbase_votes_from_name()Lukas Fleischer1-8/+9
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-15Rework permission handlingLukas Fleischer1-55/+38
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-04Display number of pending requests in actions boxLukas Fleischer1-1/+4
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-04Allow for adding a comment when closing a requestLukas Fleischer1-2/+2
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-04Allow for selecting a reason when closing a requestLukas Fleischer1-2/+2
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-01Be explicit about accepted requests in emailsLukas Fleischer1-2/+2
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-06-30Fix broken indentation in pkgbase_delete_comment()Lukas Fleischer1-5/+5
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-06-30Rename package request functions to pkgreq_*()Lukas Fleischer1-2/+2
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-30Split out package request functionsLukas Fleischer1-185/+1
Move package request functions to a separate unit pkgreqfuncs.inc.php. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-06-25Prefix request notification mails with IDLukas Fleischer1-4/+7
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-25Send notification mail when closing a requestLukas Fleischer1-0/+45
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-25Add threading headers to request notification mailsLukas Fleischer1-0/+4
This allows for grouping mails that belong to the same request. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>