Commit graph

41 commits

Author SHA1 Message Date
Lukas Fleischer
2422fb020b Store timestamp and user ID when closing requests
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2019-11-23 12:30:46 -05:00
Johannes Löthberg
7f008b0bc4 pkgreqfuncs: Don't leave out non-default ClosureComment column
Since 09cb61a (schema: Remove invalid default values for TEXT columns,
2017-04-15) the PackageRequests.ClosureComment field no longer has a
default value.

Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2019-07-30 13:51:27 -04:00
Lukas Fleischer
69deea9f2f Ignore merge target for non-merge requests
Fixes FS#59837.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2019-05-24 12:24:46 -04:00
Lukas Fleischer
b3fdd3f803 Add a parameter to skip old requests to pkgreq_list()
Allow for hiding requests which were opened before a given time stamp.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-02-15 07:13:01 +01:00
Lukas Fleischer
ff8eb62a75 Add an option to filter by user to pkgreq_list()
When a user is specified, the function only returns package requests
which are either opened by the given user or affecting packages
maintained by the given user.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-02-08 19:18:27 +01:00
Mark Weiman
608c483090 Add user set timezones
Currently, aurweb displays all dates and times in UTC time. This patch
adds a capability for each logged in user to set their preferred
timezone.

Implements FS#48729.

Signed-off-by: Mark Weiman <mark.weiman@markzz.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-01-20 23:20:40 +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
60cdad28ee Distinguish auto-accepted requests
Before commit 9746a65 (Port notification routines to Python,
2015-06-27), notification emails for automatically closed requests
explicitly stated that the action was taken "automatically by the Arch
User Repository package request system". When porting the notification
routines to Python, this feature was overlooked and emails sent by the
new script always reported that the requester triggered the acceptance
or rejection of a request.

This patch reimplements the old behavior such that notifications no
longer look as if the requester had accepted the request himself.

Reported-by: Johannes Löthberg <johannes@kyriasis.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-06-30 22:45:26 +02: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
Lukas Fleischer
5931d5ceec Save comment when closing requests
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-12-13 10:22:58 +01: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
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
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
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
55586d9c22 Include proper timestamp in auto-accept emails
Fixes a regression introduced in c70b340 (Close requests before
accepting, 2014-07-29).

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-10-03 13:17:38 +02:00
Lukas Fleischer
76872d8b08 Fix permission check in pkgreq_close()
Make sure that requests can be auto-accepted if filed by a regular user.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-10-03 13:17:38 +02:00
Lukas Fleischer
218ccf51e3 Add permission checks to the request feature
* Only show the request form to users that are logged in.
* Only show the close request form to Trusted Users and developers.
* Check for a valid login in pkgreq_file().

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-08-08 11:48:58 +02:00
Lukas Fleischer
237a4570e2 Add PCRE_DOLLAR_ENDONLY to preg_match()
When using preg_match() to check for a match that starts at the
beginning of the string and ends at the last character of the string, we
do not want to allow an additional newline character to sneak in.
Amongst other potential loopholes, adding the PCRE_DOLLAR_ENDONLY
modifier prevents users from registering with user names that end with a
newline character.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-08-06 00:00:33 +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
98235c834b Remove duplicate recipients from Cc
When a user files a request for a package maintained by himself, he is
currently included in the Cc list twice. Use array_unique() to omit
repeated entries.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-07-29 17:52:09 +02:00
Lukas Fleischer
48ae736068 Prevent merging a package base with itself
Instead of deleting the package, show an error message if a user tries
to merge a package base with itself.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-07-23 17:53:28 +02:00
Lukas Fleischer
ed1e747847 Verify that the target of merge operations exists
Make sure that the target of a merge operation is either empty or an
existing package base name.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-07-23 15:11:59 +02:00
Lukas Fleischer
c36f0e885a Automatically accept orphan requests for old packages
If an orphan request is filed for a package that has been flagged
out-of-date for at least 180 days, it is disowned automatically.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-07-17 16:57:04 +02:00
Lukas Fleischer
e9b13cef3f Mention the target of merge requests in emails
When sending the initial notification email for a merge request, include
the name of the package base that is the target of the requested merge
operation.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-07-16 11:11:23 +02:00
Lukas Fleischer
42d927366a Use Cc instead of Bcc in request notifications
Add the request creator and the current package maintainer to Cc instead
of Bcc when sending notification emails for package requests. This
allows users to forward any discussion to both of them by using the
"Group Reply" function of their MUA.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-07-16 11:09:55 +02:00
Lukas Fleischer
bfb253ef72 Bcc notification emails to the request creator
Add both the request creator and the current package maintainer to the
Bcc list of notification emails for package requests.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-07-16 11:09:30 +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
b113764b0b Sanitize merge base name in pkgreq_file()
Move the check introduced in 06b7099 (Validate package base name when
filing requests, 2014-07-02) from pkgbase.php to pkgreq_file().

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-07-04 11:25:37 +02:00
Lukas Fleischer
87215cef00 Remember whether a request has been accepted
Store whether a package request is accepted or rejected and display the
reason of each closed request in the request list.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-07-04 11:24:24 +02:00
Lukas Fleischer
743f13e92d Include reason for closing a request in the subject
Change the subject of notification emails sent when closing a request to
be either "Request Accepted" or "Request Rejected".

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-07-04 11:10:51 +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
a149fc493f Fix pagination in the package request list
This was not implemented properly in commit 8260111 (Add a package
request list, 2014-06-24).

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-07-02 08:23:27 +02:00
Lukas Fleischer
7b57e0e1b3 Set Message-ID when sending package request emails
When sending the first notification email that belongs to a certain
package request, set the Message-ID instead of the In-Reply-To and
References headers. This is not only more RFC compliant but also fixes
thread views in several clients, such as Pipermail.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-07-01 22:29:40 +02:00
Lukas Fleischer
4186e42a39 Remove Reply-To header from package request emails
These notification emails are sent to a public mailing list for
discussion. Make sure that people can reply.

Reported-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-07-01 22:27:13 +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
707b1bb878 Fix documentation of pkgreq_*() return types
Reported-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-07-01 19:47:21 +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