Exemplo n.º 1
0
/**
 * This function creates the DB on new installs
 */
function make_db($dbhost, $dbuname, $dbpass, $dbname, $prefix_table, $dbtype, $dbmake)
{
    global $db;
    echo '<font class="oos-title">' . INPUT_DATA . '</font>';
    echo '<table align="center"><tr><td align="left">';
    if ($dbmake) {
        $db =& NewADOConnection($dbtype);
        $dbh = $db->Connect($dbhost, $dbuname, $dbpass);
        if (!$dbh) {
            $dbpass = "";
            die("{$dbtype}://{$dbuname}:{$dbpass}@{$dbhost} failed to connect" . $db->ErrorMsg());
        }
        $dict = NewDataDictionary($db);
        if (!$dict) {
            continue;
        }
        $dict->debug = 1;
        // ToDo CREATE DATABASE $dbname DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
        $sqlarray = $dict->CreateDatabase($dbname);
        $dict->ExecuteSQLArray($sqlarray);
    }
    oosDBInit($dbhost, $dbuname, $dbpass, $dbname, $dbtype);
    if (!$prefix_table == '') {
        $prefix_table = $prefix_table . '_';
    }
    include 'newtables.php';
    echo '</td></tr></table>';
}
Exemplo n.º 2
0
require 'includes/functions/function_validations.php';
require 'includes/classes/class_member.php';
require 'includes/classes/class_products_history.php';
require 'includes/classes/class_shopping_cart.php';
require 'includes/classes/class_navigation_history.php';
require 'includes/functions/function_session.php';
// require  the database functions
$adodb_logsqltable = $oostable['adodb_logsql'];
if (!defined('ADODB_LOGSQL_TABLE')) {
    define('ADODB_LOGSQL_TABLE', $adodb_logsqltable);
}
require 'includes/lib/adodb/adodb-errorhandler.inc.php';
require 'includes/lib/adodb/adodb.inc.php';
require 'includes/functions/function_db.php';
// make a connection to the database... now
if (!oosDBInit()) {
    die('Unable to connect to database server!');
}
$dbconn =& oosDBGetConn();
oosDB_importTables($oostable);
// set the application parameters
$configurationtable = $oostable['configuration'];
$configuration_query = "SELECT configuration_key AS cfg_key, configuration_value AS cfg_value FROM {$configurationtable}";
if (USE_DB_CACHE == '1') {
    $configuration_result = $dbconn->CacheExecute(3600, $configuration_query);
} else {
    $configuration_result = $dbconn->Execute($configuration_query);
}
while ($configuration = $configuration_result->fields) {
    define($configuration['cfg_key'], $configuration['cfg_value']);
    // Move that ADOdb pointer!
Exemplo n.º 3
0
  installer_get_language();

  include_once 'header.php';

/*  This starts the switch statement that filters through the form options.
 *  the @ is in front of $op to suppress error messages if $op is unset and E_ALL
 *  is on
 */
 switch (@$op) {

    case "Finish":
      print_oosFinish();
      break;

    case 'Set Login':
      oosDBInit($dbhost, $dbuname, $dbpass, $dbname, $dbtype);
      oosInputData($gender, $firstname, $name, $pwd, $repeatpwd, $email, $phone, $fax, $prefix_table, $update);
      oosUpdateConfigShop(true); // Scott - added

      print_SetLogin();
      break;

    case 'Change Login':
      print_ChangeLogin();
      break;

    case 'Login':
      if ( ($pwd == '') || ($email == '') || ($pwd != $repeatpwd) ) {
        print_ChangeLogin();
      } else {
        print_Login();