From 82593cd2bc056da73caa1b1e981c5a9ead0f1bf2 Mon Sep 17 00:00:00 2001 From: brettp Date: Wed, 27 Apr 2011 02:37:16 +0000 Subject: Refs #3362. Plugins don't check deps upon boot. Made package and manifest private properties of ElggPlugin and added ->getPackage() and ->getManifest(). git-svn-id: http://code.elgg.org/elgg/trunk@9030 36083f99-b078-4883-b0ff-0f9b5a30f544 --- install/ElggInstaller.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'install') diff --git a/install/ElggInstaller.php b/install/ElggInstaller.php index 1bf4808ef..62d3f6567 100644 --- a/install/ElggInstaller.php +++ b/install/ElggInstaller.php @@ -1344,8 +1344,8 @@ class ElggInstaller { elgg_generate_plugin_entities(); $plugins = elgg_get_plugins('any'); foreach ($plugins as $plugin) { - if ($plugin->manifest) { - if ($plugin->manifest->getActivateOnInstall()) { + if ($plugin->getManifest()) { + if ($plugin->getManifest()->getActivateOnInstall()) { $plugin->activate(); } } -- cgit v1.2.3 From 48af91afaadd1617b70c43369c2d680079806da7 Mon Sep 17 00:00:00 2001 From: cash Date: Sat, 14 May 2011 21:14:17 +0000 Subject: fixed the double form submission code for the installer git-svn-id: http://code.elgg.org/elgg/trunk@9083 36083f99-b078-4883-b0ff-0f9b5a30f544 --- install/js/install.js | 11 +++++++++++ views/installation/forms/install/template.php | 16 ---------------- views/installation/page/default.php | 2 ++ 3 files changed, 13 insertions(+), 16 deletions(-) create mode 100644 install/js/install.js (limited to 'install') diff --git a/install/js/install.js b/install/js/install.js new file mode 100644 index 000000000..8d36c8a65 --- /dev/null +++ b/install/js/install.js @@ -0,0 +1,11 @@ + +// prevent double-submission of forms +$(function() { + $('form').submit(function() { + if (this.data('submitted')) { + return false; + } + this.data('submitted', true); + return true; + }); +}); diff --git a/views/installation/forms/install/template.php b/views/installation/forms/install/template.php index 7e7a668d3..ea9a08a3d 100644 --- a/views/installation/forms/install/template.php +++ b/views/installation/forms/install/template.php @@ -28,19 +28,3 @@ $submit_params = array( $form_body .= elgg_view('input/submit', $submit_params); echo $form_body; - -?> - - diff --git a/views/installation/page/default.php b/views/installation/page/default.php index 7618e7255..a41a5b688 100644 --- a/views/installation/page/default.php +++ b/views/installation/page/default.php @@ -29,6 +29,8 @@ header('Expires: Fri, 05 Feb 1982 00:00:00 -0500', TRUE); + +
-- cgit v1.2.3 From 37d9872a39954ca3ffb16c8381e71e43bf9db1d3 Mon Sep 17 00:00:00 2001 From: cash Date: Sat, 14 May 2011 21:20:41 +0000 Subject: Fixes #3446 password is not required anymore for installer git-svn-id: http://code.elgg.org/elgg/trunk@9084 36083f99-b078-4883-b0ff-0f9b5a30f544 --- install/ElggInstaller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'install') diff --git a/install/ElggInstaller.php b/install/ElggInstaller.php index 62d3f6567..6b8b8d747 100644 --- a/install/ElggInstaller.php +++ b/install/ElggInstaller.php @@ -278,7 +278,7 @@ class ElggInstaller { 'dbpassword' => array( 'type' => 'password', 'value' => '', - 'required' => TRUE, + 'required' => FALSE, ), 'dbname' => array( 'type' => 'text', -- cgit v1.2.3 From 0212a359267ab5e109a80d14f8c069225202ac3b Mon Sep 17 00:00:00 2001 From: cash Date: Sat, 14 May 2011 23:11:15 +0000 Subject: fixed the width of text boxes for the installer git-svn-id: http://code.elgg.org/elgg/trunk@9086 36083f99-b078-4883-b0ff-0f9b5a30f544 --- install/css/install.css | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) (limited to 'install') diff --git a/install/css/install.css b/install/css/install.css index 8dba57949..7304127ce 100644 --- a/install/css/install.css +++ b/install/css/install.css @@ -62,13 +62,6 @@ ul { list-style: none; } -.clearfloat { - clear:both; - height:0; - font-size: 1px; - line-height: 0px; -} - .elgg-page { width: 880px; margin: auto; @@ -88,12 +81,12 @@ ul { .elgg-page-body:after, .elgg-page-header:after { - display:block; - content:'.'; - line-height:0; - height:0; + display: block; + content: '.'; + line-height: 0; + height: 0; visibility: hidden; - clear:both; + clear: both; } .elgg-sidebar { @@ -166,12 +159,12 @@ input[type="password"] { font: 120% Arial, Helvetica, sans-serif; padding: 5px; border: 1px solid #cccccc; - color:#666666; - width:566px; + color: #666666; + width: 96%; } .database-settings input[type="text"], .database-settings input[type="password"] { - width:220px; + width: 220px; } textarea { width: 100%; @@ -179,12 +172,12 @@ textarea { font: 120% Arial, Helvetica, sans-serif; border: solid 1px #cccccc; padding: 5px; - color:#666666; + color: #666666; } textarea:focus, input[type="password"]:focus, input[type="text"]:focus { border: solid 1px #4690d6; background: #e4ecf5; - color:#333333; + color: #333333; } input[type="submit"] { font-family: Arial, Helvetica, sans-serif; -- cgit v1.2.3 From 77897d4efad074d9434a97a67052bc788c315dee Mon Sep 17 00:00:00 2001 From: cash Date: Sun, 15 May 2011 19:38:49 +0000 Subject: Refs #3453 an implementation of creating the data directory. This capability is turned off due to security concerns. git-svn-id: http://code.elgg.org/elgg/trunk@9088 36083f99-b078-4883-b0ff-0f9b5a30f544 --- install/ElggInstaller.php | 85 +++++++++++++++++++++++++-- install/ElggRewriteTester.php | 10 ++-- install/css/install.css | 29 ++++----- install/js/install.js | 16 ++++- install/languages/en.php | 2 + views/installation/forms/install/template.php | 4 +- views/installation/input/checkbox.php | 37 ++++++------ views/installation/input/checkboxes.php | 64 -------------------- views/installation/input/combo.php | 19 ++++++ views/installation/input/form.php | 4 +- views/installation/input/hidden.php | 10 ---- views/installation/input/text.php | 22 ++++--- 12 files changed, 168 insertions(+), 134 deletions(-) delete mode 100644 views/installation/input/checkboxes.php create mode 100644 views/installation/input/combo.php delete mode 100644 views/installation/input/hidden.php (limited to 'install') diff --git a/install/ElggInstaller.php b/install/ElggInstaller.php index 6b8b8d747..1a8edf1ae 100644 --- a/install/ElggInstaller.php +++ b/install/ElggInstaller.php @@ -2,7 +2,27 @@ /** * Elgg Installer. - * Controller for installing Elgg. + * Controller for installing Elgg. Supports both web-based on CLI installation. + * + * This controller steps the user through the install process. The method for + * each step handles both the GET and POST requests. There is no XSS/CSRF protection + * on the POST processing since the installer is only run once by the administrator. + * + * The installation process can be resumed by hitting the first page. The installer + * will try to figure out where to pick up again. + * + * All the logic for the installation process is in this class, but it depends on + * the core libraries. To do this, we selectively load a subset of the core libraries + * for the first few steps and then load the entire engine once the database and + * site settings are configured. In addition, this controller does its own session + * handling until the database is setup. + * + * There is an aborted attempt in the code at creating the data directory for + * users as a subdirectory of Elgg's root. The idea was to protect this directory + * through a .htaccess file. The problem is that a malicious user can upload a + * .htaccess of his own that overrides the protection for his user directory. The + * best solution is server level configuration that turns off AllowOverride for the + * data directory. See ticket #3453 for discussion on this. * * @package Elgg.Core * @subpackage Installer @@ -32,6 +52,9 @@ class ElggInstaller { * Constructor bootstraps the Elgg engine */ public function __construct() { + // load ElggRewriteTester as we depend on it + require_once(dirname(__FILE__) . "/ElggRewriteTester.php"); + $this->isAction = $_SERVER['REQUEST_METHOD'] === 'POST'; $this->bootstrapConfig(); @@ -140,7 +163,6 @@ class ElggInstaller { $params['password1'] = $params['password2'] = $params['password']; if ($createHtaccess) { - require_once(dirname(__FILE__) . "/ElggRewriteTester.php"); $rewriteTester = new ElggRewriteTester(); if (!$rewriteTester->createHtaccess($CONFIG->path)) { throw new InstallationException(elgg_echo('install:error:htaccess')); @@ -355,7 +377,6 @@ class ElggInstaller { protected function settings($submissionVars) { global $CONFIG; - $languages = get_installed_translations(); $formVars = array( 'sitename' => array( 'type' => 'text', @@ -389,8 +410,19 @@ class ElggInstaller { ), ); + // if Apache, we give user option of having Elgg create data directory + //if (ElggRewriteTester::guessWebServer() == 'apache') { + // $formVars['dataroot']['type'] = 'combo'; + // $CONFIG->translations['en']['install:settings:help:dataroot'] = + // $CONFIG->translations['en']['install:settings:help:dataroot:apache']; + //} + if ($this->isAction) { do { + //if (!$this->createDataDirectory($submissionVars, $formVars)) { + // break; + //} + if (!$this->validateSettingsVars($submissionVars, $formVars)) { break; } @@ -709,6 +741,11 @@ class ElggInstaller { session_name('Elgg'); session_start(); elgg_unregister_event_handler('boot', 'system', 'session_init'); + } else if ($stepIndex == ($settingsIndex + 1)) { + // now using Elgg session handling so need to pass forward the system messages + session_name('Elgg'); + session_start(); + $messages = $_SESSION['msg']; } if ($stepIndex > $dbIndex) { @@ -751,6 +788,11 @@ class ElggInstaller { elgg_trigger_event('boot', 'system'); elgg_trigger_event('init', 'system'); + + // @hack finish the process of pushing system messages into new session + if ($stepIndex == ($settingsIndex + 1)) { + $_SESSION['msg'] = $messages; + } } } @@ -1025,8 +1067,6 @@ class ElggInstaller { protected function checkRewriteRules(&$report) { global $CONFIG; - require_once(dirname(__FILE__) . "/ElggRewriteTester.php"); - $tester = new ElggRewriteTester(); $url = elgg_get_site_url() . "rewrite.php"; $report['rewrite'] = array($tester->run($url, $CONFIG->path)); @@ -1220,6 +1260,39 @@ class ElggInstaller { * Site settings support methods */ + /** + * Create the data directory if requested + * + * @param array $submissionVars Submitted vars + * @param array $formVars Variables in the form + * @return bool + */ + protected function createDataDirectory(&$submissionVars, $formVars) { + // did the user have option of Elgg creating the data directory + if ($formVars['dataroot']['type'] != 'combo') { + return TRUE; + } + + // did the user select the option + if ($submissionVars['dataroot'] != 'dataroot-checkbox') { + return TRUE; + } + + $dir = sanitise_filepath($submissionVars['path']) . 'data'; + if (file_exists($dir) || mkdir($dir, 0700)) { + $submissionVars['dataroot'] = $dir; + if (!file_exists("$dir/.htaccess")) { + $htaccess = "Order Deny,Allow\nDeny from All\n"; + if (!file_put_contents("$dir/.htaccess", $htaccess)) { + return FALSE; + } + } + return TRUE; + } + + return FALSE; + } + /** * Validate the site settings form variables * @@ -1239,7 +1312,7 @@ class ElggInstaller { } } - // check that data root is writable + // check that data root exists if (!file_exists($submissionVars['dataroot'])) { $msg = elgg_echo('install:error:datadirectoryexists', array($submissionVars['dataroot'])); register_error($msg); diff --git a/install/ElggRewriteTester.php b/install/ElggRewriteTester.php index c8a503cb8..c01510f60 100644 --- a/install/ElggRewriteTester.php +++ b/install/ElggRewriteTester.php @@ -30,7 +30,7 @@ class ElggRewriteTester { */ public function run($url, $path) { - $this->guessWebServer(); + $this->webserver = ElggRewriteTester::guessWebServer(); $this->rewriteTestPassed = $this->runRewriteTest($url); @@ -48,17 +48,17 @@ class ElggRewriteTester { /** * Guess the web server from $_SERVER['SERVER_SOFTWARE'] * - * @return void + * @return string */ - protected function guessWebServer() { + public static function guessWebServer() { $serverString = strtolower($_SERVER['SERVER_SOFTWARE']); $possibleServers = array('apache', 'nginx', 'lighttpd', 'iis'); foreach ($possibleServers as $server) { if (strpos($serverString, $server) !== FALSE) { - $this->webserver = $server; - return; + return $server; } } + return 'unknown'; } /** diff --git a/install/css/install.css b/install/css/install.css index 7304127ce..25a8c865c 100644 --- a/install/css/install.css +++ b/install/css/install.css @@ -94,9 +94,9 @@ ul { width: 250px; } .elgg-body { - overflow:hidden; + overflow: hidden; min-height: 320px; - padding-bottom: 60px; + padding-bottom: 10px; position: relative; } .elgg-page-footer { @@ -149,11 +149,17 @@ h3 { margin: 15px 0 5px; } +form > div { + margin-bottom: 15px; +} label { font-weight: bold; - color:#333333; + color: #333333; font-size: 140%; } +.elgg-combo-label { + font-size: 120%; +} input[type="text"], input[type="password"] { font: 120% Arial, Helvetica, sans-serif; @@ -166,15 +172,7 @@ input[type="password"] { .database-settings input[type="password"] { width: 220px; } -textarea { - width: 100%; - height: 100%; - font: 120% Arial, Helvetica, sans-serif; - border: solid 1px #cccccc; - padding: 5px; - color: #666666; -} -textarea:focus, input[type="password"]:focus, input[type="text"]:focus { +input[type="password"]:focus, input[type="text"]:focus { border: solid 1px #4690d6; background: #e4ecf5; color: #333333; @@ -198,12 +196,10 @@ input[type="submit"] { cursor: pointer; float: right; } - input[type="submit"]:hover { background: #0054a7; border: 4px solid #0054a7; } - select { display: block; padding: 5px; @@ -257,6 +253,11 @@ select { background: #F7DAD8; } +.elgg-state-warning { + border: 1px solid #ded0a9; + background: #FEF5AA; +} + .elgg-body li { margin-top: 5px; padding: 5px; diff --git a/install/js/install.js b/install/js/install.js index 8d36c8a65..49b2be10c 100644 --- a/install/js/install.js +++ b/install/js/install.js @@ -1,11 +1,21 @@ -// prevent double-submission of forms $(function() { + // prevent double-submission of forms $('form').submit(function() { - if (this.data('submitted')) { + if ($(this).data('submitted')) { return false; } - this.data('submitted', true); + $(this).data('submitted', true); return true; }); + + // toggle the disable attribute of text box based on checkbox + $('.elgg-combo-checkbox').click(function() { + if ($(this).is(':checked')) { + $(this).prev().attr('disabled', true); + $(this).prev().val(''); + } else { + $(this).prev().attr('disabled', false); + } + }); }); diff --git a/install/languages/en.php b/install/languages/en.php index 80716069d..6b1398db4 100644 --- a/install/languages/en.php +++ b/install/languages/en.php @@ -79,12 +79,14 @@ If you are ready to proceed, click the Next button.", 'install:settings:label:dataroot' => 'Data Directory', 'install:settings:label:language' => 'Site Language', 'install:settings:label:siteaccess' => 'Default Site Access', + 'install:label:combo:dataroot' => 'Elgg creates data directory', 'install:settings:help:sitename' => 'The name of your new Elgg site', 'install:settings:help:siteemail' => 'Email address used by Elgg for communication with users', 'install:settings:help:wwwroot' => 'The address of the site (Elgg usually guesses this correctly)', 'install:settings:help:path' => 'The directory where you put the Elgg code (Elgg usually guesses this correctly)', 'install:settings:help:dataroot' => 'The directory that you created for Elgg to save files (the permissions on this directory are checked when you click Next)', + 'install:settings:help:dataroot:apache' => 'You have the option of Elgg creating the data directory or entering the directory that you already created for storing user files (the permissions on this directory are checked when you click Next)', 'install:settings:help:language' => 'The default language for the site', 'install:settings:help:siteaccess' => 'The default access level for new user created content', diff --git a/views/installation/forms/install/template.php b/views/installation/forms/install/template.php index ea9a08a3d..385168fe4 100644 --- a/views/installation/forms/install/template.php +++ b/views/installation/forms/install/template.php @@ -15,11 +15,11 @@ foreach ($variables as $field => $params) { $help = elgg_echo("install:$type:help:$field"); $params['name'] = $field; - $form_body .= '

