summaryrefslogtreecommitdiff
path: root/web/lib/pkgbasefuncs.inc.php
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@archlinux.org>2015-05-22 19:53:19 +0200
committerLukas Fleischer <lfleischer@archlinux.org>2015-05-22 21:14:24 +0200
commitc6e09def2b75762128f432130556ec6121fd8b8c (patch)
tree9a665d9a46de6d09927b5795676b7cc3762e99cc /web/lib/pkgbasefuncs.inc.php
parent0b8c11a37ae9dbaa5ca4cf64204515db31ea2b3a (diff)
Fix processing of pkgbase_get_comaintainers()
pkgbase_get_comaintainers() returns an array of user names, not an array of user IDs. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
Diffstat (limited to 'web/lib/pkgbasefuncs.inc.php')
-rw-r--r--web/lib/pkgbasefuncs.inc.php15
1 files changed, 9 insertions, 6 deletions
diff --git a/web/lib/pkgbasefuncs.inc.php b/web/lib/pkgbasefuncs.inc.php
index b8da23c..5b8b52f 100644
--- a/web/lib/pkgbasefuncs.inc.php
+++ b/web/lib/pkgbasefuncs.inc.php
@@ -646,12 +646,15 @@ function pkgbase_adopt ($base_ids, $action=true, $via) {
}
} else {
foreach ($base_ids as $base_id) {
- $uids = pkgbase_get_comaintainers($base_id);
-
- $q = "UPDATE PackageBases ";
- $q.= "SET MaintainerUID = " . $uids[0] . " ";
- $q.= "WHERE ID = " . $base_id;
- $dbh->exec($q);
+ $comaintainers = pkgbase_get_comaintainers($base_id);
+
+ if (count($comaintainers) > 0) {
+ $uid = uid_from_username($comaintainers[0]);
+ $q = "UPDATE PackageBases ";
+ $q.= "SET MaintainerUID = " . $uid . " ";
+ $q.= "WHERE ID = " . $base_id;
+ $dbh->exec($q);
+ }
}
}
}