// set installation type - drupal
if (!session_id()) {
+ if (defined('PANTHEON_ENVIRONMENT')) {
+ ini_set('session.save_handler', 'files');
+ }
session_start();
}
CRM_Core_ClassLoader::singleton()->register();
// Load civicrm database config
-if (isset($_REQUEST['mysql'])) {
- $databaseConfig = $_REQUEST['mysql'];
+if (isset($_POST['mysql'])) {
+ $databaseConfig = $_POST['mysql'];
}
else {
- if ($installType == 'wordpress') {
- //WP Database Data
- $databaseConfig = array(
- "server" => DB_HOST,
- "username" => DB_USER,
- "password" => DB_PASSWORD,
- "database" => DB_NAME,
- );
- }
+ $databaseConfig = array(
+ "server" => "localhost",
+ "username" => "civicrm",
+ "password" => "",
+ "database" => "civicrm",
+ );
+}
+
+if ($installType == 'wordpress') {
+ //WP Database Data
+ $databaseConfig = array(
+ "server" => DB_HOST,
+ "username" => DB_USER,
+ "password" => DB_PASSWORD,
+ "database" => DB_NAME,
+ );
}
if ($installType == 'drupal') {
// Load drupal database config
- if (isset($_REQUEST['drupal'])) {
- $drupalConfig = $_REQUEST['drupal'];
+ if (isset($_POST['drupal'])) {
+ $drupalConfig = $_POST['drupal'];
}
else {
$drupalConfig = array(
}
$loadGenerated = 0;
-if (isset($_REQUEST['loadGenerated'])) {
+if (isset($_POST['loadGenerated'])) {
$loadGenerated = 1;
}
$tsLocale = 'en_US';
$seedLanguage = 'en_US';
+// CRM-16801 This validates that seedLanguage is valid by looking in $langs.
+// NB: the variable is initial a $_REQUEST for the initial page reload,
+// then becomes a $_POST when the installation form is submitted.
if (isset($_REQUEST['seedLanguage']) and isset($langs[$_REQUEST['seedLanguage']])) {
$seedLanguage = $_REQUEST['seedLanguage'];
$tsLocale = $_REQUEST['seedLanguage'];
// The translation files are in the parent directory (l10n)
$i18n = CRM_Core_I18n::singleton();
+// Support for Arabic, Hebrew, Farsi, etc.
+// Used in the template.html
+$short_lang_code = CRM_Core_I18n_PseudoConstant::shortForLong($tsLocale);
+$text_direction = (CRM_Core_I18n::isLanguageRTL($tsLocale) ? 'rtl' : 'ltr');
+
global $cmsPath;
if ($installType == 'drupal') {
//CRM-6840 -don't force to install in sites/all/modules/
$cmsPath = WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . 'civicrm';
$upload_dir = wp_upload_dir();
$files_dirname = $upload_dir['basedir'] . DIRECTORY_SEPARATOR . 'civicrm';
- $wp_civi_settings = $upload_dir['basedir'] . DIRECTORY_SEPARATOR . 'civicrm' . DIRECTORY_SEPARATOR . 'civicrm.settingsphp';
+ $wp_civi_settings = $upload_dir['basedir'] . DIRECTORY_SEPARATOR . 'civicrm' . DIRECTORY_SEPARATOR . 'civicrm.settings.php';
$wp_civi_settings_deprectated = CIVICRM_PLUGIN_DIR . 'civicrm.settings.php';
if (file_exists($wp_civi_settings_deprectated)) {
$alreadyInstalled = $wp_civi_settings_deprectated;
}
// Actual processor
-if (isset($_REQUEST['go']) && !$req->hasErrors() && !$dbReq->hasErrors()) {
+if (isset($_POST['go']) && !$req->hasErrors() && !$dbReq->hasErrors()) {
// Confirm before reinstalling
- if (!isset($_REQUEST['force_reinstall']) && $alreadyInstalled) {
+ if (!isset($_POST['force_reinstall']) && $alreadyInstalled) {
include $installDirPath . 'template.html';
}
else {
$inst = new Installer();
- $inst->install($_REQUEST);
+ $inst->install($_POST);
}
// Show the config form
$aboveMinVersion = version_compare($phpVersion, $minVersion) >= 0;
$belowMaxVersion = $maxVersion ? version_compare($phpVersion, $maxVersion) < 0 : TRUE;
- if ($maxVersion && $aboveMinVersion && $belowMaxVersion) {
- return TRUE;
- }
- elseif (!$maxVersion && $aboveMinVersion) {
+ if ($aboveMinVersion && $belowMaxVersion) {
+ if (version_compare(phpversion(), CRM_Upgrade_Incremental_General::MIN_RECOMMENDED_PHP_VER) < 0) {
+ $testDetails[2] = ts('This webserver is running an outdated version of PHP (%1). It is strongly recommended to upgrade to PHP %2 or later, as older versions can present a security risk.', array(
+ 1 => phpversion(),
+ 2 => CRM_Upgrade_Incremental_General::MIN_RECOMMENDED_PHP_VER,
+ ));
+ $this->warning($testDetails);
+ }
return TRUE;
}
//change the default language to one chosen
if (isset($config['seedLanguage']) && $config['seedLanguage'] != 'en_US') {
- // This ensures that defaults get set, otherwise the user will login
- // and most configurations will be empty, not set to en_US defaults.
- civicrm_api3('Setting', 'revert');
-
civicrm_api3('Setting', 'create', array(
'domain_id' => 'current_domain',
'lcMessages' => $config['seedLanguage'],