Files
cacti/install/step_json.php
T
Mark Brugnoli-Vinten ddddaec6ae Ajax Installer (#1586)
* Beginning of Install via AJAX calls

* Added steps 3 & 4 to the installer system

* Add background update procedure.  Still needs more upgrade code adding, like upgrading the DB

* Minor fixup during QA

* Remove debug code from lib/functions.php

* More QA fixes, add slight delay to index.php initialisation to see javascript warning (should be removed)

* beta3 - added data source profiles

* beta4 - fix some issues found in QA

* beta5 - upgrade databsae routines added, error results screen styled

* Add some colour to the thumb icons

* QA fix to remove unneeded option

* Fix for PHP 5.4 travis failure
2018-04-29 10:05:32 -05:00

74 lines
2.9 KiB
PHP

<?php
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2018 The Cacti Group |
| |
| This program is free software; you can redistribute it and/or |
| modify it under the terms of the GNU General Public License |
| as published by the Free Software Foundation; either version 2 |
| of the License, or (at your option) any later version. |
| |
| This program is distributed in the hope that it will be useful, |
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| GNU General Public License for more details. |
+-------------------------------------------------------------------------+
| Cacti: The Complete RRDtool-based Graphing Solution |
+-------------------------------------------------------------------------+
| This code is designed, written, and maintained by the Cacti Group. See |
| about.php and/or the AUTHORS file for specific developer information. |
+-------------------------------------------------------------------------+
| http://www.cacti.net/ |
+-------------------------------------------------------------------------+
*/
/* since we'll have additional headers, tell php when to flush them */
ob_start();
// Prevnt redirect to /install/
define('IN_CACTI_INSTALL', 1);
/* set the json variable for request validation handling */
include('../lib/html_utility.php');
set_request_var('json', true);
$auth_json = true;
include('../include/auth.php');
include('../lib/installer.php');
include('functions.php');
include('../lib/utility.php');
$debug = false;
/* ================= input validation ================= */
get_request_var('data', array());
$initialData = array();
if (isset_request_var('data') && get_request_var('data')) {
$initialData = json_decode(get_request_var('data'), true);
}
$installer = new Installer($initialData);
/*
array(
'step_data' => $installer->stepData,
'config_write' => $installer->IsConfigurationWritable(),
'config_remote' => $installer->IsRemoteDatabaseGood(),
'mode' => $installer->getMode(),
'step' => $installer->getStep(),
'prev' => $installer->buttonPrevious,
'next' => $installer->buttonNext,
'test' => $installer->buttonTest,
'html' => $output
);
*/
tmp_log('step.log','Start: ' . clean_up_lines(get_request_var('data')) . "\n\n");
$json = json_encode($installer);
tmp_log('step.log',' End: ' . clean_up_lines($json) . "\n\n", FILE_APPEND);
header('Content-Type: application/json');
header('Content-Length: ' . strlen($json));
print $json;