summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
Diffstat (limited to 'web')
-rw-r--r--web/html/pkgsubmit.php12
-rw-r--r--web/lib/aur.inc2
2 files changed, 8 insertions, 6 deletions
diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php
index b55a7205..ccbd35e7 100644
--- a/web/html/pkgsubmit.php
+++ b/web/html/pkgsubmit.php
@@ -255,15 +255,14 @@ if ($_COOKIE["AURSID"]):
$dbh = db_connect();
- # This is an overwrite of an existing package, the database ID
- # needs to be preserved so that any votes are retained. However,
- # PackageDepends and PackageSources can be purged.
-
$q = "SELECT * FROM Packages WHERE Name = '" . mysql_real_escape_string($new_pkgbuild['pkgname']) . "'";
$result = db_query($q, $dbh);
$pdata = mysql_fetch_assoc($result);
if ($pdata) {
+ # This is an overwrite of an existing package, the database ID
+ # needs to be preserved so that any votes are retained. However,
+ # PackageDepends and PackageSources can be purged.
# Flush out old data that will be replaced with new data
$q = "DELETE FROM PackageDepends WHERE PackageID = " . $pdata["ID"];
@@ -291,13 +290,14 @@ if ($_COOKIE["AURSID"]):
}
# Update package data
- $q = sprintf("UPDATE Packages SET ModifiedTS = UNIX_TIMESTAMP(), Name = '%s', Version = '%s-%s', License = '%s', Description = '%s', URL = '%s', OutOfDateTS = NULL WHERE ID = %d",
+ $q = sprintf("UPDATE Packages SET ModifiedTS = UNIX_TIMESTAMP(), Name = '%s', Version = '%s-%s', License = '%s', Description = '%s', URL = '%s', OutOfDateTS = NULL, MaintainerUID = '%d' WHERE ID = %d",
mysql_real_escape_string($new_pkgbuild['pkgname']),
mysql_real_escape_string($new_pkgbuild['pkgver']),
mysql_real_escape_string($new_pkgbuild['pkgrel']),
mysql_real_escape_string($new_pkgbuild['license']),
mysql_real_escape_string($new_pkgbuild['pkgdesc']),
mysql_real_escape_string($new_pkgbuild['url']),
+ uid_from_sid($_COOKIE["AURSID"]),
$pdata["ID"]);
db_query($q, $dbh);
@@ -329,6 +329,8 @@ if ($_COOKIE["AURSID"]):
}
}
+ if (!$pdata["MaintainerUID"]) pkg_notify(account_from_sid($_COOKIE["AURSID"]), array($pdata["ID"]));
+
header('Location: packages.php?ID=' . $pdata['ID']);
} else {
diff --git a/web/lib/aur.inc b/web/lib/aur.inc
index 835b8a85..5a60c4c6 100644
--- a/web/lib/aur.inc
+++ b/web/lib/aur.inc
@@ -339,7 +339,7 @@ function can_submit_pkg($name="", $sid="") {
if ($row[1] == "1") { return 1; }
$my_uid = uid_from_sid($sid);
- if ($row[0] == $my_uid) {
+ if (!$row[0] || $row[0] == $my_uid) {
return 1;
}