summaryrefslogtreecommitdiffstats
path: root/web/lib/pkgbasefuncs.inc.php
AgeCommit message (Collapse)AuthorFilesLines
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>
2014-06-25Add support for merge requestsLukas Fleischer1-4/+7
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-25Add an accept button to the package request listLukas Fleischer1-2/+12
This button allows for accepting a request, disowning the affected package or redirecting to the package deletion page. The request is closed automatically when the action has been performed. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-06-25Allow for closing package requestsLukas Fleischer1-2/+24
This allows Trusted Users to close package requests via the request list. Also, entries are now sorted such that open requests are shown before closed requests. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-06-25Add a package request listLukas Fleischer1-0/+20
Introduce a new navigation point "Requests" that shows a list of pending package requests. This functionality is only available to Trusted Users. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-06-25Add support for filing package requestsLukas Fleischer1-0/+88
Add a new entry to the package actions box that allows for filing deletion and orphan requests. When choosing that action, the user is redirected to a new page that allows for selecting a request type and entering a comment. When submitting the request, a new entry in the request database is created and an email is sent to a configurable mailing list (defaults to aur-general). Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-05-22Use aur.archlinux.org in sender email addressesLukas Fleischer1-6/+6
Consistently use the following headers in notification emails: Reply-to: noreply@aur.archlinux.org From: notify@aur.achlinux.org Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-05-20Add threading headers to notification mailThomas Weißschuh1-0/+3
It is only basic, but works in this way for other platforms. It works because MUAs are able to reconstruct threads originating from mails they don't know about (unknown Message-ID). This has some drawbacks: * MUAs might show the missing start of the thread. As a normal user of a package never got *all* notifications of a package anyways it only reflects the reality * Missing notifications go unnoticed. This is no regression so it should be fine Those could be fixed by including all previous comments in 'References:', which would require to have predictable 'Message-ID:' for notification mails. This would require more code and more database accesses at runtime. Could also be used for out of date notifications. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-05-06Add a packager field to packagesLukas Fleischer1-6/+9
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-04-06Fix misuses of pkgbase_from_pkgid()Lukas Fleischer1-5/+6
All pkgbase_*() functions should operate on package base IDs. Drop the superfluous (and incorrect) parameter conversion from package IDs to package base IDs. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-06Fix pkgbase_user_voted()Lukas Fleischer1-14/+10
pkgbase_user_voted() should expect a package base ID, not a package ID. Change the SQL query accordingly. This fixes the vote status on package base pages. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05Refactor pkgbase_categories()Lukas Fleischer1-6/+4
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05Refactor pkgbase_comments()Lukas Fleischer1-26/+23
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05Refactor pkgbase_comments_count()Lukas Fleischer1-12/+10
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05pkgbasefuncs.inc.php: Fix leftover bitsLukas Fleischer1-3/+3
Fix some places that incorrectly referred to packages instead of package bases. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-04-05Split out package base functionsLukas Fleischer1-0/+968
Move functions operating on package bases to a separate file. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>