$file_content = str_replace('#store_name#', $_POST[$store_name_text], $file_content);
     //file_put_contents ($file_name0.PHP, $file_content);
     store_config($file_name0 . PHP, $file_contents);
     $dir = DIR_FS_CATALOG . $livehelp;
     $file_name0 = $dir . "config";
     $file_name = $file_name0 . $default_php;
     if (file_exists($file_name)) {
         $file_content = file_get_contents($file_name);
         $file_content = str_replace('DB-SERVER', DB_SERVER, $file_content);
         $file_content = str_replace('DB-USERNAME', DB_SERVER_USERNAME, $file_content);
         $file_content = str_replace('DB-PASSWORD', DB_SERVER_PASSWORD, $file_content);
         $file_content = str_replace('DB-DATABASE', DB_DATABASE, $file_content);
         $file_content = str_replace('ROOTPATH', $dir, $file_content);
         $file_name = $file_name0 . PHP;
         //file_put_contents ($file_name, $file_content);
         store_config($file_name, $file_content);
     }
 }
 //Make sure record does not already exist
 $sql_where = SQL_WHERE . "customers_id = '1'";
 $sql_from = SQL_FROM . TABLE_CUSTOMERS . $sql_where;
 $result = xtc_db_query(SELECT_COUNT . $sql_from);
 $repeat_installation = xtc_db_num_rows($result) > 0;
 if ($repeat_installation) {
     $result = xtc_db_query("delete" . $sql_from);
     $result = xtc_db_query(DELETE_FROM . TABLE_CUSTOMERS_INFO . " where customers_info_id = '1'");
     $result = xtc_db_query(DELETE_FROM . TABLE_ADDRESS_BOOK . $sql_where);
 }
 $sep = "', '";
 xtc_db_query(INSERT_INTO . TABLE_CUSTOMERS . " (\n\t\t\tcustomers_id,\n\t\t\tcustomers_status,\n\t\t\tcustomers_firstname,\n\t\t\tcustomers_lastname,\n\t\t\tcustomers_email_address,\n\t\t\tcustomers_default_address_id,\n\t\t\tcustomers_telephone,\n\t\t\tcustomers_password,\n\t\t\tdelete_user) VALUES\n\t\t\t(\n\t\t\t'1',\n\t\t\t'0','" . $first_name . $sep . $last_name . $sep . $email_adress . "','1','" . $telephone . $sep . xtc_encrypt_password($password) . "','0')");
 xtc_db_query(INSERT_INTO . TABLE_CUSTOMERS_INFO . " (\n\t\t\tcustomers_info_id,\n\t\t\tcustomers_info_date_of_last_logon,\n\t\t\tcustomers_info_number_of_logons,\n\t\t\tcustomers_info_date_account_created,\n\t\t\tcustomers_info_date_account_last_modified,\n\t\t\tglobal_product_notifications) VALUES\n\t\t\t('1','','','','','')");
Esempio n. 2
0
// upload of configuration
if (Request::option('com') == "do_upload_config") {
    $file_content = file_get_contents($_FILES['the_file']['tmp_name']);

    // revert the changes done by indentJson
    $file_content_wo_tabs = str_replace("\t", '', str_replace("\n", '', $file_content));

    $jsonconfig = json_decode($file_content_wo_tabs, true);

    // utf8-decode the values after json_decode has worked on it
    array_walk_recursive($jsonconfig, 'utf8Decode');

    if (!check_config($jsonconfig, Request::quoted('check_module'))) {
        $msg ="error§". _("Die Konfigurationsdatei hat den falschen Modultyp!"). "§";
    } else if (!store_config($range_id, $config_id, $jsonconfig)) {
        $msg ="error§". _("Die Konfigurationsdatei konnte nicht hochgeladen werden!"). "§";
    } else {
        $msg = "info§". _("Die Datei wurde erfolgreich übertragen!"). "§";
    }
}

//Output starts here

ob_start();

require_once 'lib/msg.inc.php'; //Funktionen für Nachrichtenmeldungen

echo "<table border=\"0\" class=\"blank\" align=\"center\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\n";
echo "<tr><td class=\"blank\" colspan=\"2\">&nbsp;</td></tr>\n";
if (Request::option('com') != "info") {