diff --git a/e107_languages/English/lan_installer.php b/e107_languages/English/lan_installer.php index 5d9385326..379c0350b 100644 --- a/e107_languages/English/lan_installer.php +++ b/e107_languages/English/lan_installer.php @@ -17,10 +17,10 @@ define("LANINS_001", "e107 Installation"); -define("LANINS_002", "Stage "); +define("LANINS_002", "Step "); define("LANINS_003", "1"); define("LANINS_004", "Language Selection"); -define("LANINS_005", "Please choose language to use during installation procedure"); +define("LANINS_005", "Please choose the language to use during installation"); define("LANINS_006", "Set Language"); define("LANINS_007", "4"); define("LANINS_008", "PHP & MySQL Versions Check / File Permissions Check"); @@ -52,7 +52,7 @@ define("LANINS_027", "MySQL Database:"); define("LANINS_028", "Create Database?"); define("LANINS_029", "Table prefix:"); define("LANINS_030", "The MySQL server you would like e107 to use. It can also include a port number. e.g. “hostname:port” or a path to a local socket e.g. \":/path/to/socket\" for the localhost."); -define("LANINS_031", "The username you wish e107 to use for connecting to your MySQL server"); +define("LANINS_031", "The username you wish e107 to use to connect to your MySQL server"); define("LANINS_032", "The Password for the user you just entered"); define("LANINS_033", "The MySQL database you wish e107 to reside in, sometimes referred to as a schema. If the user has database create permissions you can opt to create the database automatically if it doesn't already exist."); define("LANINS_034", "The prefix you wish e107 to use when creating the e107 tables. Useful for multiple installs of e107 in one database schema."); @@ -116,7 +116,7 @@ Also please delete install.php from your server after you have clicked the butto define("LANINS_070", "e107 was unable to save the main config file to your server. Please ensure the e107_config.php file has the correct permissions"); -define("LANINS_071", "Finalising Installation"); +define("LANINS_071", "Installation Complete"); define("LANINS_072", "Admin Username"); define("LANINS_073", "This is the name you will use to login into the site. If you wish to use this as your display name also"); @@ -177,6 +177,6 @@ define("LANINS_118", "Install Plugins"); define("LANINS_119", "Install all plugins that the theme may require."); define("LANINS_120", "8"); define('LANINS_121', 'e107_config.php is not an empty file'); -define('LANINS_122', 'Possibly you have an existing installation'); +define('LANINS_122', 'You might have an existing installation'); diff --git a/install_.php b/install_.php index 52c4d8dac..92153a6b7 100644 --- a/install_.php +++ b/install_.php @@ -35,32 +35,11 @@ define('MAKE_INSTALL_LOG', false); $MySQLprefix = 'e107_'; $HANDLERS_DIRECTORY = "e107_handlers/"; // needed for e107 class init -// Should be safe to disable this - done in e107 class -//$ADMIN_DIRECTORY = "e107_admin/"; -//$FILES_DIRECTORY = "e107_files/"; -//$IMAGES_DIRECTORY = "e107_images/"; -//$MEDIA_DIRECTORY = "e107_media/"; -//$THEMES_DIRECTORY = "e107_themes/"; -//$PLUGINS_DIRECTORY = "e107_plugins/"; -//$HANDLERS_DIRECTORY = "e107_handlers/"; -//$LANGUAGES_DIRECTORY = "e107_languages/"; -//$HELP_DIRECTORY = "e107_docs/help/"; -//$CACHE_DIRECTORY = "e107_system/cache/"; -//$DOWNLOADS_DIRECTORY = "e107_media/files/"; -//$UPLOADS_DIRECTORY = "e107_media/temp/"; -//$LOGS_DIRECTORY = "e107_files/logs"; -//$CORE_DIRECTORY = "e107_core/"; -//$SYSTEM_DIRECTORY = "e107_system/"; - -/* End configurable variables */ - -if(isset($_GET['object'])) -{ - get_object($_GET['object']); - die(); -} - define("e107_INIT", TRUE); +require_once("e107_admin/ver.php"); + +define("e_VERSION", $e107info['e107_version']); + /*define("e_UC_PUBLIC", 0); define("e_UC_MAINADMIN", 250); define("e_UC_READONLY", 251); @@ -71,8 +50,8 @@ define("e_UC_NOBODY", 255);*/ define("E107_INSTALL",TRUE); -error_reporting(E_ALL); - +error_reporting(E_ALL ^ E_NOTICE); //3rd Party Plugins may cause PHP Notices at the conclusion of installation. +//error_reporting(E_ALL); function e107_ini_set($var, $value) { @@ -396,11 +375,14 @@ class e_install $this->template->SetTag("stage_pre", LANINS_002); $this->template->SetTag("stage_num", LANINS_003); $this->template->SetTag("stage_title", LANINS_004); + $this->template->SetTag("percent", 10); + $this->template->SetTag("bartype", 'warning'); + $e_forms->start_form("language_select", $_SERVER['PHP_SELF'].($_SERVER['QUERY_STRING'] == "debug" ? "?debug" : "")); $e_forms->add_select_item("language", $this->get_languages(), "English"); $this->finish_form(); - $e_forms->add_button("submit", LANINS_006); - $this->template->SetTag("stage_content", "
\n


