summaryrefslogtreecommitdiffstats
path: root/web/lib/pkgfuncs.inc.php
AgeCommit message (Collapse)AuthorFilesLines
2016-02-07Rename the CommentNotify table to PackageNotificationsLukas Fleischer1-3/+3
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>
2015-12-12Implement capability to pin comments above othersMark Weiman1-1/+50
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-10-24Highlight broken dependenciesLukas Fleischer1-0/+9
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-24Hide optdepend description if not availableLukas Fleischer1-1/+1
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-24Include trivial AUR providers in pkg_providers()Lukas Fleischer1-4/+5
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-24Always retrieve dependency providersLukas Fleischer1-11/+8
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-24Fix spacing of versioned dependenciesLukas Fleischer1-1/+1
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-10-21Track providers in the official repositoriesLukas Fleischer1-16/+48
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-09-25pkgfuncs.inc.php: Squelch PHP warningLukas Fleischer1-0/+1
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-09-23Add search for keywords onlyMarcel Korpel1-39/+64
Implements FS#45619. Signed-off-by: Marcel Korpel <marcel.korpel@gmail.com> Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-09-20Rename "Age" search order to "Last modified"Lukas Fleischer1-0/+4
Use a better description for sorting by modification time, as it is not clear whether "Age" refers to the package creation date or to the modification date. The possibility to sort by "Age" is kept internally (but hidden from the user interface) such that old links to search results still work. Fixes FS#46319. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-09-18Extract package name from detailsLukas Fleischer1-36/+0
When requesting package details, instead of performing another SQL query to obtain the package name, extract the name from the result of the package details query. Also, drop pkg_name_from_id() which is no longer needed after this optimization. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-09-18Remove legacy codeLukas Fleischer1-189/+0
In 74edb6f (Use Git repositories to store packages, 2014-06-06), package creation was moved to the Python backend. Remove several PHP functions that are no longer needed. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-09-17Honor virtual provisions in package requirementsLukas Fleischer1-5/+26
Implements FS#14125. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-09-17Use a separate function for "Required by" linksLukas Fleischer1-27/+65
Do not use the same function for generating dependency and inverse dependency links. Instead, factor out common code and create two separate functions for those (rather different) functionalities. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-09-16Show providers in dependenciesLukas Fleischer1-6/+59
For all "virtual provisions" in package dependencies, show links to the actual packages providing the dependency. This partly implements FS#14125. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-08-30Allow users to unflag packages they flagged themselvesLukas Fleischer1-1/+1
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-08Split pkg_comment_form.php so the outer box is not always includedMarcel Korpel1-1/+1
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-08Show popularity in package base detailsLukas Fleischer1-2/+2
Fixes FS#45600. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-08-08Support comment editing in the backendMarcel Korpel1-0/+26
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-08Add comment edit icon and formMarcel Korpel1-0/+14
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-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-19Remove can_submit_blacklisted()Lukas Fleischer1-12/+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-14Replace categories with keywordsLukas Fleischer1-24/+10
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-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-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-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-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-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>
2014-12-28Hide fresh package bases from stats and resultsLukas Fleischer1-1/+1
Do not show package bases that have just been created in the package update statistics or in the search results. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-12-27Use Git repositories to store packagesLukas Fleischer1-30/+1
* Remove package submission page from the web interface. * Replace PKGBUILD and tarball links with links to cgit. * Remove the "URLPath" field from RPC replies. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-11-21Always use virtual URLsLukas Fleischer1-1/+0
Support for non-virtual URLs has been broken for a long time and is no longer used on the official AUR setup. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-10-24Use an INI-style configuration fileLukas Fleischer1-6/+1
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-10Add support for architecture-specific sourcesLukas Fleischer1-6/+34
As a follow-up to 4d7da95 (Add support for architecture-specific fields, 2014-08-10), handle architecture-specific source fields as well. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-08-10Add support for architecture-specific fieldsLukas Fleischer1-15/+57
This adds support for architecture-specific dependencies and relations. Support for this has recently been added to makepkg, see commit 2b556d8 (PKGBUILD: handle arch specific attributes, 2014-07-25) in the pacman repository for details. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-07-29Allow users to delete their own commentsLukas Fleischer1-13/+5
Fixes a regression introduced in 03c6304 (Rework permission handling, 2014-07-15). Fixes FS#41379. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-07-25Make deleted comments visible to Trusted UsersLukas Fleischer1-1/+2
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-16Remove unused function pkg_details_by_name()Lukas Fleischer1-24/+0
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-07-15Rework permission handlingLukas Fleischer1-29/+7
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-01Simplify code to bound integer valuesLukas Fleischer1-12/+4
Suggested-by: Florian Pritz <bluewind@xinu.at> Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-06-07Fix latest_pkgs() againLukas Fleischer1-1/+2
In 4cd6841 (pkgfuncs.inc.php: Fix latest_pkgs(), 2014-05-29), latest_pkgs() was modified to work with the new database layout. However, since all columns were selected, package names have been overwritten by package base names since that change. Qualify the *-shorthand to avoid this. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-06-05Fix SQL query when searching for a missing submitterLukas Fleischer1-1/+1
uid_from_username() returns a non-integer value when the user does not exist. This results in a broken SQL query when searching for a nonexistent submitter. Fix this by explicitly converting the result of uid_from_username() to an integer. Fixes FS#40625. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-06-05Fix links to AUR packages in optional dependenciesLukas Fleischer1-0/+1
Extend the SQL query that tries to find a package's dependencies so that optional dependencies with a description are correctly resolved. Fixes FS#40700. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-05-29pkgfuncs.inc.php: Fix latest_pkgs()Lukas Fleischer1-2/+4
This fixes a regression introduced when adding split package support and makes the RSS feed work again. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-05-29Move latest_pkgs() to pkgfuncs.inc.phpLukas Fleischer1-0/+24
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2014-05-06Add a packager field to packagesLukas Fleischer1-1/+1
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>