Commit graph

780 commits

Author SHA1 Message Date
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
Johannes Löthberg
da1153857f rpc: msearch: Give orphans on empty maintainer argument
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-08-11 13:57:04 +02:00
Lukas Fleischer
080b6f3d12 aurjson.class.php: Add missing PHPDoc
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-08-08 12:59:24 +02:00
Marcel Korpel
8328223a5e aurjson.class.php: Add method get_comment_form()
This method will be used by the JavaScript comment editing and produces
a form containing the comment.

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
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
c751921aff Do not use the term "unsupported" for AUR packages
We no longer use the term [unsupported] to refer to the "repository" of
AUR packages. Update texts and variable names accordingly.

Fixes FS#45381.

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
8db2ff5da6 Set correct 'My Account' link after changing username
Don't print messages (and the account form) in process_account_form()
anymore, but return them to the caller. When updating accounts, this
function will be called before the headers are written.

If a username has been changed by process_account_form(), the headers
now show the updated username from the database in the 'My Account'
link. Clicking on it immediately after changing a username will no
longer lead to a non-existing URL.

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
7927a6decd Use username from the database if one is provided by the user
This fixes a bug where the new user name input by the user was
invalid, causing the account deletion link and the form action to be
wrong.

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
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
Marcel Korpel
92e19e95f3 Add comment edit icon and form
Show an icon next to the comment deletion icon, which leads to a
comment edit form.

Signed-off-by: Marcel Korpel <marcel.korpel@gmail.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-08-08 12:59:23 +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
d8142abbbe Expose name-only search through the RPC interface
Fixes FS#37317.

Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-08-08 12:59:23 +02:00
Johannes Löthberg
94aeead4ec aurjson: Pass http_data array to all functions
This is a preparatory patch that simplifies adding more arguments to
the parse functions

Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
Signed-off-by: Marcel Korpel <marcel.korpel@gmail.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-08-08 12:59:23 +02:00
Johannes Löthberg
838639056a Delete unused variable
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-08-08 12:59:23 +02:00
Lukas Fleischer
7fbf5a82f3 Release 4.0.0
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-08-08 12:58:28 +02:00
Lukas Fleischer
29bffe64ad stats.inc.php: Improve definition of "added"
Until now, a package is listed under "Packages added in the past 7 days"
if it was added at most one week ago and if the last modification time
matches the submission time stamp. A package is considered "updated" if
it was modified at most one week ago and the modification time stamp
differs from the submission time stamp.

Since we are using Git to store packages now, there always is a delay
between package creation (which is handled in git-serve) and last
modification (which is handled by git-update). Thus, by the above
definitions, almost every package is considered "updated".

Since there is no reason for excluding packages that were both added and
updated within the past seven days from the "Packages added in the past
7 days" counter, we can drop the check whether the last modification
time matches the submission time stamp. Also, to identify packages that
were actually updated, we now only count packages that were modified at
least one hour after the initial submission.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-07-14 11:17:19 +02:00
Daniel Micay
881b550dec use rel="nofollow" for links in comments
This removes the incentive for spammers to post links by asking search
engines to ignore them.

Signed-off-by: Daniel Micay <danielmicay@gmail.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-07-12 20:37:42 +02:00
Johannes Löthberg
ea59f72778 RPC: Add decimal_fields array for floating-point fields
Fixes FS#45537.

Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-07-04 13:02:37 +02:00
Lukas Fleischer
feeda37bb7 Accept SSH keys with whitespace in comments
`ssh-keygen -l` returns more than four tokens when there is whitespace
in the key comment.

Fixes FS#45488.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-29 08:59:35 +02:00
Lukas Fleischer
552a297a49 Release 4.0.0-rc6
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-28 12:59:41 +02:00
Johannes Löthberg
eb169d3b0b Only print no changes message if queries failed
This commit changes the messages printed when changing the accound
details so that it only prints that no changes were made if either the
account change SQL query or the account_set_ssh_keys call failed.

