aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--web/config.php12
-rw-r--r--web/index.php32
-rw-r--r--web/process.php17
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 @@
?></textarea>
<br>
</div>
+ <div id="expert" class="step">
+ <h1>Expert</h1>
+
+ <label for="expert_use">USE flags</label>
+ <br />
+ <textarea id="expert_use" name="use"
+ style="width: 680px; height: 60px;"><?php
+ echo DEFAULT_USE;
+ ?></textarea>
+ <br><br />
+ <label for="expert_puse">Package USE</label>
+ <br />
+ <textarea id="expert_puse" name="puse"
+ style="width: 680px; height: 60px;"><?php
+ echo DEFAULT_PACKAGE_USE;
+ ?></textarea>
+ <br><br />
+ <label for="expert_features">Features</label>
+ <br />
+ <textarea id="expert_features" name="features"
+ style="width: 680px; height: 60px;"><?php
+ echo DEFAULT_FEATURES;
+ ?></textarea>
+ <br><br />
+ <label for="expert_keywords">Accept Keywords</label>
+ <br />
+ <textarea id="expert_keywords" name="keywords"
+ style="width: 680px; height: 60px;"><?php
+ echo DEFAULT_KEYWORDS;
+ ?></textarea>
+ <br>
+ </div>
<div id="format" class="step submit_step">
<h1>Image format</h1>
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";