summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpjmattal <pjmattal>2005-04-06 05:25:28 +0200
committerpjmattal <pjmattal>2005-04-06 05:25:28 +0200
commit20c02507ab2e9ea1f36910611b50b00f32a8365d (patch)
treede5bd868a876386cebe490c5a99d48237a2e691d
parent71b5b9e6b7e92fe1f2c0c49f47af1c1255f41e24 (diff)
downloadaur-20c02507ab2e9ea1f36910611b50b00f32a8365d.tar.gz
aur-20c02507ab2e9ea1f36910611b50b00f32a8365d.tar.xz
fixed multiple maintainer mess
-rw-r--r--web/html/packages.php51
-rw-r--r--web/lib/aur.inc14
-rw-r--r--web/lib/pkgfuncs.inc12
3 files changed, 49 insertions, 28 deletions
diff --git a/web/html/packages.php b/web/html/packages.php
index 48fc9a0b..210f1354 100644
--- a/web/html/packages.php
+++ b/web/html/packages.php
@@ -133,14 +133,16 @@ if (isset($_REQUEST["do_Flag"])) {
$disown .= ", ".$pid;
}
}
- if ($atype == "Trusted User" || $atype == "Developer") {
- $field = "AURMaintainerUID";
- } elseif ($atype == "User") {
- $field = "MaintainerUID";
- } else {
- $field = "";
- }
-
+ # Removed for now since we will have 1 maintainer
+ # PJM - 5 April 2005
+ # if ($atype == "Trusted User" || $atype == "Developer") {
+ # $field = "AURMaintainerUID";
+ # } elseif ($atype == "User") {
+ # $field = "MaintainerUID";
+ # } else {
+ # $field = "";
+ # }
+ $field = "MaintainerUID";
if ($field) {
$q = "UPDATE Packages ";
$q.= "SET ".$field." = 0 ";
@@ -184,13 +186,14 @@ if (isset($_REQUEST["do_Flag"])) {
$delete .= ", ".$pid;
}
}
- if ($atype == "Trusted User" || $atype == "Developer") {
- $field = "AURMaintainerUID";
- } elseif ($atype == "User") {
- $field = "MaintainerUID";
- } else {
- $field = "";
- }
+ # if ($atype == "Trusted User" || $atype == "Developer") {
+ # $field = "AURMaintainerUID";
+ # } elseif ($atype == "User") {
+ # $field = "MaintainerUID";
+ # } else {
+ # $field = "";
+ # }
+ $field = "MaintainerUID";
if ($field) {
# Only grab Unsupported packages that "we" own or are not owned at all
#
@@ -199,7 +202,7 @@ if (isset($_REQUEST["do_Flag"])) {
$q.= "WHERE Packages.ID IN (" . $delete . ") ";
$q.= "AND Packages.LocationID = PackageLocations.ID ";
$q.= "AND PackageLocations.Location = 'unsupported' ";
- $q.= "AND AURMaintainerUID IN (0, " . uid_from_sid($_COOKIE["AURSID"]) . ")";
+ $q.= "AND $field IN (0, " . uid_from_sid($_COOKIE["AURSID"]) . ")";
$result = db_query($q, $dbh);
if ($result != Null && mysql_num_rows($result) > 0) {
while ($row = mysql_fetch_assoc($result)) {
@@ -280,14 +283,14 @@ if (isset($_REQUEST["do_Flag"])) {
$adopt .= ", ".$pid;
}
}
- if ($atype == "Trusted User" || $atype == "Developer") {
- $field = "AURMaintainerUID";
- } elseif ($atype == "User") {
- $field = "MaintainerUID";
- } else {
- $field = "";
- }
-
+ # if ($atype == "Trusted User" || $atype == "Developer") {
+ # $field = "AURMaintainerUID";
+ # } elseif ($atype == "User") {
+ #$field = "MaintainerUID";
+ #} else {
+ # $field = "";
+ # }
+ $field = "MaintainerUID";
if ($field) {
# NOTE: Only "orphaned" packages can be adopted at a particular
# user class (TU/Dev or User).
diff --git a/web/lib/aur.inc b/web/lib/aur.inc
index 793ef7c4..0563da86 100644
--- a/web/lib/aur.inc
+++ b/web/lib/aur.inc
@@ -56,6 +56,20 @@ function getDevelopers() {
return $devs;
}
+# return an array of info for each user
+function getUsers() {
+ $users = array();
+ $dbh = db_connect();
+ $q = "SELECT * FROM Users ORDER BY Username ASC";
+ $result = db_query($q, $dbh);
+ if ($result) {
+ while ($row = mysql_fetch_assoc($result)) {
+ $users[$row["ID"]] = $row;
+ }
+ }
+ return $users;
+}
+
# see if the visitor is already logged in
#
function check_sid() {
diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc
index bef63005..b5428dde 100644
--- a/web/lib/pkgfuncs.inc
+++ b/web/lib/pkgfuncs.inc
@@ -444,6 +444,7 @@ function pkg_search_page($SID="") {
$cats = pkgCategories();
$devs = getDevelopers();
$tus = getTrustedUsers();
+ $users = getUsers();
$dbh = db_connect();
@@ -827,10 +828,13 @@ function pkg_search_page($SID="") {
# print the package manager, also determine if it is managed
#
$managed = 1;
- if (isset($devs[$row["AURMaintainerUID"]])) {
- print $devs[$row["AURMaintainerUID"]]["Username"];
- } elseif (isset($tus[$row["MaintainerUID"]])) {
- print $tus[$row["MaintainerUID"]]["Username"];
+ # if (isset($devs[$row["AURMaintainerUID"]])) {
+ # print $devs[$row["AURMaintainerUID"]]["Username"];
+ # } else
+ # if (isset($tus[$row["MaintainerUID"]])) {
+ # print $tus[$row["MaintainerUID"]]["Username"];
+ if (isset($users[$row["MaintainerUID"]])) {
+ print $users[$row["MaintainerUID"]]["Username"];
} else {
print __("None");
$managed = 0;