aboutsummaryrefslogtreecommitdiff
path: root/actions/systemsettings/install.php
diff options
context:
space:
mode:
Diffstat (limited to 'actions/systemsettings/install.php')
-rw-r--r--actions/systemsettings/install.php28
1 files changed, 19 insertions, 9 deletions
diff --git a/actions/systemsettings/install.php b/actions/systemsettings/install.php
index 18440c62d..589e3a06c 100644
--- a/actions/systemsettings/install.php
+++ b/actions/systemsettings/install.php
@@ -10,8 +10,11 @@
* @link http://elgg.org/
*/
+global $CONFIG;
define('INSTALLING', TRUE);
-elgg_set_viewtype('failsafe'); // Set failsafe again incase we get an exception thrown
+
+// Set failsafe again in case we get an exception thrown
+elgg_set_viewtype('failsafe');
if (is_installed()) {
forward();
@@ -43,7 +46,6 @@ if (get_input('settings') == 'go') {
$site->name = get_input('sitename');
$site->url = $url;
$site->description = get_input('sitedescription');
- $site->email = get_input('siteemail');
$site->access_id = ACCESS_PUBLIC;
$guid = $site->save();
@@ -51,6 +53,12 @@ if (get_input('settings') == 'go') {
throw new InstallationException(sprintf(elgg_echo('InstallationException:CantCreateSite'), get_input('sitename'), get_input('wwwroot')));
}
+ $site->email = get_input('siteemail');
+
+ // this is needed to grab plugins
+ $CONFIG->site_guid = $guid;
+ $CONFIG->site = $site;
+
datalist_set('installed',time());
datalist_set('path', $path);
datalist_set('dataroot', $dataroot);
@@ -94,16 +102,18 @@ if (get_input('settings') == 'go') {
enable_plugin(trim($plugin), $site->getGUID());
}
} else {
- enable_plugin('profile', $site->getGUID());
- enable_plugin('logbrowser', $site->getGUID());
- enable_plugin('diagnostics', $site->getGUID());
- enable_plugin('uservalidationbyemail', $site->getGUID());
- enable_plugin('htmlawed', $site->getGUID());
- enable_plugin('search', $site->getGUID());
+ // activate plugins with manifest.xml: elgg_install_state = enabled
+ $plugins = get_plugin_list();
+ foreach ($plugins as $plugin) {
+ if ($manifest = load_plugin_manifest($plugin)) {
+ if (isset($manifest['elgg_install_state']) && $manifest['elgg_install_state'] == 'enabled') {
+ enable_plugin($plugin);
+ }
+ }
+ }
}
// reset the views path in case of installing over an old data dir.
- // @todo should this warn / error first?
$dataroot = datalist_get('dataroot');
$cache = new ElggFileCache($dataroot);
$cache->delete('view_paths');