summaryrefslogtreecommitdiffstats
path: root/web/lib
AgeCommit message (Collapse)AuthorFilesLines
2015-06-29Accept SSH keys with whitespace in commentsHEADmasterLukas Fleischer1-1/+1
`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-28Release 4.0.0-rc6Lukas Fleischer1-1/+1
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-27Only print no changes message if queries failedJohannes Löthberg1-2/+2
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-27Fake pkgbase actions for unconfirmed usersGordian Edenhofer1-9/+19
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-27Add support for multiple SSH public keysLukas Fleischer1-19/+134
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-27Split out code to generate action linksLukas Fleischer1-0/+37
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-27Move registration code to a separate unitLukas Fleischer1-1/+1
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-27Redirect at previous page after a successful loginGordian Edenhofer1-1/+6
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-27Add the popularity field to the RPC interfaceLukas Fleischer1-1/+13
Implements FS#45422. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-27Display (reverse) optional dependencies as "Required by"Lukas Fleischer1-5/+8
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-27Add Arabic translationLukas Fleischer1-0/+1
Implements FS#45430. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-20Fix a warning when formatting user namesLukas Fleischer1-1/+1
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-19Remove can_submit_blacklisted()Lukas Fleischer2-14/+0
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-18Release 4.0.0-rc5Lukas Fleischer1-1/+1
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-14confparser: Add function for getting the items of a sectionJohannes Löthberg1-0/+7
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com> Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-14confparser: Add function for checking if config section existsJohannes Löthberg1-0/+7
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com> Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-14confparser: Split loading of config into own functionJohannes Löthberg1-1/+6
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com> Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-14Show co-maintainers next to maintainers in detailsLukas Fleischer1-0/+25
Implements FS#45313. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-14Refactor code for printing account linksLukas Fleischer1-2/+11
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-14Replace categories with keywordsLukas Fleischer4-96/+63
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-12Release 4.0.0-rc4Lukas Fleischer1-1/+1
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-12stats.inc.php: Show the 15 most recent updatesLukas Fleischer1-1/+1
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-11Show package popularity in search resultsLukas Fleischer1-2/+5
Display the popularity score (weighted votes) in the package search results. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-11Reintroduce the URLPath fieldLukas Fleischer1-1/+1
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-09Release 4.0.0-rc3Lukas Fleischer1-1/+1
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-09Invert order when sorting packages by ageLukas Fleischer1-1/+1
Fixes FS#44195. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-09Drop suffixes from confirm parametersLukas Fleischer1-1/+1
Remove the _delete and _disown suffixes from HTTP POST confirmation parameters. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-09Add Spanish (Latin America) and Asturian translationsLukas Fleischer1-0/+2
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-09Fix official language name of CzechLukas Fleischer1-1/+1
Reported-by: Pablo Lezaeta Reyes <prflr88@gmail.com> Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-09aurjson.class.php: Exclude hidden package basesLukas Fleischer1-6/+13
Do not return packages belonging to hidden package bases in RPC results. Fixes FS#45271. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-08Release 4.0.0-rc2Lukas Fleischer1-1/+1
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-08Fix searching for an empty stringLukas Fleischer1-4/+6
Return all packages when an empty search term is used with keyword search. Reported-by: G. Schlisio <g.schlisio@dukun.de> Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-08Fix package statisticsLukas Fleischer1-8/+26
Exclude hidden package bases from the package statistics. Reported-by: Johannes Löthberg <johannes@kyriasis.com> Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-08Add Chinese (Taiwan) translationsLukas Fleischer1-1/+2
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-08Release 4.0.0-rc1Lukas Fleischer1-1/+1
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-04pkgfuncs.inc.php: Remove a conflict markerLukas Fleischer1-1/+0
Remove a Git conflict marker that was added accidentally in 74edb6f (Use Git repositories to store packages, 2014-06-06). Reported-by: Johannes Löthberg <johannes@kyriasis.com> Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-05-31Allow for resetting the SSH public keyLukas Fleischer1-2/+2
Use NULL instead of an empty string if the SSH public key field is left empty. Additionally, do not check for duplicate keys in that case. Fixes FS#45109. 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-22Support boolean operators in search queriesLukas Fleischer1-1/+18
This adds very basic support for boolean search queries such as "video or movie" or "lin and not linux". However, nested queries such as "(video or movie) and editing" are not (yet) supported. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-05-22Do not allow more than 20 terms in search queriesLukas Fleischer1-0/+11
Specifying a huge number of search terms currently results in complex SQL queries. In practice, queries with more than 20 terms are rarely needed. Ignore everything apart from the first 20 keywords to prevent from potential abuse. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-05-22Use keyword search by defaultLukas Fleischer1-3/+5
Change the default search mode such that packages that contain all of the space-separated search terms are returned. For example, the query image edit "command line" returns all packages where "image", "edit" and "command line" occurs in the package name or description. This is much more convenient and general than a simple substring search (one can still perform a substring search by quoting the whole search term). Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-05-21Make the type parameter of pkgreq_by_pkgbase() optionalLukas Fleischer2-7/+7
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 Fleischer2-1/+51
Close requests automatically when a package is deleted or orphaned. Implements FS#43799. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>