More work on web setup form
This commit is contained in:
parent
6838694a8b
commit
acaf47c592
|
@ -167,15 +167,10 @@ $result = $r && $database;
|
||||||
</h3>
|
</h3>
|
||||||
<p>
|
<p>
|
||||||
<?php
|
<?php
|
||||||
|
global $extensions;
|
||||||
if (!isset($extensions)) {
|
|
||||||
$extensions = get_loaded_extensions();
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($extensions as $ext) {
|
foreach ($extensions as $ext) {
|
||||||
echo $ext . " | ";
|
echo $ext . " | ";
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
class InstallWizardController extends Zend_Controller_Action {
|
|
||||||
public function init() {
|
|
||||||
$this->view->layout()->disableLayout();
|
|
||||||
$this->_helper->viewRenderer->setNoRender(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function runAirtimeConfigurationAction() {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,7 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
require_once(LIB_PATH . "propel/runtime/lib/Propel.php");
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check to see if Airtime is properly configured.
|
* Check to see if Airtime is properly configured.
|
||||||
*
|
*
|
||||||
|
@ -42,9 +40,7 @@ function airtimeCheckMvcDependencies() {
|
||||||
* @return boolean true if the database dependencies exist
|
* @return boolean true if the database dependencies exist
|
||||||
*/
|
*/
|
||||||
function airtimeCheckDatabaseDependencies() {
|
function airtimeCheckDatabaseDependencies() {
|
||||||
if (!isset($extensions)) {
|
global $extensions;
|
||||||
$extensions = get_loaded_extensions();
|
|
||||||
}
|
|
||||||
// Check the PHP extension list for the Postgres db extensions
|
// Check the PHP extension list for the Postgres db extensions
|
||||||
return (in_array('pdo_pgsql', $extensions)
|
return (in_array('pdo_pgsql', $extensions)
|
||||||
&& in_array('pgsql', $extensions));
|
&& in_array('pgsql', $extensions));
|
||||||
|
@ -76,3 +72,17 @@ function airtimeCheckDatabaseConfiguration() {
|
||||||
function airtimeConfigureDatabase() {
|
function airtimeConfigureDatabase() {
|
||||||
Propel::init(CONFIG_PATH . 'airtime-conf-production.php');
|
Propel::init(CONFIG_PATH . 'airtime-conf-production.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function airtimeValidateDatabaseSettings($settings) {
|
||||||
|
global $airtimeSetup;
|
||||||
|
if (!$airtimeSetup) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$dbUser = $settings["dbUser"];
|
||||||
|
$dbPass = $settings["dbPass"];
|
||||||
|
$dbName = $settings["dbName"];
|
||||||
|
$dbHost = $settings["dbHost"];
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
|
@ -1,12 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
foreach($_POST as $e) {
|
|
||||||
echo $e;
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<html style="background-color:#111141;">
|
<html style="background-color: #111141;">
|
||||||
<head>
|
<head>
|
||||||
<link rel="stylesheet" type="text/css" href="css/bootstrap-3.3.1.min.css">
|
<link rel="stylesheet" type="text/css" href="css/bootstrap-3.3.1.min.css">
|
||||||
<script type="text/javascript" src="js/libs/jquery-1.8.3.min.js"></script>
|
<script type="text/javascript" src="js/libs/jquery-1.8.3.min.js"></script>
|
||||||
|
@ -17,19 +13,19 @@
|
||||||
<h3 style="margin: 1em 0;">Database Settings</h3>
|
<h3 style="margin: 1em 0;">Database Settings</h3>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="sr-only" for="dbUser">Database Username</label>
|
<label class="sr-only" for="dbUser">Database Username</label>
|
||||||
<input required class="form-control" type="text" id="dbUser" placeholder="Username"/>
|
<input required class="form-control" type="text" name="dbUser" id="dbUser" placeholder="Username"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="sr-only" for="dbPass">Database Password</label>
|
<label class="sr-only" for="dbPass">Database Password</label>
|
||||||
<input required class="form-control" type="password" id="dbPass" placeholder="Password"/>
|
<input required class="form-control" type="password" name="dbPass" id="dbPass" placeholder="Password"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="sr-only" for="dbName">Database Name</label>
|
<label class="sr-only" for="dbName">Database Name</label>
|
||||||
<input required class="form-control" type="text" id="dbName" placeholder="Name"/>
|
<input required class="form-control" type="text" name="dbName" id="dbName" placeholder="Name"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="sr-only" for="dbHost">Database Host</label>
|
<label class="sr-only" for="dbHost">Database Host</label>
|
||||||
<input required class="form-control" type="text" id="dbHost" placeholder="Host" value="localhost"/>
|
<input required class="form-control" type="text" name="dbHost" id="dbHost" placeholder="Host" value="localhost"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<input type="submit" class="btn btn-default"/>
|
<input type="submit" class="btn btn-default"/>
|
||||||
|
@ -39,10 +35,10 @@
|
||||||
<script>
|
<script>
|
||||||
$("#dbSettingsForm").submit(function(e) {
|
$("#dbSettingsForm").submit(function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
var d = $('#dbSettingsForm').serializeArray();
|
||||||
$.post('#', $('form').serialize(), function(data) {
|
$.post('setup/functions.php?fn=airtimeValidateDatabaseSettings', d, function(data) {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
});
|
}, "json");
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
global $configRun;
|
$configRun = false;
|
||||||
global $extensions;
|
$extensions = get_loaded_extensions();
|
||||||
|
$airtimeSetup = false;
|
||||||
|
|
||||||
function showConfigCheckPage() {
|
function showConfigCheckPage() {
|
||||||
if (!isset($configRun) || !$configRun) {
|
global $configRun;
|
||||||
|
if (!$configRun) {
|
||||||
// This will run any necessary setup we need if
|
// This will run any necessary setup we need if
|
||||||
// configuration hasn't been initialized
|
// configuration hasn't been initialized
|
||||||
airtimeCheckConfiguration();
|
airtimeCheckConfiguration();
|
||||||
|
@ -24,6 +26,7 @@ define('CONFIG_PATH', APPLICATION_PATH . 'configs/');
|
||||||
|
|
||||||
define('AIRTIME_CONFIG', 'airtime.conf');
|
define('AIRTIME_CONFIG', 'airtime.conf');
|
||||||
|
|
||||||
|
require_once(LIB_PATH . "propel/runtime/lib/Propel.php");
|
||||||
require_once(CONFIG_PATH . 'conf.php');
|
require_once(CONFIG_PATH . 'conf.php');
|
||||||
require_once(SETUP_PATH . 'load.php');
|
require_once(SETUP_PATH . 'load.php');
|
||||||
|
|
||||||
|
@ -53,6 +56,7 @@ if (file_exists(BUILD_PATH . AIRTIME_CONFIG)) {
|
||||||
}
|
}
|
||||||
// Otherwise, we'll need to run our configuration setup
|
// Otherwise, we'll need to run our configuration setup
|
||||||
else {
|
else {
|
||||||
|
$airtimeSetup = true;
|
||||||
require_once(SETUP_PATH . 'setup-config.php');
|
require_once(SETUP_PATH . 'setup-config.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue