Example #1
0
         if ($Database_Exist != TRUE) {
             $wrm_install =& new sql_db($wrm_db_server_hostname, $wrm_db_username, $wrm_db_password, "");
             $sql = "CREATE DATABASE " . $wrm_db_name;
             $wrm_install->sql_query($sql) or print_error($sql, mysql_error(), 1);
         } else {
             $wrm_install->sql_close();
             header("Location: " . $filename_install . "step=3&db_exist=1");
         }
     }
     if (!$wrm_install->db_connect_id) {
         $FOUNDERROR_Database = TRUE;
     }
     $wrm_install->sql_close();
     //no error then write the config file "../config.php"
     if ($FOUNDERROR_Database == FALSE) {
         $wrm_config_writeable = write_wrm_configfile($wrm_db_name, $wrm_db_server_hostname, $wrm_db_username, $wrm_db_password, $wrm_db_tableprefix);
         //writeable
         if ($wrm_config_writeable == TRUE) {
             //go to next step
             header("Location: " . $filename_install . "step=" . ($step + 1));
         } else {
             header("Location: " . $filename_install . "step=1");
         }
     }
     if ($FOUNDERROR_Database == TRUE) {
         header("Location: " . $filename_install . "step=3&error_db=1");
     }
 } else {
     if ($step == 5) {
         include_once $wrm_config_file;
         include_once "install_settings.php";
Example #2
0
    header("Location: " . $filename_upgrade . "step=3");
}
/*
 * dynamic changes at wrm
 */
if ($step == 3) {
    //$wrm_install = &new sql_db($phpraid_config['db_host'], $phpraid_config['db_user'], $phpraid_config['db_pass'], $phpraid_config['db_name']);
    $sql = sprintf("SELECT * " . " FROM " . $phpraid_config['db_name'] . "." . $phpraid_config['db_prefix'] . "config" . " WHERE  `%s` = %s", "config_name", quote_smart("wrm_created_on"));
    $wrm_install->sql_query($sql) or print_error($sql, mysql_error(), 1);
    $data = $wrm_install->sql_fetchrow($result, true);
    if ($wrm_install->sql_numrows() == 0) {
        $sql = sprintf("INSERT INTO " . $phpraid_config['db_prefix'] . "config" . " VALUES(%s,%s)", quote_smart("wrm_created_on"), quote_smart(time()));
        $wrm_install->sql_query($sql) or print_error($sql, mysql_error(), 1);
        $sql = sprintf("INSERT INTO " . $phpraid_config['db_prefix'] . "config" . " VALUES(%s,%s)", quote_smart("wrm_updated_on"), quote_smart(time()));
        $wrm_install->sql_query($sql) or print_error($sql, mysql_error(), 1);
    } else {
        $sql = sprintf("UPDATE " . $phpraid_config['db_name'] . "." . $phpraid_config['db_prefix'] . "config" . " SET `config_value` = %s WHERE %s = `config_name`", quote_smart(time()), quote_smart("wrm_updated_on"));
        $wrm_install->sql_query($sql) or print_error($sql, mysql_error(), 1);
    }
    //close wrm con.
    $wrm_install->sql_close();
    header("Location: " . $filename_upgrade . "step=update_done");
}
//show page
if ($step == "update_done") {
    write_wrm_configfile($phpraid_config['db_name'], $phpraid_config['db_host'], $phpraid_config['db_user'], $phpraid_config['db_pass'], $phpraid_config['db_prefix'], $phpraid_config['db_type'], $phpraid_config['eqdkp_db_name'], $phpraid_config['eqdkp_db_host'], $phpraid_config['eqdkp_db_user'], $phpraid_config['eqdkp_db_pass'], $phpraid_config['eqdkp_db_prefix']);
    include_once "includes/page_header.php";
    $smarty->assign(array("form_action" => "install.php?lang=" . $lang . "&step=done", "upgrade_headtitle" => $wrm_install_lang['upgrade_headtitle'], "wrm_versions_nr_current_value" => $wrm_versions_nr_current_value, "wrm_versions_nr_current_text" => $wrm_install_lang['wrm_versions_nr_current_text'], "wrm_versions_nr_from_install_value" => $versions_nr_install, "wrm_versions_nr_from_install_text" => $wrm_install_lang['wrm_versions_nr_from_install_text'], "bd_start" => $wrm_install_lang['bd_submit']));
    $smarty->display("update.tpl.html");
    include_once "includes/page_footer.php";
}