diff --git a/install/assets/css/overrides.css b/install/assets/css/installer.css similarity index 96% rename from install/assets/css/overrides.css rename to install/assets/css/installer.css index d75390c6d..d6334cc37 100644 --- a/install/assets/css/overrides.css +++ b/install/assets/css/installer.css @@ -205,8 +205,18 @@ div.alert-danger { --bs-tooltip-opacity: 1; } -#languageButton { +#languageButton, #advancedSettingsButton, #resetButton { position: absolute; bottom: 70px; right: 20px; +} + +.required:after { + content: " *"; + color: red; +} + +.required-prefix:before { + content: "* "; + color: red; } \ No newline at end of file diff --git a/install/config/config.php b/install/config/config.php index 2c4443207..d954cd39b 100644 --- a/install/config/config.php +++ b/install/config/config.php @@ -286,7 +286,7 @@ $config['allow_get_array'] = TRUE; | your log files will fill up very fast. | */ -$config['log_threshold'] = 0; +$config['log_threshold'] = '%log_threshold%'; /* |-------------------------------------------------------------------------- @@ -400,7 +400,7 @@ $config['cache_query_string'] = FALSE; | https://codeigniter.com/user_guide/libraries/encryption.html | */ -$config['encryption_key'] = 'flossie1234555541'; +$config['encryption_key'] = '%encryptionkey%'; /* |-------------------------------------------------------------------------- diff --git a/install/includes/core_class.php b/install/includes/core/core_class.php similarity index 92% rename from install/includes/core_class.php rename to install/includes/core/core_class.php index ccc39f012..58d2b1d83 100644 --- a/install/includes/core_class.php +++ b/install/includes/core/core_class.php @@ -26,7 +26,7 @@ class Core $counter++; } - if ($data['directory'] != "") { + if ($data['directory'] ?? '' != "") { if (file_exists($_SERVER['DOCUMENT_ROOT'] . '/' . $data['directory'])) { //pass folders real $counter++; @@ -151,14 +151,17 @@ class Core function write_configfile($data) { $template_path = 'config/config.php'; - $output_path = $_SERVER['DOCUMENT_ROOT'] . '/' . $data['directory'] . '/application/config/config.php'; + $output_path = '../application/config/config.php'; if (isset($_ENV['CI_ENV'])) { - $output_path = $_SERVER['DOCUMENT_ROOT'] . '/' . $data['directory'] . '/application/config/'.$_ENV['CI_ENV'].'/config.php'; + $output_path = '../application/config/'.$_ENV['CI_ENV'].'/config.php'; } // Open the file $database_file = file_get_contents($template_path); + // creating a unique encryption key + $encryptionkey = uniqid(bin2hex(random_bytes(8)), false); + $new = str_replace("%baselocator%", $data['locator'], $database_file); $new = str_replace("%websiteurl%", $data['websiteurl'], $new); $new = str_replace("%directory%", $data['directory'], $new); @@ -174,13 +177,12 @@ class Core $new = str_replace("%hamqth_username%", $data['callbook_username'], $new); $new = str_replace("%hamqth_password%", $data['callbook_password'], $new); } + $new = str_replace("%encryptionkey%", $encryptionkey, $new); + $new = str_replace("'%log_threshold%'", $data['log_threshold'], $new); // Write the new config.php file $handle = fopen($output_path, 'w+'); - // Chmod the file, in case the user forgot - @chmod($output_path, 0777); - // Verify file permissions if (is_writable($output_path)) { diff --git a/install/includes/database_class.php b/install/includes/core/database_class.php similarity index 79% rename from install/includes/database_class.php rename to install/includes/core/database_class.php index 35aa27ad2..7334de9d1 100644 --- a/install/includes/database_class.php +++ b/install/includes/core/database_class.php @@ -1,30 +1,9 @@ query("CREATE DATABASE IF NOT EXISTS " . $data['db_name']); - - // Close the connection - $mysqli->close(); - - return true; - } +class Database { // Function to create the tables and fill them with the default data - function create_tables($data) - { + function create_tables($data) { // Connect to the database $mysqli = new mysqli($data['db_hostname'], $data['db_username'], $data['db_password'], $data['db_name']); @@ -67,8 +46,7 @@ class Database return true; } - function database_check($data) - { + function database_check($data) { try { $timeout = 5; /* five seconds for timeout */ $link = mysqli_init(); diff --git a/install/includes/gettext/gettext.php b/install/includes/gettext/gettext.php index 9e174a528..b3aee208d 100644 --- a/install/includes/gettext/gettext.php +++ b/install/includes/gettext/gettext.php @@ -76,10 +76,9 @@ function _get_client_language() { global $default_lang; if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { $code = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); - $lang = find_by('code', $code) ?: $default_lang; + $lang = find_by('code', $code) ?? find_by('folder', $default_lang); } else { - $code = 'en'; - $lang = find_by('code', $code); + $lang = find_by('folder', $default_lang); } return $lang; } diff --git a/install/includes/gettext/gettext_conf.php b/install/includes/gettext/gettext_conf.php index 88e5302bd..84a90b01b 100644 --- a/install/includes/gettext/gettext_conf.php +++ b/install/includes/gettext/gettext_conf.php @@ -8,8 +8,6 @@ * */ - - $gt_conf['default_domain'] = 'installer'; $gt_conf['default_lang'] = 'english'; diff --git a/install/includes/install_config/install_config.php b/install/includes/install_config/install_config.php new file mode 100644 index 000000000..83d8d24e5 --- /dev/null +++ b/install/includes/install_config/install_config.php @@ -0,0 +1,35 @@ + ['condition' => isExtensionInstalled('curl')], + 'php-mysql' => ['condition' => isExtensionInstalled('mysqli')], + 'php-mbstring' => ['condition' => isExtensionInstalled('mbstring')], + 'php-xml' => ['condition' => isExtensionInstalled('xml')], + 'php-zip' => ['condition' => isExtensionInstalled('zip')], +]; + +// MariaDB / MySQL +$mariadb_version = 10.1; +$mysql_version = 5.7; diff --git a/install/includes/install_config/install_lib.php b/install/includes/install_config/install_lib.php new file mode 100644 index 000000000..b514a5e64 --- /dev/null +++ b/install/includes/install_config/install_lib.php @@ -0,0 +1,56 @@ +isDir() && basename($item->getPathName()) != '..') { + if (!is_writable($item->getRealPath())) { + return false; + } + } + } + + return true; + } + } catch (Exception $e) { + return false; + } + + return false; +} diff --git a/install/includes/interface_assets/footer.php b/install/includes/interface_assets/footer.php new file mode 100644 index 000000000..c4c8ba117 --- /dev/null +++ b/install/includes/interface_assets/footer.php @@ -0,0 +1,59 @@ + \ No newline at end of file diff --git a/install/includes/interface_assets/header.php b/install/includes/interface_assets/header.php new file mode 100644 index 000000000..fb324102f --- /dev/null +++ b/install/includes/interface_assets/header.php @@ -0,0 +1,69 @@ + + + + +
+ + +