Commit graph

851 commits

Author SHA1 Message Date
Lukas Fleischer
70db022aa8 Store banned IP addresses as plain text
Inspired by commit 32c8d0c (Store last login address as plain text,
2016-03-13).

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-01-25 18:42:34 +01:00
Mark Weiman
7ff5070190 Update cookie for language setting when editing user information
Currently, when a user edits their language setting from the edit user form,
the changes aren't reflected until the user either lets the original cookie
expire, deletes the cookie manually, or changes the language a second time via
the dropdown menu on the top of the page. This patch makes the language cookie
get updated when it is changed from the edit user form.

Signed-off-by: Mark Weiman <mark.weiman@markzz.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-01-20 23:20:51 +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
ddbffcc4d5 Remove extraneous quote in translator.inc.php
The quote is a leftover of legacy code and was meant to be removed by
commit e171f6f (Migrate all DB code to use PDO, 2012-08-08).

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
Mark Weiman
6502518d4e Fix DB.class.php to match config and include SQLite support
In commit baf8a22 (git-interface: Support SQLite as database backend,
2016-08-03), conf/config.proto was changed so that dsn_prefix was
changed to backend and this fixes this in web/lib/DB.class.php.

Since SQLite's dsn is different, this adds a check of which backend is
desired and will quit if MySQL or SQLite are not the backend selected.
SQLite2 may be supported, but is untested and will trigger an error if
used.

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
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
c3f464f50f Release 4.4.1
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-10-17 15:32:06 +02:00
Lukas Fleischer
85866796a4 Move configuration to /etc/aurweb/config
Since d4fe77a (Reorganize Git interface scripts, 2016-10-08), the key
components of the aurweb SSH interface are installed system-wide. Update
the default configuration path to point to a central location.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-10-17 15:13:05 +02:00
Lukas Fleischer
fb07307638 Release 4.4.0
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-10-15 19:46:51 +02:00
Lukas Fleischer
f3b65e59f7 Release 4.3.0
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-08-14 08:00:06 +02: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
fbf3e54057 Add hard limit for the length of dependency lists
Introduce a configuration option max_depends which can be used to
specify a maximum number of (reverse) dependencies to display on the
package details pages.

Fixes FS#49059.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-06-26 08:53:55 +02:00
Lukas Fleischer
e3670ef188 Add a homepage field to accounts
Allow users to add a link to their homepage to their profile.

Implements FS#22774.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-06-08 22:23:57 +02: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
1e5578b92d Merge branch 'maint' 2016-03-19 09:54:27 +01:00
Lukas Fleischer
27ad06e353 Release 4.2.1
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-03-13 13:52:57 +01:00
Lukas Fleischer
3ec3dfb6aa Merge branch 'maint' 2016-03-13 13:17:15 +01:00
Lukas Fleischer
32c8d0c3f8 Store last login address as plain text
Directly store the information contained in $_SERVER['REMOTE_ADDR']
instead of using ip2long() which does not support IPv6 addresses. Note
that the LastLoginIPAddress field is designed to be used by the
administrator on rare occasions only (e.g. to fight spam) and is not
displayed anywhere.

Fixes FS#48557.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-03-13 11:47:30 +01:00
Lukas Fleischer
95140b880b Merge branch 'maint' 2016-03-01 18:30:58 +01:00
Lukas Fleischer
42f5c405c0 aurjson: Remove stray GROUP BY clause
The IDs of packages are unique, so there is no need to group search
results by package ID.

Note that the GROUP BY statement in question was introduced in commit
3447dfc (Support versioned RPC queries, 2014-04-28) for no apparent
reason and could even lead to errors in various DBMS.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-03-01 18:30:48 +01: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
d38a562b4d Release 4.2.0
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-02-15 08:18:55 +01:00
Lukas Fleischer
9d7d1be731 aurjson: Add package base keywords
Expose package base keywords through the RPC interface (version 5).

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-02-09 21:54:39 +01:00
Lukas Fleischer
64072461df Add support for package update notifications
Introduce a new notification option to receive notifications when a new
commit is pushed to a package repository.