\n".$e_forms->return_form()."
"); + $e_forms->add_button("start", LANINS_035); + $this->template->SetTag("stage_content", "
\n


\n".$e_forms->return_form()."
"); $this->logLine('Stage 1 completed'); } @@ -417,44 +399,62 @@ class e_install $this->template->SetTag("stage_pre", LANINS_002); $this->template->SetTag("stage_num", LANINS_021); $this->template->SetTag("stage_title", LANINS_022); - $this->template->SetTag("onload", "document.getElementById('name').focus()"); - $page_info = nl2br(LANINS_023); + $this->template->SetTag("percent", 25); + $this->template->SetTag("bartype", 'warning'); + + +// $this->template->SetTag("onload", "document.getElementById('name').focus()"); + // $page_info = nl2br(LANINS_023); + $page_info = "
Please fill in the form below with your MySQL details. If you do not know this information, please contact your hosting provider. You may hover over each field for additional information.
"; $e_forms->start_form("versions", $_SERVER['PHP_SELF'].($_SERVER['QUERY_STRING'] == "debug" ? "?debug" : "")); $output = "
-

- +
- - - + + + + + + + - - - + + + + + + + + - - - - - - - - - - - - - + +
".LANINS_030." + + ".LANINS_030."
+ + ".LANINS_031." +
".LANINS_031." + + ".LANINS_032." +
+ + + ".LANINS_033." + +
".LANINS_032."
-
".LANINS_033."
".LANINS_034." + + ".LANINS_034." +


