From cbe2050420a65349a5fcf1f4cce6e7c76490f881 Mon Sep 17 00:00:00 2001 From: eric Date: Mon, 12 Jul 2004 22:12:42 +0000 Subject: started on the package submit script --- web/html/pkgsubmit.php | 29 +++++++++++++++++++++++++---- web/lib/aur.inc | 23 +++++++++++++++++++++++ 2 files changed, 48 insertions(+), 4 deletions(-) (limited to 'web') diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php index 60b6dc5..02f3c05 100644 --- a/web/html/pkgsubmit.php +++ b/web/html/pkgsubmit.php @@ -5,12 +5,33 @@ set_lang(); # this sets up the visitor's language check_sid(); # see if they're still logged in html_header(); # print out the HTML header - -# Any text you print out to the visitor, use the __() function -# for i18n support. See 'testpo.php' for more details. +# this is the directory that new packages will be uploaded to # -print __("Under construction...")."
\n"; +$UPLOAD_DIR = "/tmp/aur/temp"; + +if ($_REQUEST["upload"]) { + # try and process the upload + # +} else { + # give the visitor the default upload page + # + print "
\n"; + if (ini_get("file_uploads")) { + print "
\n"; + print "\n"; + print "Upload package: "; + print "\n"; + print "    "; + print "\n"; + print "
\n"; + } else { + print "Sorry, uploads are not permitted by this server.\n
\n"; + } + print "
\n"; +} html_footer("\$Id$"); ?> diff --git a/web/lib/aur.inc b/web/lib/aur.inc index 7ea1e96..686154f 100644 --- a/web/lib/aur.inc +++ b/web/lib/aur.inc @@ -444,5 +444,28 @@ function dbug($msg) { return; } +# convert an ini_get number to a real integer - stupid PHP! +# +function initeger($inival="0", $isbytes=1) { + $last_char = strtolower(substr($inival, -1)); + if ($isbytes) { + switch ($last_char) { + case 't': $multiplier = 1024 * 1024 * 1024; break; + case 'm': $multiplier = 1024 * 1024; break; + case 'k': $multiplier = 1024; break; + default: $multiplier = 1; break; + } + } else { + switch ($last_char) { + case 't': $multiplier = 1000 * 1000 * 1000; break; + case 'm': $multiplier = 1000 * 1000; break; + case 'k': $multiplier = 1000; break; + default: $multiplier = 1; break; + } + } + + return intval($inival) * $multiplier; +} + # vim: ts=2 sw=2 noet ft=php ?> -- cgit v1.2.3-70-g09d2