'; + $form_body .= '

'; $form_body .= ""; $form_body .= elgg_view("input/{$params['type']}", $params); $form_body .= "$help"; - $form_body .= '

'; + $form_body .= '
'; } $submit_params = array( diff --git a/views/installation/input/checkbox.php b/views/installation/input/checkbox.php index 898fe8458..378eae6fd 100644 --- a/views/installation/input/checkbox.php +++ b/views/installation/input/checkbox.php @@ -2,32 +2,29 @@ /** * Elgg checkbox input * Displays a checkbox input tag - * - * @package Elgg - * @subpackage Core * - * - * Pass input tag attributes as key value pairs. For a list of allowable - * attributes, see http://www.w3schools.com/tags/tag_input.asp - * - * @uses mixed $vars['default'] The default value to submit if not checked. - * Optional, defaults to 0. Set to false for no default. + * @uses $var['name'] + * @uses $vars['value'] + * @uses $vars['id'] + * @uses $vars['class'] */ -$defaults = array( - 'class' => 'elgg-input-checkbox', - 'default' => 0, -); - -$vars = array_merge($defaults, $vars); +if (isset($vars['id'])) { + $id = "id=\"{$vars['id']}\""; +} else { + $id = ''; +} -$default = $vars['default']; -unset($vars['default']); +if (isset($vars['class'])) { + $id = "class=\"{$vars['class']}\""; +} else { + $id = ''; +} -if (isset($vars['name']) && $default !== false) { - echo ""; +if (!isset($vars['value'])) { + $vars['value'] = $vars['name']; } ?> - /> \ No newline at end of file + name="" value="" /> \ No newline at end of file diff --git a/views/installation/input/checkboxes.php b/views/installation/input/checkboxes.php deleted file mode 100644 index 026ff04ba..000000000 --- a/views/installation/input/checkboxes.php +++ /dev/null @@ -1,64 +0,0 @@ - option for the each checkbox field - * @uses string $vars['id'] The id for each input field. Optional. - * (Only use this with a single value.) - * @uses string $vars['default'] The default value to send if nothing is checked. - * Optional, defaults to 0. Set to FALSE for no default. - * @uses bool $vars['disabled'] Make all input elements disabled. Optional. - * @uses string $vars['value'] The current value. Optional. - * @uses string $vars['class'] Additional class of the list. Optional. - * @uses string $vars['align'] 'horizontal' or 'vertical' Default: 'vertical' - * - */ - -$additional_class = elgg_extract('class', $vars); -$align = elgg_extract('align', $vars, 'vertical'); -$value = (isset($vars['value'])) ? $vars['value'] : NULL; -$value_array = (is_array($value)) ? array_map('elgg_strtolower', $value) : array(elgg_strtolower($value)); -$name = (isset($vars['name'])) ? $vars['name'] : ''; -$options = (isset($vars['options']) && is_array($vars['options'])) ? $vars['options'] : array(); -$default = (isset($vars['default'])) ? $vars['default'] : 0; - -$id = (isset($vars['id'])) ? $vars['id'] : ''; -$disabled = (isset($vars['disabled'])) ? $vars['disabled'] : FALSE; - -$class = "elgg-input-checkboxes elgg-$align"; -if ($additional_class) { - $class = " $additional_class"; -} - -if ($options && count($options) > 0) { - // include a default value so if nothing is checked 0 will be passed. - if ($name && $default !== FALSE) { - echo ""; - } - - echo "
    "; - foreach ($options as $label => $option) { - - $input_vars = array( - 'checked' => in_array(elgg_strtolower($option), $value_array), - 'value' => $option, - 'disabled' => $disabled, - 'id' => $id, - 'default' => false, - ); - - if ($name) { - $input_vars['name'] = "{$name}[]"; - } - - $input = elgg_view('input/checkbox', $input_vars); - - echo "
  • "; - } - echo '
