myaac/install/index.php
slawkens1 08fce2ade4 * Fixed
* full support for OTHire 0.0.3
* added support for otservers that doesn't use account.name field,
instead just account number will be used
* (install) moved admin account creation to new step
* fixed encryption detection on 0.3
* fixed bug when server_config table doesn't exist
* other fixes
2017-05-03 23:48:04 +02:00

49 lines
1.0 KiB
PHP

<?php
require('../common.php');
// step
$step = isset($_POST['step']) ? $_POST['step'] : 'welcome';
// includes
require(SYSTEM . 'functions.php');
require(BASE . 'install/includes/functions.php');
require(BASE . 'install/includes/locale.php');
require(BASE . 'config.local.php');
if(isset($_POST['vars']))
{
foreach($_POST['vars'] as $key => $value)
$_SESSION['var_' . $key] = $value;
}
$steps = array(1 => 'welcome', 2 => 'license', 3 => 'requirements', 4 => 'config', 5 => 'database', 6 => 'admin', 7 => 'finish');
if(!in_array($step, $steps)) // check if step is valid
die('ERROR: Unknown step.');
if($step == 'database')
{
foreach($_POST['vars'] as $key => $value)
{
if(empty($value))
{
$step = 'config';
$errors = '<p class="error">' . $locale['please_fill_all'] . '</p>';
break;
}
}
}
$error = false;
// step include
ob_start();
require('steps/' . $step . '.php');
$content = ob_get_contents();
ob_end_clean();
// render
require('template/template.php');
//$_SESSION['laststep'] = $step;
?>