/* ===================================================[ DATABASE CONNECTION ]=================================================== */ if ($steps[STEP_DBCONNECT]['enabled']) { // Try to connect to database $login = $keywords['connection']; $dbase->Connect($login); // Clear the plain-text password if encryption is enabled if ($steps[STEP_DBCONNECT]['encryptlogin']) { $login['password'] = ''; } // If connection cannot be made, force show "connection" step! if (!$dbase->IsConnected() || $step == STEP_DBCONNECT) { $page->MainTitle($steps[STEP_DBCONNECT]['title'], 'connection'); // If the step is not STEP_DBCONNECT, then the installer was going // somewhere else - so error message should be displayed if ($step != STEP_DBCONNECT) { $page->WarningBox('Unable to establish a connection to <b>' . $login['hostname'] . '</b>. ' . 'Please fill in <i>hostname</i>, <i>username</i> and <i>password</i>.'); if ($config['show_database_error_messages']) { $page->ErrorDatabaseBox($dbase->GetDatabaseError()); } } else { if ($step == STEP_DBCONNECT && $dbase->IsConnected()) { $page->SuccessBox('Connection to database server is successful with login ' . 'provided. Proceed to the next step'); } } // If the port is optional and the port value contains // non-digits then display warning message if ($steps[STEP_DBCONNECT]['portoptional'] && !$dbase->IsConnected() && strlen($login['dbport']) > 0 && !IsNumericOnly($login['dbport'])) { $page->WarningBox('The port value <b>' . $login['dbport'] . '</b> is not a valid numeric value'); } // If the password is encrypted and connection has been made successfully - then pressing NEXT // in the 'else' clause below would send an empty string and reset the password to nothing. So,
$str = ''; foreach ($counts as $word => $count) { $str .= "\n" . '<br /><tt><b>' . $keywords['open_bracket'] . $word . $keywords['close_bracket'] . '</b></tt> = <b>' . $count . '</b>'; } $page->SuccessBox('The mask file contains the following keywords:' . $str); } else { $page->InfoBox('This mask file does not contain any keywords to replace.'); } // Check if there is SEPARATOR KEYWORD in the sql file $ext = $mask->GetMaskExtension($sett['maskname'], true); if ($ext == 'sql') { $counts = $mask->GetSqlSeparatorCount($maskContent); if ($counts > 0) { $page->SuccessBox('The SQL mask has <b>' . $counts . '</b> occurences of the <i>SQL Query Separator</i>'); } else { $page->WarningBox('There is no occurence of the <i>SQL Query Separator</i>! If your "Installation SQL Script" contains ' . 'more than one query, <b>the installation will fail!</b> <br /> <br />' . 'PHP does not support multiple queries, unless <tt>mysqli</tt> is used. Because we cannot be certain ' . 'that <tt>mysqli</tt> will be installed, the Installer does not support that extension, but rather ' . 'requires that the <tt>' . $keywords['next_query'] . '</tt> separator is placed in between all queries.'); } } } else { $page->WarningBox('The mask file <b>' . $sett['maskname'] . '</b> does not exists, make sure filenames are correct!'); } } } // Create a new array with the configuration overview as first element // and copy the rest of the $steps array into the new array $newSteps = array(STEP_SETTOVERVIEW => array('title' => 'Configuration Overview')); foreach ($steps as $key => $value) { $newSteps[$key] = $value; } // Clear the original steps and update with the modified version $steps = array();
$verStr = '<br /> <br />PHP Version: '.phpversion().'<br />PHP Required: '.implode('.', $bounds['lower']).$maxStr; // If minimum is above maximum! if($MinMax == 1) { $page->ErrorBox('Minimum version requirements are higher than maximum requirements. '. 'This check will always fail due to incorrect configuration! <br /> <br />'. 'This must be corrected: [min '.$steps[$step]['phpversion'].' > '.$steps[$step]['maxversion'].' max]'); } // If current version is equal or higher than lower bound // and is below the upper bound - then accepted! if ($CurLow >= 0 && $CurHig < 0) $page->SuccessBox('Current PHP version is supported!'.$verStr); else if($CurLow < 0) $page->WarningBox('Current PHP version is below minimum requirements!'.$verStr); else if($CurHig > 0) $page->WarningBox('Current PHP version is above maximum requirements!'.$verStr); else if($CurHig == 0) $page->WarningBox('Current PHP version is the same as the maximum requirement, which is not supported!'.$verStr); else $page->WarningBox('Current PHP version not supported!'.$verStr); } /* -----------------------( VERIFY FORM STRUCTURE )----------------------- */ if($step == STEP_ADDEDINFO) { $page->Paragraph(' '); $page->MainTitle('Your custom form', 'userinfo'); // Construct a form based on the setup in $steps