\n"; + $e_forms->add_plain_html($output); $this->finish_form(); $e_forms->add_button("submit", LANINS_035); @@ -496,7 +496,8 @@ class e_install $this->template->SetTag("stage_pre", LANINS_002); $this->template->SetTag("stage_num", LANINS_036); $this->template->SetTag("onload", "document.getElementById('name').focus()"); - + $this->template->SetTag("percent", 40); + $this->template->SetTag("bartype", 'warning'); $this->previous_steps['mysql']['server'] = trim($_POST['server']); $this->previous_steps['mysql']['user'] = trim($_POST['name']); @@ -522,34 +523,34 @@ class e_install
- - - + + + - - - + + + - - - + + + - - + - + - - - + + + "; if (!$success) { - $output .= ""; + $output .= ""; } $output .= "
".LANINS_030."".LANINS_030."
".LANINS_031."".LANINS_031."
".LANINS_032."".LANINS_032."
+
".LANINS_033."".LANINS_033."
".LANINS_034."".LANINS_034."
".LANINS_105."
".LANINS_105."
@@ -567,10 +568,12 @@ class e_install { $success = FALSE; $page_content = LANINS_041.nl2br("\n\n".LANINS_083."\n".mysql_error().""); + + $alertType = 'error'; } else { - $page_content = LANINS_042; + $page_content = " ".LANINS_042; // @TODO Check database version here? /* $mysql_note = mysql_get_server_info(); @@ -603,14 +606,20 @@ class e_install else { $this->dbqry('SET NAMES `utf8`'); - $page_content .= "

".LANINS_044; + $page_content .= "
".LANINS_044; } } if($success) { $e_forms->start_form("versions", $_SERVER['PHP_SELF'].($_SERVER['QUERY_STRING'] == "debug" ? "?debug" : "")); - $page_content .= "

".LANINS_045."

"; + // $page_content .= "

".LANINS_045."

"; $e_forms->add_button("submit", LANINS_035); + $alertType = 'success'; + } + else + { + + $e_forms->add_button("back", LANINS_035); } $head = $page_content; } @@ -618,7 +627,7 @@ class e_install $this->finish_form(); else $this->finish_form(3); - $this->template->SetTag("stage_content", $head.$e_forms->return_form()); + $this->template->SetTag("stage_content", "
".$head."
".$e_forms->return_form()); $this->logLine('Stage 3 completed'); } @@ -637,11 +646,14 @@ class e_install $this->template->SetTag("stage_pre", LANINS_002); $this->template->SetTag("stage_num", LANINS_007); $this->template->SetTag("stage_title", LANINS_008); + $this->template->SetTag("percent", 50); + $this->template->SetTag("bartype", 'warning'); $not_writable = $this->check_writable_perms('must_write'); // Some directories MUST be writable $opt_writable = $this->check_writable_perms('can_write'); // Some directories CAN optionally be writable $version_fail = false; $perms_errors = ""; - + $mysql_pass = false; + if(count($not_writable)) { $perms_pass = false; @@ -664,13 +676,13 @@ class e_install { // Must start from an empty e107_config.php $perms_pass = FALSE; $perms_errors = LANINS_121; - $perms_notes = LANINS_122; + $perms_notes = " ".LANINS_122; } else { $perms_pass = true; $perms_errors = " "; - $perms_notes = LANINS_017; + $perms_notes = " ".LANINS_017; } if(!function_exists("mysql_connect")) @@ -689,11 +701,12 @@ class e_install $mysql_note = mysql_get_server_info(); if (version_compare($mysql_note, MIN_MYSQL_VERSION, '>=')) { - $mysql_help = LANINS_017; + $mysql_help = " ".LANINS_017; + $mysql_pass = true; } else { - $mysql_help = LANINS_105; + $mysql_help = " ".LANINS_105; } } if(!function_exists('utf8_encode')) @@ -708,11 +721,11 @@ class e_install $php_version = phpversion(); if(version_compare($php_version, MIN_PHP_VERSION, ">=")) { - $php_help = LANINS_017; + $php_help = " ".LANINS_017; } else { - $php_help = LANINS_019; + $php_help = " ".LANINS_019; } $e_forms->start_form("versions", $_SERVER['PHP_SELF'].($_SERVER['QUERY_STRING'] == "debug" ? "?debug" : "")); if(!$perms_pass) @@ -724,29 +737,35 @@ class e_install { $e_forms->add_button("continue_install", LANINS_020); } + + $permColor = ($perms_pass == true) ? "text-success" : "text-error"; + $PHPColor = ($version_fail == false) ? "text-success" : "text-error"; + $xmlColor = ($xml_installed == true) ? "text-success" : "text-error"; + $mysqlColor = ($mysql_pass == true) ? "text-success" : "text-error"; + $output = " - +
- + - + - + - + -
".LANINS_014." {$perms_errors}{$perms_notes}{$perms_notes}
".LANINS_015." {$php_version}{$php_help}{$php_help}
".LANINS_016." {$mysql_note}{$mysql_help}{$mysql_help}
".LANINS_050." ".($xml_installed ? LANINS_051 : LANINS_052)."".($xml_installed ? LANINS_017 : LANINS_053)."".($xml_installed ? " ".LANINS_017 : LANINS_053)."
\n

\n\n"; + \n"; $this->finish_form(); $this->template->SetTag("stage_content", $output.$e_forms->return_form()); $this->logLine('Stage 4 completed'); @@ -774,37 +793,52 @@ class e_install $this->template->SetTag("stage_pre", LANINS_002); $this->template->SetTag("stage_num", LANINS_046); $this->template->SetTag("stage_title", LANINS_047); - $this->template->SetTag("onload", "document.getElementById('u_name').focus()"); - + // $this->template->SetTag("onload", "document.getElementById('u_name').focus()"); + $this->template->SetTag("percent", 60); + $this->template->SetTag("bartype", 'warning'); $e_forms->start_form("admin_info", $_SERVER['PHP_SELF'].($_SERVER['QUERY_STRING'] == "debug" ? "?debug" : "")); $output = "
- +
- - - + + + - - - + + + - - - + + + - - - + + + - - - + +
previous_steps['admin']['user'] : "")."' maxlength='60' />".LANINS_073." + previous_steps['admin']['user'] : "")."' maxlength='60' /> + ".LANINS_073." +
previous_steps['admin']['display'] : "")."' maxlength='60' />".LANINS_075." + previous_steps['admin']['display'] : "")."' maxlength='60' /> + Optional: Your public name or alias. Leave blank to use the user name +
".LANINS_077." + + Please choose a password of at least 8 characters +
".LANINS_079." + + ".LANINS_079." +
previous_steps['admin']['email'] : LANINS_082)."' maxlength='100' />".LANINS_081." + previous_steps['admin']['email'] : '')."' maxlength='100' /> + ".LANINS_081." +