'; -} \ No newline at end of file diff --git a/views/installation/input/combo.php b/views/installation/input/combo.php new file mode 100644 index 000000000..508dbcd01 --- /dev/null +++ b/views/installation/input/combo.php @@ -0,0 +1,19 @@ +$label"; + +echo '
'; \ No newline at end of file diff --git a/views/installation/input/form.php b/views/installation/input/form.php index d48d5fed8..f8730b4f5 100644 --- a/views/installation/input/form.php +++ b/views/installation/input/form.php @@ -10,12 +10,12 @@ */ if (isset($vars['id'])) { - $id = "id = \"{$vars['id']}\""; + $id = "id=\"{$vars['id']}\""; } else { $id = ''; } if (isset($vars['name'])) { - $name = "name = \"{$vars['name']}\""; + $name = "name=\"{$vars['name']}\""; } else { $name = ''; } diff --git a/views/installation/input/hidden.php b/views/installation/input/hidden.php deleted file mode 100644 index 139ff03d7..000000000 --- a/views/installation/input/hidden.php +++ /dev/null @@ -1,10 +0,0 @@ - - \ No newline at end of file diff --git a/views/installation/input/text.php b/views/installation/input/text.php index 2caf547b6..ec8233461 100644 --- a/views/installation/input/text.php +++ b/views/installation/input/text.php @@ -3,17 +3,23 @@ * Elgg text input * Displays a text input field * - * * @uses $vars['value'] The current value, if any - * @uses $vars['name'] The name of the input field - * @uses $vars['disabled'] If true then control is read-only - * @uses $vars['class'] Class override + * @uses $vars['name'] The name of the input field + * @uses $vars['class'] CSS class + * @uses $vars['id'] CSS id */ -$class = $vars['class']; -if (!$class) { - $class = "input-text"; +if (isset($vars['class'])) { + $class = "class=\"{$vars['class']}\""; +} else { + $class = ""; +} + +if (isset($vars['id'])) { + $id = "id=\"{$vars['id']}\""; +} else { + $id = ''; } ?> - name="" value="" class=""/> \ No newline at end of file + /> \ No newline at end of file -- cgit v1.2.3 From 0eb10007cf8d26c07e4e1759d1f698092f6dcd6e Mon Sep 17 00:00:00 2001 From: cash Date: Sun, 15 May 2011 21:44:28 +0000 Subject: Refs #3453 added $CONFIG->data_dir_override so that people can put the data directory in Elgg's root if they want to. Will add instructions to the wiki on using this and protecting the directory git-svn-id: http://code.elgg.org/elgg/trunk@9089 36083f99-b078-4883-b0ff-0f9b5a30f544 --- install/ElggInstaller.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'install') diff --git a/install/ElggInstaller.php b/install/ElggInstaller.php index 1a8edf1ae..719e9b67f 100644 --- a/install/ElggInstaller.php +++ b/install/ElggInstaller.php @@ -480,7 +480,7 @@ class ElggInstaller { 'required' => TRUE, ), ); - + if ($this->isAction) { do { if (!$this->validateAdminVars($submissionVars, $formVars)) { @@ -1302,6 +1302,7 @@ class ElggInstaller { * @return bool */ protected function validateSettingsVars($submissionVars, $formVars) { + global $CONFIG; foreach ($formVars as $field => $info) { $submissionVars[$field] = trim($submissionVars[$field]); @@ -1326,11 +1327,13 @@ class ElggInstaller { return FALSE; } - // check that data root is not subdirectory of Elgg root - if (stripos($submissionVars['dataroot'], $submissionVars['path']) !== FALSE) { - $msg = elgg_echo('install:error:locationdatadirectory', array($submissionVars['dataroot'])); - register_error($msg); - return FALSE; + if (!isset($CONFIG->data_dir_override) || !$CONFIG->data_dir_override) { + // check that data root is not subdirectory of Elgg root + if (stripos($submissionVars['dataroot'], $submissionVars['path']) !== FALSE) { + $msg = elgg_echo('install:error:locationdatadirectory', array($submissionVars['dataroot'])); + register_error($msg); + return FALSE; + } } // check that email address is email address -- cgit v1.2.3 From ebd509e69cb5c95922fe2f813cd546cb5b74a742 Mon Sep 17 00:00:00 2001 From: cash Date: Sun, 15 May 2011 22:33:05 +0000 Subject: fixed regenerating cache when installing Elgg - wasn't picking up the plugins before git-svn-id: http://code.elgg.org/elgg/trunk@9091 36083f99-b078-4883-b0ff-0f9b5a30f544 --- install/ElggInstaller.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'install') diff --git a/install/ElggInstaller.php b/install/ElggInstaller.php index 719e9b67f..8da898428 100644 --- a/install/ElggInstaller.php +++ b/install/ElggInstaller.php @@ -524,6 +524,8 @@ class ElggInstaller { $params['destination'] = 'index.php'; } + elgg_invalidate_simplecache(); + $this->render('complete', $params); } @@ -1405,8 +1407,6 @@ class ElggInstaller { $CONFIG->dataroot = $dataroot; $cache = new ElggFileCache($dataroot); $cache->delete('view_paths'); - elgg_invalidate_simplecache(); - elgg_regenerate_simplecache(); return TRUE; } -- cgit v1.2.3 From d45a50258f2f33bf153f67d0495a3b7e0062a683 Mon Sep 17 00:00:00 2001 From: cash Date: Sun, 15 May 2011 22:39:43 +0000 Subject: do not need to initialize globals in installer because they are now declared that way in Elgg core libs git-svn-id: http://code.elgg.org/elgg/trunk@9092 36083f99-b078-4883-b0ff-0f9b5a30f544 --- install/ElggInstaller.php | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'install') diff --git a/install/ElggInstaller.php b/install/ElggInstaller.php index 8da898428..68c88f620 100644 --- a/install/ElggInstaller.php +++ b/install/ElggInstaller.php @@ -784,8 +784,6 @@ class ElggInstaller { } } - $this->initGlobals(); - set_default_config(); elgg_trigger_event('boot', 'system'); @@ -1525,19 +1523,4 @@ class ElggInstaller { return TRUE; } - - /** - * Init globals because engine loaded within a function - * - * @return void - */ - protected function initGlobals() { - global $DB_QUERY_CACHE, $DB_DELAYED_QUERIES; - $DB_QUERY_CACHE = array(); - $DB_DELAYED_QUERIES = array(); - - global $METASTRINGS_CACHE, $METASTRINGS_DEADNAME_CACHE; - $METASTRINGS_CACHE = array(); - $METASTRINGS_DEADNAME_CACHE = array(); - } } -- cgit v1.2.3 From e76ebabb5bb5a6b5224c03baad5bdc510c288dfe Mon Sep 17 00:00:00 2001 From: cash Date: Sun, 15 May 2011 22:50:15 +0000 Subject: fixed issue introduced with the session changes in the installer git-svn-id: http://code.elgg.org/elgg/trunk@9093 36083f99-b078-4883-b0ff-0f9b5a30f544 --- install/ElggInstaller.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'install') diff --git a/install/ElggInstaller.php b/install/ElggInstaller.php index 68c88f620..584b5cb79 100644 --- a/install/ElggInstaller.php +++ b/install/ElggInstaller.php @@ -743,8 +743,9 @@ class ElggInstaller { session_name('Elgg'); session_start(); elgg_unregister_event_handler('boot', 'system', 'session_init'); - } else if ($stepIndex == ($settingsIndex + 1)) { + } 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']; @@ -790,7 +791,7 @@ class ElggInstaller { elgg_trigger_event('init', 'system'); // @hack finish the process of pushing system messages into new session - if ($stepIndex == ($settingsIndex + 1)) { + if (!$this->isAction && $stepIndex == ($settingsIndex + 1)) { $_SESSION['msg'] = $messages; } } -- cgit v1.2.3 From 758e7c0db6f3c774f9670c2cf79a14b335c906ce Mon Sep 17 00:00:00 2001 From: cash Date: Sun, 15 May 2011 23:08:44 +0000 Subject: fixed display issue in installation where navigation was overlapping requirements git-svn-id: http://code.elgg.org/elgg/trunk@9094 36083f99-b078-4883-b0ff-0f9b5a30f544 --- install/css/install.css | 4 ++++ views/installation/install/pages/requirements.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'install') diff --git a/install/css/install.css b/install/css/install.css index 25a8c865c..b1a038d1b 100644 --- a/install/css/install.css +++ b/install/css/install.css @@ -209,6 +209,10 @@ select { font-size: 90%; } +.elgg-require-database { + padding-bottom: 50px; +} + .install-nav a { font-family: Arial, Helvetica, sans-serif; font-size: 16px; diff --git a/views/installation/install/pages/requirements.php b/views/installation/install/pages/requirements.php index b6516840f..e3689e761 100644 --- a/views/installation/install/pages/requirements.php +++ b/views/installation/install/pages/requirements.php @@ -20,7 +20,7 @@ $report = $vars['report']; foreach ($report as $category => $checks) { $title = elgg_echo("install:require:$category"); echo "

