static function disableCaching($email_notification = TRUE) { //In case the cache directory does not exist, disabling caching can prevent errors from occurring or punches to be missed. //So this should be enabled even for ON-DEMAND services just in case. if (PRODUCTION == TRUE) { //Disable caching to prevent stale cache data from being read, and further cache errors. $install_obj = new Install(); $tmp_config_vars['cache']['enable'] = FALSE; $write_config_result = $install_obj->writeConfigFile($tmp_config_vars); unset($install_obj, $tmp_config_vars); if ($email_notification == TRUE) { if ($write_config_result == TRUE) { $subject = APPLICATION_NAME . ' - Error!'; $body = 'ERROR writing cache file, likely due to incorrect operating system permissions, disabling caching to prevent data corruption. This may result in ' . APPLICATION_NAME . ' performing slowly.' . "\n\n"; $body .= Debug::getOutput(); } else { $subject = APPLICATION_NAME . ' - Error!'; $body = 'ERROR writing config file, likely due to incorrect operating system permissions conflicts. Please correction permissions so ' . APPLICATION_NAME . ' can operate correctly.' . "\n\n"; $body .= Debug::getOutput(); } return self::sendSystemMail($subject, $body); } return TRUE; } return FALSE; }
$install_obj = new Install(); if ($install_obj->isInstallMode() == FALSE) { Redirect::Page(URLBuilder::getURL(NULL, 'install.php')); } $action = Misc::findSubmitButton(); switch ($action) { case 'back': Debug::Text('Back', __FILE__, __LINE__, __METHOD__, 10); Redirect::Page(URLBuilder::getURL(NULL, 'DatabaseConfig.php')); break; case 'next': //Debug::setVerbosity(11); Debug::Text('Next', __FILE__, __LINE__, __METHOD__, 10); //Set salt if it isn't already. $data['salt'] = md5(uniqid()); $install_obj->writeConfigFile($data); //Write auto_update feature to system settings. $sslf = new SystemSettingListFactory(); $sslf->getByName('update_notify'); if ($sslf->getRecordCount() == 1) { $obj = $sslf->getCurrent(); } else { $obj = new SystemSettingListFactory(); } $obj->setName('update_notify'); if (isset($data['update_notify']) and $data['update_notify'] == 1 or getTTProductEdition() > 10 or $external_installer == 1) { $obj->setValue(1); } else { $obj->setValue(0); } if ($obj->isValid()) {
$cf->setAddress1($company_data['address1']); $cf->setAddress2($company_data['address2']); $cf->setCity($company_data['city']); $cf->setCountry($company_data['country']); $cf->setProvince($company_data['province']); $cf->setPostalCode($company_data['postal_code']); $cf->setWorkPhone($company_data['work_phone']); $cf->setEnableAddCurrency(TRUE); $cf->setEnableAddPermissionGroupPreset(TRUE); $cf->setEnableAddStation(TRUE); $cf->setEnableAddPayStubEntryAccountPreset(TRUE); $cf->setEnableAddCompanyDeductionPreset(TRUE); $cf->setEnableAddRecurringHolidayPreset(TRUE); if ($cf->isValid()) { $company_id = $cf->Save(); $install_obj->writeConfigFile(array('primary_company_id' => $company_id)); Redirect::Page(URLBuilder::getURL(array('company_id' => $company_id, 'external_installer' => $external_installer), 'User.php')); break; } default: //Select box options; $company_data['status_options'] = $cf->getOptions('status'); $company_data['country_options'] = $cf->getOptions('country'); if (!isset($id) and isset($company_data['id'])) { $id = $company_data['id']; } $company_data['user_list_options'] = UserListFactory::getByCompanyIdArray($id); $smarty->assign_by_ref('company_data', $company_data); break; } $handle = @fopen('http://www.timetrex.com/' . URLBuilder::getURL(array('v' => $install_obj->getFullApplicationVersion(), 'page' => 'company'), 'pre_install.php'), "r");