summaryrefslogtreecommitdiffstats
path: root/web/lib/aur.inc
diff options
context:
space:
mode:
authorCallan Barrett <wizzomafizzo@gmail.com>2008-01-11 17:01:19 +0100
committerDan McGee <dan@archlinux.org>2008-01-20 07:21:20 +0100
commitdbbf50ac9024dddb5ce70b8aa42c828596eb66d3 (patch)
treea1c286f5c540a780440b165e2b4528f2f6df80d7 /web/lib/aur.inc
parentce225727f67f5b65b5f92ec96b074712c290ea63 (diff)
downloadaur-dbbf50ac9024dddb5ce70b8aa42c828596eb66d3.tar.gz
aur-dbbf50ac9024dddb5ce70b8aa42c828596eb66d3.tar.xz
Removes need for name, overwrite and comment fields from pkgsubmit.php
This removes the name, overwrite and comment options from pkgsubmit.php by moving when the tarball is extracted (and where) and when the pkgbuild is parsed so pkgname is taken from the pkgbuild instead of user input Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
Diffstat (limited to 'web/lib/aur.inc')
-rw-r--r--web/lib/aur.inc22
1 files changed, 8 insertions, 14 deletions
diff --git a/web/lib/aur.inc b/web/lib/aur.inc
index 02580604..c18365cc 100644
--- a/web/lib/aur.inc
+++ b/web/lib/aur.inc
@@ -7,6 +7,7 @@ header('Pragma: no-cache');
include_once("version.inc");
include_once("config.inc");
include_once("aur_po.inc");
+// TODO: remove this, move translations over for login form
include_once("index_po.inc");
# TODO do we need to set the domain on cookies? I seem to remember some
@@ -425,29 +426,22 @@ function dbug($msg) {
return;
}
-# check to see if the user can overwrite an existing package
+# check to see if the user can submit a package
#
-function can_overwrite_pkg($name="", $sid="") {
+function can_submit_pkg($name="", $sid="") {
if (!$name || !$sid) {return 0;}
$dbh = db_connect();
- $q = "SELECT SubmitterUID, MaintainerUID, AURMaintainerUID ";
+ $q = "SELECT MaintainerUID ";
$q.= "FROM Packages WHERE Name = '".mysql_real_escape_string($name)."'";
$result = db_query($q, $dbh);
- if (!$result) {return 0;}
+ if (mysql_num_rows($result) == 0) {return 1;}
$row = mysql_fetch_row($result);
$my_uid = uid_from_sid($sid);
- # user is a dev and maintains the package
- #
- if ($my_uid == $row[2]) {return 1;}
-
- # user is a TU and there is no dev
- #
- if (!$row[2] && $my_uid == $row[1]) {return 1;}
+ if ($row[0] == $my_uid) {
+ return 1;
+ }
- # user is a user and there is no TU or dev
- #
- if (!$row[2] && !$row[1] && $my_uid == $row[0]) {return 1;}
return 0;
}