$title

"; - echo "
    "; + echo "
      "; foreach ($checks as $check) { echo "
    • "; echo autop($check['message']); -- cgit v1.2.3 From 0e80cee00895f3cc2df332a62fa9ea5c08e47031 Mon Sep 17 00:00:00 2001 From: cash Date: Sun, 15 May 2011 23:09:53 +0000 Subject: Fixes #3453 added link to wiki about the data directory git-svn-id: http://code.elgg.org/elgg/trunk@9095 36083f99-b078-4883-b0ff-0f9b5a30f544 --- install/languages/en.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'install') diff --git a/install/languages/en.php b/install/languages/en.php index 6b1398db4..3e2569669 100644 --- a/install/languages/en.php +++ b/install/languages/en.php @@ -70,7 +70,7 @@ If you are ready to proceed, click the Next button.", 'install:database:help:dbhost' => 'Hostname of the MySQL server (usually localhost)', 'install:database:help:dbprefix' => "The prefix given to all of Elgg's tables (usually elgg_)", - 'install:settings:instructions' => "We need some information about the site as we configure Elgg. If you haven't created a data directory for Elgg, please do so before completing this step.", + 'install:settings:instructions' => 'We need some information about the site as we configure Elgg. If you haven\'t created a data directory for Elgg, you need to do so now.', 'install:settings:label:sitename' => 'Site Name', 'install:settings:label:siteemail' => 'Site Email Address', -- cgit v1.2.3 From dc63bae18867c8932dea1c56a5d3d46a11da5873 Mon Sep 17 00:00:00 2001 From: cash Date: Fri, 3 Jun 2011 11:04:12 +0000 Subject: Fixes #3520 fix check for subdirectory in installer git-svn-id: http://code.elgg.org/elgg/trunk@9136 36083f99-b078-4883-b0ff-0f9b5a30f544 --- install/ElggInstaller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'install') diff --git a/install/ElggInstaller.php b/install/ElggInstaller.php index 584b5cb79..c07839065 100644 --- a/install/ElggInstaller.php +++ b/install/ElggInstaller.php @@ -1330,7 +1330,7 @@ class ElggInstaller { if (!isset($CONFIG->data_dir_override) || !$CONFIG->data_dir_override) { // check that data root is not subdirectory of Elgg root - if (stripos($submissionVars['dataroot'], $submissionVars['path']) !== FALSE) { + if (stripos($submissionVars['dataroot'], $submissionVars['path']) === 0) { $msg = elgg_echo('install:error:locationdatadirectory', array($submissionVars['dataroot'])); register_error($msg); return FALSE; -- cgit v1.2.3 From 52f8484a15439295fb01a9c6f14284c676f48982 Mon Sep 17 00:00:00 2001 From: cash Date: Sat, 11 Jun 2011 11:50:01 +0000 Subject: fixed disabled button in installer - css class had changed git-svn-id: http://code.elgg.org/elgg/trunk@9166 36083f99-b078-4883-b0ff-0f9b5a30f544 --- install/css/install.css | 9 +++++---- views/installation/install/nav.php | 2 +- views/installation/install/pages/complete.php | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) (limited to 'install') diff --git a/install/css/install.css b/install/css/install.css index b1a038d1b..e7290c130 100644 --- a/install/css/install.css +++ b/install/css/install.css @@ -108,7 +108,7 @@ ul { margin-bottom: 40px; } -.install-nav { +.elgg-install-nav { width: 100%; text-align: right; position: absolute; @@ -213,7 +213,7 @@ select { padding-bottom: 50px; } -.install-nav a { +.elgg-install-nav a { font-family: Arial, Helvetica, sans-serif; font-size: 16px; font-weight: bold; @@ -231,12 +231,13 @@ select { float: right; } -.install-nav a:hover { +.elgg-install-nav a:hover { text-decoration: none; background: #0054a7; border: 4px solid #0054a7; } -.install-nav .disabled, .install-nav .disabled:hover { +.elgg-install-nav .elgg-state-disabled, +.elgg-install-nav .elgg-state-disabled:hover { background: #555555; border-color: #555555; cursor: default; diff --git a/views/installation/install/nav.php b/views/installation/install/nav.php index 5426071c6..76bd2ac50 100644 --- a/views/installation/install/nav.php +++ b/views/installation/install/nav.php @@ -27,7 +27,7 @@ if (isset($vars['advance']) && !$vars['advance']) { echo <<<___END -
      +
      $next $refresh
      diff --git a/views/installation/install/pages/complete.php b/views/installation/install/pages/complete.php index 0c9821fc2..2f5a04854 100644 --- a/views/installation/install/pages/complete.php +++ b/views/installation/install/pages/complete.php @@ -7,7 +7,7 @@ echo autop(elgg_echo('install:complete:instructions')); ?> -
      +