summaryrefslogtreecommitdiffstats
path: root/web/lib/pkgbasefuncs.inc.php
diff options
context:
space:
mode:
authorLukas Fleischer <archlinux@cryptocrack.de>2014-05-06 20:52:32 +0200
committerLukas Fleischer <archlinux@cryptocrack.de>2014-05-06 20:52:32 +0200
commita93363ac08ade0b17b342c5238efb37fc5d15741 (patch)
treeb95c7b2b78c20cf04000e363acca466a31de5094 /web/lib/pkgbasefuncs.inc.php
parent0e368510f47a934895024fe34714bfcc5f90bc3f (diff)
downloadaur-a93363ac08ade0b17b342c5238efb37fc5d15741.tar.gz
aur-a93363ac08ade0b17b342c5238efb37fc5d15741.tar.xz
Add a packager field to packages
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>
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 4eaa6404..4d05b945 100644
--- a/web/lib/pkgbasefuncs.inc.php
+++ b/web/lib/pkgbasefuncs.inc.php
@@ -182,7 +182,8 @@ function pkgbase_get_details($base_id) {
$q.= "PackageBases.CategoryID, PackageBases.NumVotes, ";
$q.= "PackageBases.OutOfDateTS, PackageBases.SubmittedTS, ";
$q.= "PackageBases.ModifiedTS, PackageBases.SubmitterUID, ";
- $q.= "PackageBases.MaintainerUID, PackageCategories.Category ";
+ $q.= "PackageBases.MaintainerUID, PackageBases.PackagerUID, ";
+ $q.= "PackageCategories.Category ";
$q.= "FROM PackageBases, PackageCategories ";
$q.= "WHERE PackageBases.CategoryID = PackageCategories.ID ";
$q.= "AND PackageBases.ID = " . intval($base_id);
@@ -917,9 +918,10 @@ function pkgbase_change_category($base_id, $atype) {
function pkgbase_create($name, $category_id, $uid) {
$dbh = DB::connect();
$q = sprintf("INSERT INTO PackageBases (Name, CategoryID, " .
- "SubmittedTS, ModifiedTS, SubmitterUID, MaintainerUID) " .
- "VALUES (%s, %d, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), %d, %d)",
- $dbh->quote($name), $category_id, $uid, $uid);
+ "SubmittedTS, ModifiedTS, SubmitterUID, MaintainerUID, " .
+ "PackagerUID) VALUES (%s, %d, UNIX_TIMESTAMP(), " .
+ "UNIX_TIMESTAMP(), %d, %d, %d)",
+ $dbh->quote($name), $category_id, $uid, $uid, $uid);
$dbh->exec($q);
return $dbh->lastInsertId();
}
@@ -937,8 +939,9 @@ function pkgbase_update($base_id, $name, $uid) {
$dbh = DB::connect();
$q = sprintf("UPDATE PackageBases SET " .
"Name = %s, ModifiedTS = UNIX_TIMESTAMP(), " .
- "MaintainerUID = %d, OutOfDateTS = NULL WHERE ID = %d",
- $dbh->quote($name), $uid, $base_id);
+ "MaintainerUID = %d, PackagerUID = %d, OutOfDateTS = NULL " .
+ "WHERE ID = %d",
+ $dbh->quote($name), $uid, $uid, $base_id);
$dbh->exec($q);
}