summaryrefslogtreecommitdiffstats
path: root/web/lib/pkgfuncs.inc.php
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@archlinux.org>2017-01-26 09:02:46 +0100
committerLukas Fleischer <lfleischer@archlinux.org>2017-01-28 11:23:40 +0100
commit6cb8c041bc2264d02f7c86545170f45cc92d6caf (patch)
tree8d9e50836984b48f91e136ef58ec0e52b87377b9 /web/lib/pkgfuncs.inc.php
parent33095b3292bdb2fa5561bf257c86004eeddcfae9 (diff)
downloadaur-6cb8c041bc2264d02f7c86545170f45cc92d6caf.tar.gz
aur-6cb8c041bc2264d02f7c86545170f45cc92d6caf.tar.xz
Implement co-maintainer search
Add an option to filter package search results by co-maintainer. Partly fixes FS#45591. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
Diffstat (limited to 'web/lib/pkgfuncs.inc.php')
-rw-r--r--web/lib/pkgfuncs.inc.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/web/lib/pkgfuncs.inc.php b/web/lib/pkgfuncs.inc.php
index 4b0fdbac..8ca88352 100644
--- a/web/lib/pkgfuncs.inc.php
+++ b/web/lib/pkgfuncs.inc.php
@@ -670,6 +670,7 @@ function pkg_display_details($id=0, $row, $SID="") {
* B - package base name (exact match)
* k - package keyword(s)
* m - package maintainer's username
+ * c - package co-maintainer's username
* s - package submitter's username
* do_Orphans - boolean. whether to search packages
* without a maintainer
@@ -746,6 +747,13 @@ function pkg_search_page($SID="") {
/* Search by maintainer. */
$q_where .= "AND Users.Username = " . $dbh->quote($_GET['K']) . " ";
}
+ elseif (isset($_GET["SeB"]) && $_GET["SeB"] == "c") {
+ /* Search by co-maintainer. */
+ $q_where .= "AND EXISTS (SELECT * FROM PackageComaintainers ";
+ $q_where .= "INNER JOIN Users ON Users.ID = PackageComaintainers.UsersID ";
+ $q_where .= "WHERE PackageComaintainers.PackageBaseID = PackageBases.ID ";
+ $q_where .= "AND Users.Username = " . $dbh->quote($_GET['K']) . ")";
+ }
elseif (isset($_GET["SeB"]) && $_GET["SeB"] == "s") {
/* Search by submitter. */
$q_where .= "AND SubmitterUID = " . intval(uid_from_username($_GET['K'])) . " ";