Пример #1
0
 public function Step7(Vtiger_Request $request)
 {
     // Set favourable error reporting
     error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
     $moduleName = $request->getModule();
     if ($_SESSION['config_file_info']['authentication_key'] != $request->get('auth_key')) {
         die(vtranslate('ERR_NOT_AUTHORIZED_TO_PERFORM_THE_OPERATION', $moduleName));
     }
     // Create configuration file
     $configParams = $_SESSION['config_file_info'];
     $configFile = new Install_ConfigFileUtils_Model($configParams);
     $configFile->createConfigFile();
     global $adb;
     $adb->resetSettings($configParams['db_type'], $configParams['db_hostname'], $configParams['db_name'], $configParams['db_username'], $configParams['db_password']);
     $adb->query('SET NAMES utf8');
     // Initialize and set up tables
     Install_InitSchema_Model::initialize();
     // Install all the available modules
     Install_Utils_Model::installModules();
     Install_InitSchema_Model::upgrade();
     $viewer = $this->getViewer($request);
     $viewer->assign('PASSWORD', $_SESSION['config_file_info']['password']);
     $viewer->assign('APPUNIQUEKEY', $this->retrieveConfiguredAppUniqueKey());
     $viewer->assign('CURRENT_VERSION', $_SESSION['vtiger_version']);
     $viewer->assign('INDUSTRY', $request->get('industry'));
     $viewer->view('Step7.tpl', $moduleName);
 }
Пример #2
0
 public function Step7(Vtiger_Request $request)
 {
     // Set favourable error reporting
     version_compare(PHP_VERSION, '5.5.0') <= 0 ? error_reporting(E_WARNING & ~E_NOTICE & ~E_DEPRECATED) : error_reporting(E_WARNING & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT);
     $moduleName = $request->getModule();
     $webuiInstance = new Vtiger_WebUI();
     $isInstalled = $webuiInstance->isInstalled();
     if (!$isInstalled) {
         if ($_SESSION['config_file_info']['authentication_key'] != $request->get('auth_key')) {
             die(vtranslate('ERR_NOT_AUTHORIZED_TO_PERFORM_THE_OPERATION', $moduleName));
         }
         // Create configuration file
         $configParams = $_SESSION['config_file_info'];
         $configFile = new Install_ConfigFileUtils_Model($configParams);
         $configFile->createConfigFile();
         global $adb;
         $adb->resetSettings($configParams['db_type'], $configParams['db_hostname'], $configParams['db_name'], $configParams['db_username'], $configParams['db_password']);
         $adb->query('SET NAMES utf8');
         // Initialize and set up tables
         Install_InitSchema_Model::initialize();
         // Install all the available modules
         Install_Utils_Model::installModules();
         Install_InitSchema_Model::upgrade();
         $viewer = $this->getViewer($request);
         $viewer->assign('PASSWORD', $_SESSION['config_file_info']['password']);
         $viewer->assign('APPUNIQUEKEY', $this->retrieveConfiguredAppUniqueKey());
         $viewer->assign('CURRENT_VERSION', $_SESSION['vtiger_version']);
         $viewer->assign('INDUSTRY', $request->get('industry'));
         $viewer->view('Step7.tpl', $moduleName);
     } else {
         $response = new Vtiger_Response();
         $response->setResult(vtranslate('THIS_INSTANCE_IS_ALREADY_INSTALLED', $moduleName));
         return $response;
     }
 }
