aboutsummaryrefslogtreecommitdiff
path: root/install
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2011-10-21 21:09:27 -0400
committerCash Costello <cash.costello@gmail.com>2011-10-21 21:09:27 -0400
commite8c47ee8a098bd4297cbacb6b96ad1768a769628 (patch)
treeef4f304a956acadb3839f383430cd9bbb6abe6f2 /install
parent7ef727bfa242015d3ca7ab22671ec020006f0b4e (diff)
downloadelgg-e8c47ee8a098bd4297cbacb6b96ad1768a769628.tar.gz
elgg-e8c47ee8a098bd4297cbacb6b96ad1768a769628.tar.bz2
Fixes #3994 cleaned up session handling for the installer
Diffstat (limited to 'install')
-rw-r--r--install/ElggInstaller.php33
1 files changed, 17 insertions, 16 deletions
diff --git a/install/ElggInstaller.php b/install/ElggInstaller.php
index c07839065..59ac44dc6 100644
--- a/install/ElggInstaller.php
+++ b/install/ElggInstaller.php
@@ -562,7 +562,12 @@ class ElggInstaller {
* @return string
*/
protected function getNextStep($currentStep) {
- return $this->steps[1 + array_search($currentStep, $this->steps)];
+ $index = 1 + array_search($currentStep, $this->steps);
+ if (isset($this->steps[$index])) {
+ return $this->steps[$index];
+ } else {
+ return null;
+ }
}
/**
@@ -735,20 +740,18 @@ class ElggInstaller {
protected function finishBootstraping($step) {
$dbIndex = array_search('database', $this->getSteps());
- $settingsIndex = array_search('settings', $this->getSteps());
+ $adminIndex = array_search('admin', $this->getSteps());
+ $completeIndex = array_search('complete', $this->getSteps());
$stepIndex = array_search($step, $this->getSteps());
- if ($stepIndex <= $settingsIndex) {
- // install has its own session handling before the db created and set up
- session_name('Elgg');
+ // To log in the user, we need to use the Elgg core session handling.
+ // Otherwise, use default php session handling
+ $useElggSession = ($stepIndex == $adminIndex && $this->isAction) ||
+ $stepIndex == $completeIndex;
+ if (!$useElggSession) {
+ session_name('Elgg_install');
session_start();
elgg_unregister_event_handler('boot', 'system', 'session_init');
- } else if (!$this->isAction && $stepIndex == ($settingsIndex + 1)) {
- // now using Elgg session handling so need to pass forward the system messages
- // this is called on the GET of the next step
- session_name('Elgg');
- session_start();
- $messages = $_SESSION['msg'];
}
if ($stepIndex > $dbIndex) {
@@ -789,11 +792,6 @@ class ElggInstaller {
elgg_trigger_event('boot', 'system');
elgg_trigger_event('init', 'system');
-
- // @hack finish the process of pushing system messages into new session
- if (!$this->isAction && $stepIndex == ($settingsIndex + 1)) {
- $_SESSION['msg'] = $messages;
- }
}
}
@@ -811,6 +809,8 @@ class ElggInstaller {
$CONFIG->wwwroot = $this->getBaseUrl();
$CONFIG->url = $CONFIG->wwwroot;
$CONFIG->path = dirname(dirname(__FILE__)) . '/';
+ $CONFIG->lastcache = 0;
+ $CONFIG->context = array();
}
/**
@@ -1398,6 +1398,7 @@ class ElggInstaller {
set_config('default_access', $submissionVars['siteaccess'], $site->getGUID());
set_config('allow_registration', TRUE, $site->getGUID());
set_config('walled_garden', FALSE, $site->getGUID());
+ set_config('allow_user_default_access', '', $site->getGUID());
$this->enablePlugins();