diff --git a/pandora_console/include/styles/install.css b/pandora_console/include/styles/install.css index ed57e15805..62a23b63fc 100644 --- a/pandora_console/include/styles/install.css +++ b/pandora_console/include/styles/install.css @@ -31,7 +31,9 @@ font-display: swap; } html { - background-color: #959595; + background-image: url("../../images/installer-background.jpg"); + background-position: center; + background-size: cover; } #install_container { max-width: 1000px; diff --git a/pandora_console/install.php b/pandora_console/install.php index 982fa0d9b4..25e052e923 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -165,6 +165,15 @@ '; @@ -181,23 +190,15 @@ function check_extension($ext, $label) echo ''; } -function check_include($ext, $label) -{ - echo ''; - echo " $label "; - echo ''; - if (!include $ext) { - echo "incomplete"; - return 1; - } else { - echo "checked"; - return 0; - } - - echo ''; -} - - +/** + * Check if file exist and print a + * new row in the table with the result + * + * @param string $file File. + * @param string $label Label file. + * + * @return integer status + */ function check_exists($file, $label) { echo ''; @@ -215,6 +216,15 @@ function check_exists($file, $label) } +/** + * Check variable ok and return row + * with 'checked' if is 1 or 'incomplete' if is 0 + * + * @param integer $ok Status. + * @param string $label Label to show. + * + * @return integer status + */ function check_generic($ok, $label) { echo ''; @@ -236,6 +246,15 @@ function check_generic($ok, $label) } +/** + * Check if path is writable and print a + * new row in the table with the result. + * + * @param string $fullpath Path folder or file. + * @param string $label Label to show. + * + * @return integer status + */ function check_writable($fullpath, $label) { echo ''; @@ -268,6 +287,17 @@ function check_writable($fullpath, $label) } +/** + * Check if $var is equal to $value and + * print result in a row. + * + * @param string $var Variable. + * @param string $value Value to check. + * @param string $label Label to show. + * @param integer $mode Mode. + * + * @return integer status + */ function check_variable($var, $value, $label, $mode) { echo ''; @@ -321,6 +351,15 @@ function parse_mysql_dump($url) } +/** + * Parse sql to script dump, execute it + * and return if exist error. + * + * @param object $connection Connection sql. + * @param string $url Path file sql script. + * + * @return integer status + */ function parse_mysqli_dump($connection, $url) { if (file_exists($url)) { @@ -389,7 +428,14 @@ function random_name(int $size) } -function print_logo_status($step, $step_total) +/** + * Print the header installation + * + * @param integer $step Number of step. + * + * @return string Html output. + */ +function print_logo_status($step) { global $banner; @@ -419,13 +465,17 @@ function print_logo_status($step, $step_total) } -// -// This function adjusts path settings in pandora db for FreeBSD. -// -// All packages and configuration files except operating system's base files -// are installed under /usr/local in FreeBSD. So, path settings in pandora db -// for some programs should be changed from the Linux default. -// +/** + * This function adjusts path settings in pandora db for FreeBSD. + * All packages and configuration files except operating system's base files + * are installed under /usr/local in FreeBSD. So, path settings in pandora db + * for some programs should be changed from the Linux default. + * + * @param string $engine Type of engine. + * @param object $connection Connection database. + * + * @return integer Status. + */ function adjust_paths_for_freebsd($engine, $connection=false) { $adjust_sql = [ @@ -470,10 +520,13 @@ function adjust_paths_for_freebsd($engine, $connection=false) } +/** + * Print all step 1 + * + * @return void + */ function install_step1() { - global $banner; - echo "
@@ -520,7 +573,7 @@ function install_step1()
-
+
@@ -537,6 +590,11 @@ function install_step1() } +/** + * Print license content + * + * @return void + */ function install_step1_licence() { echo " @@ -547,7 +605,7 @@ function install_step1_licence()

GPL2 Licence terms agreement

Pandora FMS is an OpenSource software project licensed under the GPL2 licence. Pandora FMS includes, as well, another software also licensed under LGPL and BSD licenses. Before continue, you must accept the licence terms..

For more information, please refer to our website at http://pandorafms.org and contact us if you have any kind of question about the usage of Pandora FMS

-

If you dont accept the licence terms, please, close your browser and delete Pandora FMS files.

+

If you dont accept the licence terms, please, close your browser and delete Pandora FMS files.

"; if (!file_exists('COPYING')) { @@ -563,7 +621,7 @@ function install_step1_licence() echo ''; echo " -
+
'; if ($res > 0) { echo "
-
You have some incomplete - dependencies. Please correct them or this installer - will not be able to finish your installation. -
-
- Remember, if you install any PHP module to comply - with these dependences, you need to restart - your HTTP/Apache server after it to use the new - modules. -
+
You have some incomplete + dependencies. Please correct them or this installer + will not be able to finish your installation. +
+
+ Remember, if you install any PHP module to comply + with these dependences, you need to restart + your HTTP/Apache server after it to use the new + modules. +
"; } - echo '
'; - echo "
+ echo ''; + echo "
'; + echo ''; } +/** + * Print all step 3 + * + * @return void + */ function install_step3() { $options = []; @@ -675,24 +743,24 @@ function install_step3()

Environment and database setup

- This wizard will create your Pandora FMS database, - and populate it with all the data needed to run for the first time. + This wizard will create your Pandora FMS database, + and populate it with all the data needed to run for the first time.

- You need a privileged user to create database schema, this is usually root user. - Information about root user will not be used or stored anymore. + You need a privileged user to create database schema, this is usually root user. + Information about root user will not be used or stored anymore.

- You can also deploy the scheme into an existing Database. - In this case you need a privileged Database user and password of that instance. + You can also deploy the scheme into an existing Database. + In this case you need a privileged Database user and password of that instance.

- Now, please, complete all details to configure your database and environment setup. + Now, please, complete all details to configure your database and environment setup.

- This installer will overwrite and destroy your existing - Pandora FMS configuration and Database. Before continue, - please be sure that you have no valuable Pandora FMS data in your Database. + This installer will overwrite and destroy your existing + Pandora FMS configuration and Database. Before continue, + please be sure that you have no valuable Pandora FMS data in your Database.

"; if ($error) { @@ -702,7 +770,7 @@ function install_step3() } if (extension_loaded('oci8')) { - echo "
For Oracle installation an existing Database with a privileged user is needed.
"; + echo "
For Oracle installation an existing Database with a privileged user is needed.
"; } echo '
'; @@ -751,41 +819,49 @@ function install_step3() echo ''; } - echo "

DB User with privileges

- - -

DB Password for this user

+ echo " + +

DB User with privileges

+ + + + +

DB Password for this user

- -

DB Hostname

+ + + + +

DB Hostname

- -

DB Name (pandora by default)

+ + +

DB Name (pandora by default)

- - "; + + "; // the field dbgrant is only shown when the DB host is different from 127.0.0.1 or localhost echo " -

DB Host Access

- - - "; +

DB Host Access

+ + + "; echo " -

Full path to HTTP publication directory

-

For example /var/www/pandora_console/

- +

Full path to HTTP publication directory

+

For example /var/www/pandora_console/

+ + "; echo "

URL path to Pandora FMS Console

For example '/pandora_console'

- + "; @@ -797,7 +873,7 @@ function install_step3()

Drop Database if exists

- "; + "; echo ''; @@ -806,10 +882,11 @@ function install_step3() echo ''; echo ''; echo "
-
- -
-
"; + "; }