From 2f56688b56757a3365ee4cc48f1bd139216c74f9 Mon Sep 17 00:00:00 2001 From: Callan Barrett Date: Tue, 15 Jan 2008 13:25:29 +0900 Subject: Prefill category upon upload error and fix bug in last patch When a package upload fails the category value will be prefilled, fixes a bug in the previous patch where the pkgbuild would not extract properly and splits the html from php in the form so there are no more prints to output it Signed-off-by: Callan Barrett --- web/html/pkgsubmit.php | 87 ++++++++++++++++++++++---------------------------- 1 file changed, 39 insertions(+), 48 deletions(-) (limited to 'web/html') diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php index ccf66c19..2c0c7d08 100644 --- a/web/html/pkgsubmit.php +++ b/web/html/pkgsubmit.php @@ -37,7 +37,7 @@ if ($_COOKIE["AURSID"]) { # temporary dir to put the tarball contents $tempdir = uid_from_sid($_COOKIE['AURSID']) . time(); - + if (!$error) { if (!@mkdir(UPLOAD_DIR . $tempdir)) { $error = __("Could not create incoming directory: %s.", @@ -48,8 +48,8 @@ if ($_COOKIE["AURSID"]) { array(UPLOAD_DIR . $tempdir)); } else { # try using general tar. it should take .gz, .bz2, and plain .tar - exec("/bin/sh -c 'tar xf ".$upload_file."'", $trash, $retval); - if (!$retval) { + exec("/bin/sh -c 'tar xf ".$_FILES['pfile']['tmp_name']."'", $trash, $retval); + if ($retval) { $error = __("Unknown file format for uploaded file."); } } @@ -520,52 +520,43 @@ if ($_COOKIE["AURSID"]) { $pkg_categories = pkgCategories(); $pkg_locations = pkgLocations(); +?> - print "
\n"; - print "\n"; - print "\n"; - print "\n"; - print "\n"; - print " \n"; - print " \n"; - print "\n"; -# print "\n"; -# print " \n"; -# print " \n"; -# print "\n"; - print "\n"; - print " \n"; - print " \n"; - print "\n"; - - print "\n"; - print " \n"; - print " \n"; - print "\n"; - print "
"; - print __("Package Category").":"; - print "
"; -# print __("Package Location").":"; -# print "
"; - print __("Upload package file").":"; - print "\n"; - print "
 "; - print "\n"; - print "
\n"; - - print "
\n"; +
+ + + + + + + + + + + + + +
: + +
: + +
+ +
+
+ +\n"; -- cgit v1.2.3-24-g4f1b