Commit aa58127b authored by wmortada's avatar wmortada

Move the install type variable from SESSION to POST and remove the session

parent 61ab5109
......@@ -54,35 +54,25 @@ else {
define('CIVICRM_WINDOWS', 0);
}
// set installation type - drupal
if (!session_id()) {
if (defined('PANTHEON_ENVIRONMENT')) {
ini_set('session.save_handler', 'files');
}
session_start();
}
// unset civicrm session if any
if (array_key_exists('CiviCRM', $_SESSION)) {
unset($_SESSION['CiviCRM']);
}
if (isset($_GET['civicrm_install_type'])) {
$_SESSION['civicrm_install_type'] = $_GET['civicrm_install_type'];
}
else {
if (!isset($_SESSION['civicrm_install_type'])) {
$_SESSION['civicrm_install_type'] = "drupal";
}
}
global $installType;
global $crmPath;
global $pkgPath;
global $installDirPath;
global $installURLPath;
$installType = strtolower($_SESSION['civicrm_install_type']);
// Set the install type
// this is sent as a query string when the page is first loaded
// and subsequently posted to the page as a hidden field
if (isset($_POST['civicrm_install_type'])) {
$installType = $_POST['civicrm_install_type'];
}
elseif (isset($_GET['civicrm_install_type'])) {
$installType = strtolower($_GET['civicrm_install_type']);
}
else {
// default value if not set
$installType = "drupal";
}
if ($installType == 'drupal' || $installType == 'backdrop') {
$crmPath = dirname(dirname($_SERVER['SCRIPT_FILENAME']));
......
......@@ -22,6 +22,8 @@ if ($text_direction == 'rtl') {
<form name="civicrm_form" method="post" action="<?php echo str_replace( '%7E', '~', $_SERVER['REQUEST_URI']); ?>">
<input type="hidden" name="civicrm_install_type" value="<?php echo $installType; ?>" />
<?php if (isset($hasErrorOtherThanDatabase)) { ?>
<p class="error"><?php echo ts('We are not able to install the software. Please <a href="#requirements">see below</a> for details.'); ?></p>
<?php } else { ?>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment