function installComplete($sample = false) { $this->checkPermissionForTools(); if (VmConfig::get('dangeroustools', true)) { if (!class_exists('com_virtuemartInstallerScript')) { require VMPATH_ADMIN . DS . 'install' . DS . 'script.virtuemart.php'; } $updater = new com_virtuemartInstallerScript(); $updater->install(true); $model = $this->getModel('updatesMigration'); $sid = $model->setStoreOwner(); $msg = 'System and sampledata succesfull installed, user id of the mainvendor is ' . $sid; if (!class_exists('com_virtuemart_allinoneInstallerScript')) { require VMPATH_ROOT . DS . 'administrator' . DS . 'components' . DS . 'com_virtuemart_allinone' . DS . 'script.vmallinone.php'; } $updater = new com_virtuemart_allinoneInstallerScript(false); $updater->vmInstall(true); if ($sample) { $model->installSampleData($sid); } if (!class_exists('VmConfig')) { require_once VMPATH_ADMIN . '/models/config.php'; } VirtueMartModelConfig::installVMconfigTable(); //Now lets set some joomla variables //Caching should be enabled, set to files and for 15 minutes if (JVM_VERSION > 2) { if (!class_exists('ConfigModelCms')) { require VMPATH_ROOT . DS . 'components' . DS . 'com_config' . DS . 'model' . DS . 'cms.php'; } if (!class_exists('ConfigModelForm')) { require VMPATH_ROOT . DS . 'components' . DS . 'com_config' . DS . 'model' . DS . 'application.php'; } if (!class_exists('ConfigModelApplication')) { require VMPATH_ROOT . DS . 'administrator' . DS . 'components' . DS . 'com_config' . DS . 'model' . DS . 'application.php'; } } else { if (!class_exists('ConfigModelApplication')) { require VMPATH_ROOT . DS . 'administrator' . DS . 'components' . DS . 'com_config' . DS . 'models' . DS . 'application.php'; } } $jConfModel = new ConfigModelApplication(); $jConfig = $jConfModel->getData(); $jConfig['caching'] = 0; $jConfig['lifetime'] = 60; $jConfig['list_limit'] = 25; $jConfig['MetaDesc'] = 'VirtueMart works with Joomla! - the dynamic portal engine and content management system'; $jConfig['MetaKeys'] = 'virtuemart, vm2, joomla, Joomla'; $app = JFactory::getApplication(); $return = $jConfModel->save($jConfig); // Check the return value. if ($return === false) { // Save the data in the session. $app->setUserState('com_config.config.global.data', $jConfig); vmError(vmText::sprintf('JERROR_SAVE_FAILED', 'installComplete')); //return false; } else { // Set the success message. //vmInfo('COM_CONFIG_SAVE_SUCCESS'); } } else { $msg = $this->_getMsgDangerousTools(); } $this->setRedirect('index.php?option=com_virtuemart&view=updatesmigration&layout=insfinished', $msg); }
function installComplete($sample = false) { $data = JRequest::get('get'); JRequest::setVar($data['token'], '1', 'post'); JRequest::checkToken() or jexit('Invalid Token, in ' . JRequest::getWord('task')); $this->checkPermissionForTools(); if (VmConfig::get('dangeroustools', true)) { if (!class_exists('com_virtuemartInstallerScript')) { require JPATH_VM_ADMINISTRATOR . DS . 'install' . DS . 'script.virtuemart.php'; } $updater = new com_virtuemartInstallerScript(); $updater->install(true); $model = $this->getModel('updatesMigration'); $sid = $model->setStoreOwner(); $model->setUserToPermissionGroup($sid); $msg = ''; if (empty($errors)) { $msg = 'System succesfull restored and sampledata installed, user id of the mainvendor is ' . $sid; } else { foreach ($errors as $error) { $msg .= $error . '<br />'; } } if (!class_exists('com_virtuemart_allinoneInstallerScript')) { require JPATH_ROOT . DS . 'administrator' . DS . 'components' . DS . 'com_virtuemart_allinone' . DS . 'script.vmallinone.php'; } $updater = new com_virtuemart_allinoneInstallerScript(); $updater->vmInstall(true); if ($sample) { $model->installSampleData($sid); } VmConfig::installVMconfig(); //Now lets set some joomla variables //Caching should be enabled, set to files and for 15 minutes if (!class_exists('ConfigModelApplication')) { require JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_config' . DS . 'models' . DS . 'application.php'; } $jConfModel = new ConfigModelApplication(); $jConfig = $jConfModel->getData(); $jConfig['caching'] = 0; $jConfig['lifetime'] = 60; $jConfig['list_limit'] = 25; $jConfig['MetaDesc'] = 'VirtueMart works with Joomla! - the dynamic portal engine and content management system'; $jConfig['MetaKeys'] = 'virtuemart, vm2, joomla, Joomla'; $app = JFactory::getApplication(); $return = $jConfModel->save($jConfig); // Check the return value. if ($return === false) { // Save the data in the session. $app->setUserState('com_config.config.global.data', $jConfig); vmError(vmText::sprintf('JERROR_SAVE_FAILED', $model->getError())); //return false; } else { // Set the success message. //vmInfo('COM_CONFIG_SAVE_SUCCESS'); } } else { $msg = $this->_getMsgDangerousTools(); } $this->setRedirect($this->redirectPath, $msg); }