@@ -899,31 +933,37 @@ class e_install $this->template->SetTag("stage_pre", LANINS_002); $this->template->SetTag("stage_num", LANINS_056); $this->template->SetTag("stage_title", LANINS_117); // Website Preferences; - $this->template->SetTag("onload", "document.getElementById('sitename').focus()"); + // $this->template->SetTag("onload", "document.getElementById('sitename').focus()"); + $this->template->SetTag("percent", 70); + $this->template->SetTag("bartype", 'warning'); $e_forms->start_form("pref_info", $_SERVER['PHP_SELF'].($_SERVER['QUERY_STRING'] == "debug" ? "?debug" : "")); $output = "
- - - - +
+ + + - - + + - -
- ".LANINS_108." + +

".LANINS_110."
- + +

".LANINS_110."
+ + - - - "; + + + + + "; $themes = $this->get_themes(); @@ -934,7 +974,7 @@ class e_install $category = vartrue($themeInfo['category']); $output .= " - + "; } @@ -943,17 +983,18 @@ class e_install - - + - - + +
".LANINS_115."".LANINS_116."
".LANINS_115."".LANINS_116."
{$title} {$category}
- ".LANINS_119." + + ".LANINS_119."
- ".LANINS_112." + + ".LANINS_112."
\n"; @@ -1029,9 +1070,11 @@ class e_install $this->template->SetTag("stage_pre", LANINS_002); $this->template->SetTag("stage_num", LANINS_058); $this->template->SetTag("stage_title", LANINS_055); + $this->template->SetTag("percent", 80); + $this->template->SetTag("bartype", 'warning'); $e_forms->start_form("confirmation", $_SERVER['PHP_SELF'].($_SERVER['QUERY_STRING'] == "debug" ? "?debug" : "")); - $page = nl2br(LANINS_057); + $page = '
'.nl2br(LANINS_057).'
'; $this->finish_form(); $e_forms->add_button("submit", LANINS_035); @@ -1072,10 +1115,10 @@ class e_install $this->template->SetTag("stage_pre", LANINS_002); $this->template->SetTag("stage_num", LANINS_120); $this->template->SetTag("stage_title", LANINS_071); - + $this->template->SetTag("percent", 100); + $this->template->SetTag("bartype", 'success'); - - + $htaccessError = $this->htaccess(); $config_file = "previous_steps['mysql']['password']}'; \$mySQLdefaultdb = '{$this->previous_steps['mysql']['db']}'; \$mySQLprefix = '{$this->previous_steps['mysql']['prefix']}'; -// \$mySQLcharset can only contain 'utf8' or '' -//@TODO remove in the future -\$mySQLcharset = 'utf8'; - \$ADMIN_DIRECTORY = '{$this->e107->e107_dirs['ADMIN_DIRECTORY']}'; \$FILES_DIRECTORY = '{$this->e107->e107_dirs['FILES_DIRECTORY']}'; @@ -1122,6 +1161,7 @@ class e_install { $page = $config_result."
"; $this->logLine('Error writing config file: '.$config_result); + $alertType = 'warning'; } else { @@ -1131,20 +1171,62 @@ class e_install { $this->logLine('Errors creating tables: '.$errors); $page = $errors."
"; + $alertType = 'error'; } + else { + $alertType = 'success'; $this->logLine('Tables created successfully'); $this->import_configuration(); $page = nl2br(LANINS_069)."
"; + + if($htaccessError) + { + + $page .= "

