Ejemplo n.º 1
0
function install_check()
{
    if (!file_exists(BH_INCLUDE_PATH . "config.inc.php")) {
        header_redirect('./install/index.php');
    }
    install_check_php_version();
    install_check_php_extensions();
    install_check_mysql_version();
    if (@file_exists('./install/index.php') && !defined("BEEHIVE_DEVELOPER_MODE")) {
        install_draw_top();
        echo "  <table cellpadding=\"0\" cellspacing=\"0\" width=\"400\">\n";
        echo "    <tr>\n";
        echo "      <td align=\"left\">\n";
        echo "        <table class=\"box\">\n";
        echo "          <tr>\n";
        echo "            <td align=\"left\" class=\"posthead\">\n";
        echo "              <table class=\"posthead\" width=\"500\">\n";
        echo "                <tr>\n";
        echo "                  <td align=\"left\" colspan=\"2\" class=\"subhead\">Installation Incomplete</td>\n";
        echo "                </tr>\n";
        echo "                <tr>\n";
        echo "                  <td align=\"center\">\n";
        echo "                    <table class=\"posthead\" width=\"95%\">\n";
        echo "                      <tr>\n";
        echo "                        <td align=\"left\">Your Beehive Forum would appear to be already installed, but you have not removed the installation files. You must delete the 'install' directory before your Beehive Forum can be used.</td>\n";
        echo "                      </tr>\n";
        echo "                    </table>\n";
        echo "                  </td>\n";
        echo "                </tr>\n";
        echo "                <tr>\n";
        echo "                  <td align=\"left\">&nbsp;</td>\n";
        echo "                </tr>\n";
        echo "              </table>\n";
        echo "            </td>\n";
        echo "          </tr>\n";
        echo "        </table>\n";
        echo "      </td>\n";
        echo "    </tr>\n";
        echo "  </table>\n";
        echo "  <form accept-charset=\"utf-8\" method=\"get\" action=\"index.php\">\n";
        echo "    <table cellpadding=\"0\" cellspacing=\"0\" width=\"500\">\n";
        echo "      <tr>\n";
        echo "        <td align=\"left\" width=\"500\">&nbsp;</td>\n";
        echo "      </tr>\n";
        echo "      <tr>\n";
        echo "        <td align=\"center\"><input type=\"submit\" name=\"submit\" value=\"Retry\" class=\"button\" /></td>\n";
        echo "      </tr>\n";
        echo "    </table>\n";
        echo "  </form>\n";
        install_draw_bottom();
        exit;
    }
}
Ejemplo n.º 2
0
function check_install()
{
    // Check the config file exists.
    if (!file_exists(BH_INCLUDE_PATH . "config.inc.php")) {
        header_redirect('./install/index.php');
    }
    // Check the PHP version
    install_check_php_version();
    // Check the PHP extensions
    install_check_php_extensions();
    // Check the MySQL version
    install_check_mysql_version();
    // Check if the installer files still exist. Ignore them
    // if the BEEHIVE_DEVELOPER_MODE constant has been defined.
    if (@file_exists('./install/index.php') && !defined("BEEHIVE_DEVELOPER_MODE")) {
        echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
        echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
        echo "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\" dir=\"ltr\">\n";
        echo "<head>\n";
        echo "<title>Beehive Forum ", BEEHIVE_VERSION, " - Installation</title>\n";
        echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n";
        echo html_include_css(html_get_forum_file_path('styles/default/style.css')), "\n";
        echo "</head>\n";
        echo "<body>\n";
        echo "<h1>Beehive Forum Installation Error</h1>\n";
        echo "<br />\n";
        echo "<div align=\"center\">\n";
        echo "  <table cellpadding=\"0\" cellspacing=\"0\" width=\"400\">\n";
        echo "    <tr>\n";
        echo "      <td align=\"left\">\n";
        echo "        <table class=\"box\">\n";
        echo "          <tr>\n";
        echo "            <td align=\"left\" class=\"posthead\">\n";
        echo "              <table class=\"posthead\" width=\"500\">\n";
        echo "                <tr>\n";
        echo "                  <td align=\"left\" colspan=\"2\" class=\"subhead\">Installation Incomplete</td>\n";
        echo "                </tr>\n";
        echo "                <tr>\n";
        echo "                  <td align=\"center\">\n";
        echo "                    <table class=\"posthead\" width=\"95%\">\n";
        echo "                      <tr>\n";
        echo "                        <td align=\"left\">Your Beehive Forum would appear to be already installed, but you have not removed the installation files. You must delete the 'install' directory before your Beehive Forum can be used.</td>\n";
        echo "                      </tr>\n";
        echo "                    </table>\n";
        echo "                  </td>\n";
        echo "                </tr>\n";
        echo "                <tr>\n";
        echo "                  <td align=\"left\">&nbsp;</td>\n";
        echo "                </tr>\n";
        echo "              </table>\n";
        echo "            </td>\n";
        echo "          </tr>\n";
        echo "        </table>\n";
        echo "      </td>\n";
        echo "    </tr>\n";
        echo "  </table>\n";
        echo "  <form accept-charset=\"utf-8\" method=\"get\" action=\"index.php\">\n";
        echo "    <table cellpadding=\"0\" cellspacing=\"0\" width=\"500\">\n";
        echo "      <tr>\n";
        echo "        <td align=\"left\" width=\"500\">&nbsp;</td>\n";
        echo "      </tr>\n";
        echo "      <tr>\n";
        echo "        <td align=\"center\"><input type=\"submit\" name=\"submit\" value=\"Retry\" class=\"button\" /></td>\n";
        echo "      </tr>\n";
        echo "    </table>\n";
        echo "  </form>\n";
        echo "</div>\n";
        echo "</body>\n";
        echo "</html>\n";
        exit;
    }
}
Ejemplo n.º 3
0
 if ($valid) {
     if ($install_method == 0 && $admin_password != $admin_cpassword) {
         $error_array[] = "Administrator account passwords do not match.\n";
         $valid = false;
     }
     if ($config['db_password'] != $config['db_cpassword']) {
         $error_array[] = "MySQL database passwords do not match.\n";
         $valid = false;
     }
 }
 if ($valid) {
     $sql = '';
     try {
         db::set_config($config);
         $db = db::get();
         install_check_mysql_version();
         try {
             if ($install_method == 3 && @file_exists('upgrade.php')) {
                 include_once "upgrade.php";
             } else {
                 if (@file_exists('new-install.php')) {
                     $remove_conflicts = $install_method == 1;
                     include_once "new-install.php";
                 }
             }
             $config_file = '';
             if (($config_file = @file_get_contents('config.inc.php')) !== false) {
                 $config_file = str_replace('{db_server}', $config['db_server'], $config_file);
                 $config_file = str_replace('{db_port}', $config['db_port'], $config_file);
                 $config_file = str_replace('{db_username}', $config['db_username'], $config_file);
                 $config_file = str_replace('{db_password}', $config['db_password'], $config_file);