Implements FS#30109.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-02-07 10:54:20 +01:00
Lukas Fleischer
aa5e58db81 Add global comment notification setting
Add a configuration option to the account edit page that allows for
globally enabling/disabling package base comment notifications.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-02-07 10:52:05 +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
1664a24198 Remove 'new' tag from updates table
It was hard to make it consistent with the other new icons from Open
Iconic and it hadn't much use after all.

Signed-off-by: Marcel Korpel <marcel.korpel@gmail.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-01-31 20:12:56 +01:00
Marcel Korpel
2121982862 Rename constructors to __construct
In PHP 7, constructor methods that have the same name as the class
they are defined in are deprecated. Use __construct instead.
http://php.net/manual/en/migration70.deprecated.php

Signed-off-by: Marcel Korpel <marcel.korpel@gmail.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-01-28 22:55:32 +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
1f179c9fbc aurjson: Do not search by ID when argument is numeric
When performing info or multiinfo queries, one can currently either pass
package names or package IDs as parameters. As a consequence, it is
impossible to search for packages with a numeric package name because
numeric arguments are always treated as IDs. Since package IDs are not
public anymore these days, simply remove the possibility to search by ID
in revision 5 of the RPC interface.

Fixes FS#47324.

Suggested-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-12-13 10:22:59 +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
Lukas Fleischer
5931d5ceec Save comment when closing requests
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
a114476e81 Make the notification script configurable
Add a configuration option to set the path of the notification script.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-11-14 09:27:35 +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
66d12f0c37 Highlight broken dependencies
If a dependency neither exists in the official repositories nor in the
AUR, make it appear bold red.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-10-24 18:59:04 +02:00
Lukas Fleischer
8dcf225f63 Hide optdepend description if not available
Remove the "(unknown)" suffix that used to be shown for optional
dependencies without a description.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-10-24 18:50:44 +02:00
Lukas Fleischer
b30135111a Include trivial AUR providers in pkg_providers()
When obtaining provisions using pkg_providers(), we already include
virtual providers from the official repositories, virtual providers from
the AUR and trivial providers (i.e. packages having the given name) from
the official repositories. Include trivial providers from the AUR as
well.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-10-24 18:33:00 +02:00
Lukas Fleischer
5d119c02ea Always retrieve dependency providers
Since commit 16765d5 (Track providers in the official repositories,
2015-10-21), we know all packages and virtual provisions from the
official repositories. Always obtain and display all providers from both
the official repositories and the AUR.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-10-24 18:22:25 +02:00
Lukas Fleischer
b74a87abfc Fix spacing of versioned dependencies
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-10-24 18:13:48 +02:00
Lukas Fleischer
a2cbc7f646 aurjson: Allow underscores in JSONP callback names
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-10-24 18:03:19 +02: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
16765d5532 Track providers in the official repositories
Maintain a list of virtual provisions of packages from the official
binary package repositories. The list can be updated using the aurblup
script, e.g. via a cronjob.

This allows for adding proper links to package dependencies: If an AUR
package depends on a package from the official repositories (or on a
name provided by a package from the official repositories), add a link
to the corresponding archweb package details page. If an AUR package
depends on another AUR package (or on a name provided by another AUR
package), add a link to the corresponding aurweb package details page.
Otherwise, just display the name and do not add a link at all.

Fixes FS#46549.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-10-21 22:05:42 +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
1f6237ffa7 aurjson: Rename the search_by parameter to "by"
This parameter is only supported by the search command. We do not need
to repeat ourselves.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-10-09 17:35:51 +02:00
Lukas Fleischer
3c06716c72 aurjson: Merge info and multiinfo commands
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-10-04 11:40:38 +02:00