From 5bcf585222474363c28c9ad34360877968efcbce Mon Sep 17 00:00:00 2001 From: Liam McLoughlin Date: Thu, 28 Jul 2011 01:56:34 +0100 Subject: Adding USE, package USE, FEATURES and keywords to WebUI --- web/config.php | 12 ++++++++++++ web/index.php | 32 ++++++++++++++++++++++++++++++++ web/process.php | 17 ++++++++++------- 3 files changed, 54 insertions(+), 7 deletions(-) diff --git a/web/config.php b/web/config.php index 1d1cb2e..210d1db 100644 --- a/web/config.php +++ b/web/config.php @@ -11,6 +11,18 @@ // What should we set as the default list of packages? define("DEFAULT_PACKAGES", "dhcpd"); + + // What should we set as the default list of packages? + define("DEFAULT_USE", ""); + + // What should we set as the default list of packages? + define("DEFAULT_PACKAGE_USE", ""); + + // What should we set as the default list of packages? + define("DEFAULT_FEATURES", "parallel-fetch userfetch userpriv getbinpkg"); + + // What should we set as the default list of packages? + define("DEFAULT_KEYWORDS", ""); // What should we limit the virtual machine disk size to? define("MAX_DISK_SIZE", 16384); diff --git a/web/index.php b/web/index.php index 99b9cf0..55484d0 100644 --- a/web/index.php +++ b/web/index.php @@ -190,6 +190,38 @@ ?>
+
+

Expert

+ + +
+ +

+ +
+ +

+ +
+ +

+ +
+ +
+

Image format

diff --git a/web/process.php b/web/process.php index a005319..e0bf38a 100644 --- a/web/process.php +++ b/web/process.php @@ -40,6 +40,8 @@ function sanitize_shellarg($arg) { + $arg = str_replace("\r\n", " ", $arg); + $arg = str_replace("\n", " ", $arg); return escapeshellarg($arg); } $sfi = array("options" => "sanitize_shellarg"); @@ -54,11 +56,12 @@ $password = filter_input(INPUT_POST, "password", FILTER_CALLBACK, $sfi); $rootPass = filter_input(INPUT_POST, "rootpassword", FILTER_CALLBACK, $sfi); $packagesList = filter_input(INPUT_POST, "packages", FILTER_CALLBACK, $sfi); + $use = filter_input(INPUT_POST, "use", FILTER_CALLBACK, $sfi); + $puse = filter_input(INPUT_POST, "puse", FILTER_CALLBACK, $sfi); + $features = filter_input(INPUT_POST, "features", FILTER_CALLBACK, $sfi); + $keywords = filter_input(INPUT_POST, "keywords", FILTER_CALLBACK, $sfi); $outputFormat = filter_input(INPUT_POST, "format", FILTER_CALLBACK, $sfi); - $packagesList = str_replace("\r\n", " ", $packagesList); - $packagesList = str_replace("\n", " ", $packagesList); - $iniString = "[vmconfig] BUILD_ID='$buildID' @@ -70,10 +73,10 @@ HOSTNAME=$hostname ROOT_PASSWORD=$rootPass DEFAULT_USERNAME=$username DEFAULT_PASSWORD=$password -USE_FLAGS='' -PACKAGE_USE='' -FEATURES='parallel-fetch userfetch userpriv getbinpkg' -PACKAGE_ACCEPT_KEYWORDS='' +USE_FLAGS='$use' +PACKAGE_USE='$puse' +FEATURES='$features' +PACKAGE_ACCEPT_KEYWORDS='$keywords' PACKAGES_LIST=$packagesList OUTPUT_FORMAT=$outputFormat"; -- cgit v1.2.3-65-gdbad