".$htaccessError."

"; + } + $e_forms->add_button('submit', LANINS_035); } } $this->finish_form(); - $this->template->SetTag("stage_content", $page.$e_forms->return_form()); + $this->template->SetTag("stage_content", "
".$page."
".$e_forms->return_form()); $this->logLine('Stage 8 completed'); } + // Handle the .htaccess file; + protected function htaccess() + { + $error = ""; + + if(!file_exists(".htaccess")) + { + if(!rename("e107.htaccess",".htaccess")) + { + $error = "IMPORTANT: Please rename e107.htaccess to .htaccess"; + } + } + else + { + $error = "IMPORTANT: Please copy and paste the contents of the e107.htaccess into your .htaccess file. Please take care NOT to overwrite any existing data that may be in it."; + } + + return $error; + + } + + + + + + + + + + + + /** @@ -1756,7 +1838,16 @@ class e_forms { function add_button($id, $title, $align = "right", $type = "submit") { - $this->form .= "
\n"; + $this->form .= "
"; + if($id != 'start') + { + $this->form .= "« Back "; + } + if($id != 'back') + { + $this->form .= ""; + } + $this->form .= "
\n"; } function add_hidden_data($id, $data) @@ -1887,6 +1978,7 @@ class SimpleTemplate function template_data() { + /* $data = " @@ -1918,9 +2010,83 @@ function template_data() "; +*/ + + +$data = ' + + + + {installation_heading} :: {stage_pre}{stage_num} - {stage_title} + + + + + + + + + +
+ + + +
+

{stage_title}

+ {stage_content} +
+ + + +
+ + + + + + + + + +'; + + + return $data; } +/* function get_object($name) { switch ($name) @@ -2020,7 +2186,7 @@ td { }"; break; - /* The following data is base64 encoded to preserve binary state in ASCII file */ + //The following data is base64 encoded to preserve binary state in ASCII file case "01_footer.jpg": header("Content-type: image/jpeg"); @@ -2978,4 +3144,7 @@ iR/pUPUH/fi5F/8AyrX/AIMn/Y/nJc2ZOL/FM/vj/uoplVx95+5//9k=")); R0lGODlhAwABAJEAAAAAAP///1xcXP///yH5BAEAAAMALAAAAAADAAEAAAIC1FYAOw==")); break; } + + } + * */ \ No newline at end of file