Reported-by: Alexis Chotard <alexis.horgix.chotard@gmail.com>
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-27 18:00:39 +02:00
Gordian Edenhofer
8bd03adb61 Fake pkgbase actions for unconfirmed users
Displaying flag, notify, vote, adopt and file request links for
users which did not authenticate themselves and letting those fake
buttons link to the login page.

Signed-off-by: Gordian Edenhofer <gordian.edenhofer@gmail.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-27 13:04:03 +02:00
Lukas Fleischer
b036b436aa Add support for multiple SSH public keys
Attaching more than one SSH public key to the same account is useful,
e.g. if one uses different machines to access the AUR SSH interface.
Multiple keys can now be specified by adding multiple lines to the text
area on the account edit form.

Implements FS#45469.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
Acked-by: Leonidas Spyropoulos <artafinde@gmail.com>
2015-06-27 13:04:03 +02:00
Lukas Fleischer
4bc990f9c0 Split out code to generate action links
Add (and use) two new helper functions html_account_link() and
html_account_form() to generate the links in the package actions box.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-27 13:04:03 +02:00
Lukas Fleischer
3dbaee80b4 Move registration code to a separate unit
Until now, we used the same unit to register and edit accounts. Split
these features into separate source files for clarity. This also allows
us to redirect to the home page when a logged-in user tries to access
the registration page.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-27 13:04:03 +02:00
Gordian Edenhofer
6395a5d5b8 Redirect at previous page after a successful login
After the user was authenticated a redirect to the site which
linked the user to the login page is done. This fixes FS#32481.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-27 13:04:03 +02:00
Lukas Fleischer
5a050552e8 Add the popularity field to the RPC interface
Implements FS#45422.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-27 13:04:03 +02:00
Lukas Fleischer
d1c331613d Display (reverse) optional dependencies as "Required by"
Also, change pkg_required() such that the returned array has the same
structure as the result of pkg_dependencies().

Fixes FS#45452.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-27 13:04:03 +02:00
Lukas Fleischer
6852a0c2af Add Arabic translation
Implements FS#45430.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-27 13:04:03 +02:00
Lukas Fleischer
0fa4836e66 Fix a warning when formatting user names
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-20 14:38:40 +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
2d7b68ac4c Remove can_submit_blacklisted()
This function is unneeded since commit 74edb6f (Use Git repositories to
store packages, 2014-06-06).

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-19 16:52:07 +02:00
Lukas Fleischer
6e3cbb9e65 Release 4.0.0-rc5
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-18 10:20:39 +02:00
Johannes Löthberg
815e437f0c confparser: Add function for getting the items of a section
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-14 17:58:56 +02:00
Johannes Löthberg
d8e32ce5e1 confparser: Add function for checking if config section exists
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-14 17:58:56 +02:00
Johannes Löthberg
9ef7de0569 confparser: Split loading of config into own function
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-14 17:58:56 +02:00
Lukas Fleischer
fb42ec696c Show co-maintainers next to maintainers in details
Implements FS#45313.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-14 17:58:56 +02:00
Lukas Fleischer
a2f79eb2e1 Refactor code for printing account links
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-14 17:58:56 +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
4c1bb8b7e5 Release 4.0.0-rc4
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-12 17:15:46 +02:00
Lukas Fleischer
3e75d9bb34 stats.inc.php: Show the 15 most recent updates
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-12 00:02:08 +02:00
Lukas Fleischer
15ee85b456 Show package popularity in search results
Display the popularity score (weighted votes) in the package search
results.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-11 19:15:44 +02:00
Lukas Fleischer
bd9af5f893 Reintroduce the URLPath field
In commit 74edb6f (Use Git repositories to store packages, 2014-06-06),
the URLPath field was dropped from RPC package results. Reintroduce the
field for backwards compatibility, even though it is no longer
recommended to use snapshot tarballs.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-11 13:44:53 +02:00
Lukas Fleischer
b870c0b682 Release 4.0.0-rc3
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-09 15:44:00 +02:00