XML data loader to request for credentials

SVN:trunk[986]
This commit is contained in:
Romain Quetiez
2010-11-29 10:19:33 +00:00
parent 540eb5f272
commit c428e07c4b
2 changed files with 15 additions and 15 deletions

View File

@@ -46,13 +46,16 @@ class XMLDataLoader
protected $m_aWarnings;
protected $m_iCountCreated;
public function __construct($sConfigFileName)
public function __construct($sConfigFileName = null)
{
$this->m_aKeys = array();
$this->m_aObjectsCache = array();
$this->m_oChange = null;
$this->m_sCacheFileName = KEYS_CACHE_FILE;
$this->InitDataModel($sConfigFileName);
if ($sConfigFileName != null)
{
$this->InitDataModel($sConfigFileName);
}
$this->LoadKeysCache();
$this->m_bSessionActive = true;
$this->m_aErrors = array();

View File

@@ -29,11 +29,18 @@
* 'file' string Name of the file to load
*/
define('SAFE_MINIMUM_MEMORY', 256*1024*1024);
require_once('../approot.inc.php');
require_once(APPROOT.'/application/utils.inc.php');
require_once(APPROOT."/application/nicewebpage.class.inc.php");
require_once(APPROOT.'/application/application.inc.php');
require_once(APPROOT.'/application/startup.inc.php');
require_once(APPROOT.'/application/loginwebpage.class.inc.php');
LoginWebPage::DoLogin(true); // Check user rights and prompt if needed (must be admin)
// required because the class xmldataloader is reporting errors in the setup.log file
require_once(APPROOT.'/setup/setuppage.class.inc.php');
require_once(APPROOT.'/setup/xmldataloader.class.inc.php');
function SetMemoryLimit($oP)
@@ -72,20 +79,10 @@ function SetMemoryLimit($oP)
//
////////////////////////////////////////////////////////////////////////////////
require_once(APPROOT.'/core/config.class.inc.php');
require_once(APPROOT.'/core/log.class.inc.php');
require_once(APPROOT.'/core/kpi.class.inc.php');
require_once(APPROOT.'/core/cmdbsource.class.inc.php');
require_once(APPROOT.'/setup/xmldataloader.class.inc.php');
define('FINAL_CONFIG_FILE', APPROOT.'/config-itop.php');
// Never cache this page
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Fri, 17 Jul 1970 05:00:00 GMT"); // Date in the past
Utils::SpecifyConfigFile(FINAL_CONFIG_FILE);
/**
* Main program
*/
@@ -97,7 +94,7 @@ $oP = new WebPage("iTop - Backoffice data loader");
try
{
// Note: the data model must be loaded first
$oDataLoader = new XMLDataLoader(FINAL_CONFIG_FILE); // When called by the wizard, the final config is not yet there
$oDataLoader = new XMLDataLoader();
if (empty($sFileName))
{