summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/pages/configurations/manager.php')
-rw-r--r--frontend/pages/configurations/manager.php18
1 files changed, 8 insertions, 10 deletions
diff --git a/frontend/pages/configurations/manager.php b/frontend/pages/configurations/manager.php
index dfd8322..6396aaa 100644
--- a/frontend/pages/configurations/manager.php
+++ b/frontend/pages/configurations/manager.php
@@ -1,20 +1,18 @@
<?php
-function init_configurations_manager() {
- global $S;
+function init_configurations_manager(&$S) {
if (!isset($S['user'])) {
return 'login';
}
return array('title' => 'Manage Configurations');
}
-function body_configurations_manager() {
- global $S, $request, $conf;
+function body_configurations_manager(&$S) {
echo '<h3>Configurations Manager</h3>';
- if (isset($request['build']) && isset($request['configuration'])) {
- $c=new sql_configuration($request['configuration']);
+ if (isset($_REQUEST['build']) && isset($_REQUEST['configuration'])) {
+ $c=new sql_configuration($_REQUEST['configuration']);
if ($c->owner!=$S['user']->id) {
echo print_error('You do not have permission to build this configuration.');
} else {
- $name=isset($request['name'])?$request['name']:null;
+ $name=isset($_REQUEST['name'])?$_REQUEST['name']:null;
$build=$c->build($name);
if (is_object($build))
echo print_success('Submitted for build - <a href="'.url("build/$build->id").'">Logs</a>');
@@ -22,12 +20,12 @@ function body_configurations_manager() {
echo print_error('Invalid configuration', 'Your configuration could not be submitted for build. Please return to <a href="'.url("config/$c->id/$build").'">step '.$build.'</a> and continue configuration from there.');
}
}
- $r=$S['pdo']->query('SELECT * FROM `configurations` WHERE `owner`='.$S['user']->id);
+ $r=query('SELECT * FROM `configurations` WHERE `owner`='.$S['user']->id);
if ($r->rowCount() == 0) {
echo print_warning('You have no configurations.').'<a href="'.url('create').'">Create a configuration</a>';
return;
}
- echo '<form action="'.url('configurations').'" method="post"><table><tr><th>ID</th><th>Name</th>'.(count($conf['modules']) > 1?'<th>Module</th>':'').'<th>Status</th><th>Options</th><th>Builds</th></tr>'."\n";
+ echo '<form action="'.url('configurations').'" method="post"><table><tr><th>ID</th><th>Name</th>'.(count($S['conf']['modules']) > 1?'<th>Module</th>':'').'<th>Status</th><th>Options</th><th>Builds</th></tr>'."\n";
$ready=0;
while($c=$r->fetch(PDO::FETCH_ASSOC)) {
$c=new sql_configuration($c);
@@ -39,7 +37,7 @@ function body_configurations_manager() {
echo $c->id;
}
echo '</td><td>'.(isset($c->name) && strlen($c->name)?htmlentities($c->name):'<i>Unnamed</i>').'</td><td>';
- if (count($conf['modules']) > 1) {
+ if (count($S['conf']['modules']) > 1) {
echo "$c->module</td><td>";
}
if ($c->status > 0) {