Пример #3
0
 public function Step7(Vtiger_Request $request)
 {
     $moduleName = $request->getModule();
     $webuiInstance = new Vtiger_WebUI();
     $isInstalled = $webuiInstance->isInstalled();
     if (!$isInstalled) {
         if ($_SESSION['config_file_info']['authentication_key'] != $request->get('auth_key')) {
             die(vtranslate('ERR_NOT_AUTHORIZED_TO_PERFORM_THE_OPERATION', $moduleName));
         }
         // Create configuration file
         $configParams = $_SESSION['config_file_info'];
         $configFile = new Install_ConfigFileUtils_Model($configParams);
         $configFile->createConfigFile();
         $db = new PearDatabase($configParams['db_type'], $configParams['db_hostname'], $configParams['db_name'], $configParams['db_username'], $configParams['db_password']);
         vglobal('adb', $db);
         // Initialize and set up tables
         $initSchema = new Install_InitSchema_Model($db);
         $initSchema->initialize();
         $viewer = new Vtiger_Viewer();
         $viewer->assign('LANG', $request->get('lang'));
         $viewer->setTemplateDir('install/tpl/');
         $viewer->assign('PASSWORD', $_SESSION['config_file_info']['password']);
         $viewer->assign('APPUNIQUEKEY', $this->retrieveConfiguredAppUniqueKey());
         $viewer->assign('CURRENT_VERSION', $_SESSION['yetiforce_version']);
         $viewer->assign('INDUSTRY', $request->get('industry'));
         echo $viewer->fetch('Step7.tpl');
     } else {
         $response = new Vtiger_Response();
         $response->setResult(vtranslate('THIS_INSTANCE_IS_ALREADY_INSTALLED', $moduleName));
         return $response;
     }
 }
Пример #4
0
 public function createConfig($source_directory, $username, $password, $system)
 {
     if (substr($source_directory, -1) != '/') {
         $source_directory = $source_directory . '/';
     }
     $config_directory = $source_directory . 'config.inc.php';
     if (!file_exists($config_directory)) {
         return array('result' => false, 'text' => 'LBL_ERROR_NO_CONFIG');
     }
     if (!file_exists($source_directory . 'vtigerversion.php')) {
         return array('result' => false, 'text' => 'LBL_ERROR_NO_CONFIG');
     }
     include_once $this->migration_schema . $system . '.php';
     $migrationObject = new $system();
     include_once $source_directory . 'vtigerversion.php';
     if ($vtiger_current_version != $migrationObject->version) {
         return array('result' => false, 'text' => 'LBL_ERROR_WRONG_VERSION');
     }
     include_once $config_directory;
     if (!isset($root_directory)) {
         return array('result' => false, 'text' => 'LBL_ERROR_EMPTY_CONFIG');
     }
     $rootDirectory = getcwd();
     if (substr($rootDirectory, -1) != '/') {
         $rootDirectory = $rootDirectory . '/';
     }
     $webRoot = $_SERVER["HTTP_HOST"] ? $_SERVER["HTTP_HOST"] : $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'];
     $webRoot .= $_SERVER["REQUEST_URI"];
     $webRoot = str_replace("install/Install.php", "", $webRoot);
     $webRoot = (isset($_SERVER['HTTPS']) && !empty($_SERVER['HTTPS']) ? "https://" : "http://") . $webRoot;
     $configFileParameters = array();
     $configFileParameters['root_directory'] = $rootDirectory;
     $configFileParameters['site_URL'] = $webRoot;
     $configFileParameters['db_hostname'] = $dbconfig['db_server'] . ':' . $dbconfig['db_port'];
     $configFileParameters['db_username'] = $dbconfig['db_username'];
     $configFileParameters['db_password'] = $dbconfig['db_password'];
     $configFileParameters['db_name'] = $dbconfig['db_name'];
     $configFileParameters['db_type'] = $dbconfig['db_type'];
     $configFileParameters['admin_email'] = $HELPDESK_SUPPORT_EMAIL_ID;
     $configFileParameters['currency_name'] = $currency_name;
     $configFileParameters['vt_charset'] = $default_charset;
     $configFileParameters['default_language'] = $default_language;
     $configFileParameters['timezone'] = $default_timezone;
     $configFile = new Install_ConfigFileUtils_Model($configFileParameters);
     $configFile->createConfigFile();
     return array('result' => true);
 }