[ Index ]

PHP Cross Reference of osCMax 2.0.4

title

Body

[close]

/install/templates/pages/ -> install_4.php (source)

   1  <?php
   2  /*

   3  $Id: install_4.php 3 2006-05-27 04:59:07Z user $

   4  

   5    osCMax Power E-Commerce

   6    http://oscdox.com

   7  

   8    Copyright 2009 osCMax

   9  

  10    Released under the GNU General Public License

  11  */
  12  
  13    require ('../includes/database_tables.php');
  14  
  15    osc_db_connect(trim($HTTP_POST_VARS['DB_SERVER']), trim($HTTP_POST_VARS['DB_SERVER_USERNAME']), trim($HTTP_POST_VARS['DB_SERVER_PASSWORD']));
  16    osc_db_select_db(trim($HTTP_POST_VARS['DB_DATABASE']));
  17  
  18    osc_db_query('update ' . TABLE_CONFIGURATION . ' set configuration_value = "' . trim($HTTP_POST_VARS['CFG_STORE_NAME']) . '" where configuration_key = "STORE_NAME"');
  19    osc_db_query('update ' . TABLE_CONFIGURATION . ' set configuration_value = "' . trim($HTTP_POST_VARS['CFG_STORE_OWNER_FIRSTNAME']) . ' ' .  trim($HTTP_POST_VARS['CFG_STORE_OWNER_LASTNAME']) . '" where configuration_key = "STORE_OWNER"');
  20    osc_db_query('update ' . TABLE_CONFIGURATION . ' set configuration_value = "' . trim($HTTP_POST_VARS['CFG_STORE_OWNER_EMAIL_ADDRESS']) . '" where configuration_key = "STORE_OWNER_EMAIL_ADDRESS"');
  21  
  22    if (!empty($HTTP_POST_VARS['CFG_STORE_OWNER_NAME']) && !empty($HTTP_POST_VARS['CFG_STORE_OWNER_EMAIL_ADDRESS'])) {
  23      osc_db_query('update ' . TABLE_CONFIGURATION . ' set configuration_value = "\"' . trim($HTTP_POST_VARS['CFG_STORE_OWNER_NAME']) . '\" <' . trim($HTTP_POST_VARS['CFG_STORE_OWNER_EMAIL_ADDRESS']) . '>" where configuration_key = "EMAIL_FROM"');
  24    }
  25  
  26    $check_query = osc_db_query('select admin_username from ' . TABLE_ADMINISTRATORS . ' where admin_username = "' . trim($HTTP_POST_VARS['CFG_ADMINISTRATOR_USERNAME']) . '"');
  27  
  28    if (osc_db_num_rows($check_query)) {
  29      osc_db_query('update ' . TABLE_ADMINISTRATORS . ' set admin_password = "' . osc_encrypt_string(trim($HTTP_POST_VARS['CFG_ADMINISTRATOR_PASSWORD'])) . '" where admin_username = "' . trim($HTTP_POST_VARS['CFG_ADMINISTRATOR_USERNAME']) . '"');
  30    } else {
  31      osc_db_query('insert into ' . TABLE_ADMINISTRATORS . ' (admin_groups_id, admin_username, admin_firstname, admin_lastname, admin_email_address, admin_password, admin_created) values (1, "' . trim($HTTP_POST_VARS['CFG_ADMINISTRATOR_USERNAME']) . '", "' . trim($HTTP_POST_VARS['CFG_STORE_OWNER_FIRSTNAME']) . '", "' . trim($HTTP_POST_VARS['CFG_STORE_OWNER_LASTNAME']) . '", "' . trim($HTTP_POST_VARS['CFG_STORE_OWNER_EMAIL_ADDRESS']) . '", "' . osc_encrypt_string(trim($HTTP_POST_VARS['CFG_ADMINISTRATOR_PASSWORD'])) . '", now())');
  32    }
  33  ?>
  34  
  35  <div class="mainBlock">
  36    <div class="stepsBox">
  37      <ol>
  38        <li>Database Server</li>
  39        <li>Web Server</li>
  40        <li>Online Store Settings</li>
  41        <li style="font-weight: bold;">Finished!</li>
  42      </ol>
  43    </div>
  44  
  45    <h1>New Installation</h1>
  46  
  47    <p>This web-based installation routine will correctly setup and configure osCMax Power E-Commerce to run on this server.</p>
  48    <p>Please follow the on-screen instructions that will take you through the database server, web server, and store configuration options. If help is needed at any stage, please consult the documentation or seek help at the community support forums.</p>
  49  </div>
  50  
  51  <div class="contentBlock">
  52    <div class="infoPane">
  53      <h3>Step 4: Finished!</h3>
  54  
  55      <div class="infoPaneContents">
  56        <p>Congratulations on installing and configuring osCMax Power E-Commerce as your online store solution!</p>
  57        <p>We wish you all the best with the success of your online store and welcome you to join and participate in our community.</p>
  58        <p align="right">- The osCMax Team</p>
  59      </div>
  60    </div>
  61  
  62    <div class="contentPane">
  63      <h2>Finished!</h2>
  64  
  65  <?php
  66    $dir_fs_document_root = $HTTP_POST_VARS['DIR_FS_DOCUMENT_ROOT'];
  67    if ((substr($dir_fs_document_root, -1) != '\\') && (substr($dir_fs_document_root, -1) != '/')) {
  68      if (strrpos($dir_fs_document_root, '\\') !== false) {
  69        $dir_fs_document_root .= '\\';
  70      } else {
  71        $dir_fs_document_root .= '/';
  72      }
  73    }
  74  
  75    $http_url = parse_url($HTTP_POST_VARS['HTTP_WWW_ADDRESS']);
  76    $http_server = $http_url['scheme'] . '://' . $http_url['host'];
  77    $http_catalog = $http_url['path'];
  78    if (isset($http_url['port']) && !empty($http_url['port'])) {
  79      $http_server .= ':' . $http_url['port'];
  80    }
  81  
  82    if (substr($http_catalog, -1) != '/') {
  83      $http_catalog .= '/';
  84    }
  85  
  86    $file_contents = '<?php' . "\n" .
  87                     '/*' . "\n" .

  88                     '  osCMax v2.0, Open Source E-Commerce Solutions' . "\n" .

  89                     '  http://www.osCDox.com' . "\n" .

  90                     '' . "\n" .

  91                     '  Copyright 2006 osCMax2005 osCMax' . "\n" .

  92                     '' . "\n" .

  93                     '  Released under the GNU General Public License' . "\n" .

  94                     '*/' . "\n" .
  95                     '' . "\n" .
  96                     '// Define the webserver and path parameters' . "\n" .
  97                     '// * DIR_FS_* = Filesystem directories (local/physical)' . "\n" .
  98                     '// * DIR_WS_* = Webserver directories (virtual/URL)' . "\n" .
  99                     '  define(\'HTTP_SERVER\', \'' . $http_server . '\');' . "\n" .
 100                     '  define(\'HTTPS_SERVER\', \'' . $http_server . '\');' . "\n" .
 101                     '  define(\'ENABLE_SSL\', false);' . "\n" .
 102                     '  define(\'HTTP_COOKIE_DOMAIN\', \'' . $http_url['host'] . '\');' . "\n" .
 103                     '  define(\'HTTPS_COOKIE_DOMAIN\', \'' . $http_url['host'] . '\');' . "\n" .
 104                     '  define(\'HTTP_COOKIE_PATH\', \'' . $http_catalog . '\');' . "\n" .
 105                     '  define(\'HTTPS_COOKIE_PATH\', \'' . $http_catalog . '\');' . "\n" .
 106                     '  define(\'DIR_WS_HTTP_CATALOG\', \'' . $http_catalog . '\');' . "\n" .
 107                     '  define(\'DIR_WS_HTTPS_CATALOG\', \'' . $http_catalog . '\');' . "\n" .
 108                     '  define(\'DIR_WS_IMAGES\', \'images/\');' . "\n" .
 109                     '  define(\'DIR_WS_ICONS\', DIR_WS_IMAGES . \'icons/\');' . "\n" .
 110                     '  define(\'DIR_WS_INCLUDES\', \'includes/\');' . "\n" .
 111                     '  define(\'DIR_WS_BOXES\', DIR_WS_INCLUDES . \'boxes/\');' . "\n" .
 112                     '  define(\'DIR_WS_FUNCTIONS\', DIR_WS_INCLUDES . \'functions/\');' . "\n" .
 113                     '  define(\'DIR_WS_CLASSES\', DIR_WS_INCLUDES . \'classes/\');' . "\n" .
 114                     '  define(\'DIR_WS_MODULES\', DIR_WS_INCLUDES . \'modules/\');' . "\n" .
 115                     '  define(\'DIR_WS_LANGUAGES\', DIR_WS_INCLUDES . \'languages/\');' . "\n\n" .
 116                     '' . "\n" .
 117                     '  define(\'DIR_WS_DOWNLOAD_PUBLIC\', \'pub/\');' . "\n" .
 118                     '  define(\'DIR_FS_CATALOG\', \'' . $dir_fs_document_root . '\');' . "\n" .
 119                     '  define(\'DIR_FS_DOWNLOAD\', DIR_FS_CATALOG . \'download/\');' . "\n" .
 120                     '  define(\'DIR_FS_DOWNLOAD_PUBLIC\', DIR_FS_CATALOG . \'pub/\');' . "\n\n" .
 121                     '' . "\n" .
 122                     '// define our database connection' . "\n" .
 123                     '  define(\'DB_SERVER\', \'' . trim($HTTP_POST_VARS['DB_SERVER']) . '\');' . "\n" .
 124                     '  define(\'DB_SERVER_USERNAME\', \'' . trim($HTTP_POST_VARS['DB_SERVER_USERNAME']) . '\');' . "\n" .
 125                     '  define(\'DB_SERVER_PASSWORD\', \'' . trim($HTTP_POST_VARS['DB_SERVER_PASSWORD']) . '\');' . "\n" .
 126                     '  define(\'DB_DATABASE\', \'' . trim($HTTP_POST_VARS['DB_DATABASE']) . '\');' . "\n" .
 127                     '  define(\'USE_PCONNECT\', \'false\');' . "\n" .
 128                     '  define(\'STORE_SESSIONS\', \'mysql\');' . "\n" .
 129                     '?>';
 130  
 131    $fp = fopen($dir_fs_document_root . 'includes/configure.php', 'w');
 132    fputs($fp, $file_contents);
 133    fclose($fp);
 134  
 135    $file_contents = '<?php' . "\n" .
 136                     '/*' . "\n" .

 137                     '  osCMax v2.0, Open Source E-Commerce Solutions' . "\n" .

 138                     '  http://www.osCDox.com' . "\n" .

 139                     '' . "\n" .

 140                     '  Copyright 2008 osCMax, 2008 osCommerce' . "\n" .

 141                     '' . "\n" .

 142                     '  Released under the GNU General Public License' . "\n" .

 143                     '*/' . "\n" .
 144                     '' . "\n" .
 145                     '// Define the webserver and path parameters' . "\n" .
 146                     '// * DIR_FS_* = Filesystem directories (local/physical)' . "\n" .
 147                     '// * DIR_WS_* = Webserver directories (virtual/URL)' . "\n" .
 148                     '  define(\'HTTP_SERVER\', \'' . $http_server . '\');' . "\n" .
 149                     '  define(\'HTTP_CATALOG_SERVER\', \'' . $http_server . '\');' . "\n" .
 150                     '  define(\'HTTPS_CATALOG_SERVER\', \'' . $http_server . '\');' . "\n" .
 151                     '  define(\'ENABLE_SSL_CATALOG\', \'false\');' . "\n" .
 152                     '  define(\'DIR_FS_DOCUMENT_ROOT\', \'' . $dir_fs_document_root . '\');' . "\n" .
 153                     '  define(\'DIR_WS_ADMIN\', \'' . $http_catalog . 'admin/\');' . "\n" .
 154                     '  define(\'DIR_FS_ADMIN\', \'' . $dir_fs_document_root . 'admin/\');' . "\n" .
 155                     '  define(\'DIR_WS_CATALOG\', \'' . $http_catalog . '\');' . "\n" .
 156                     '  define(\'DIR_FS_CATALOG\', \'' . $dir_fs_document_root . '\');' . "\n" .
 157                     '  define(\'DIR_WS_IMAGES\', \'images/\');' . "\n" .
 158                     '  define(\'DIR_WS_ICONS\', DIR_WS_IMAGES . \'icons/\');' . "\n" .
 159                     '  define(\'DIR_WS_CATALOG_IMAGES\', DIR_WS_CATALOG . \'images/\');' . "\n" .
 160                     '  define(\'DIR_WS_INCLUDES\', \'includes/\');' . "\n" .
 161                     '  define(\'DIR_WS_BOXES\', DIR_WS_INCLUDES . \'boxes/\');' . "\n" .
 162                     '  define(\'DIR_WS_FUNCTIONS\', DIR_WS_INCLUDES . \'functions/\');' . "\n" .
 163                     '  define(\'DIR_WS_CLASSES\', DIR_WS_INCLUDES . \'classes/\');' . "\n" .
 164                     '  define(\'DIR_WS_MODULES\', DIR_WS_INCLUDES . \'modules/\');' . "\n" .
 165                     '  define(\'DIR_WS_LANGUAGES\', DIR_WS_INCLUDES . \'languages/\');' . "\n" .
 166                     '  define(\'DIR_WS_CATALOG_LANGUAGES\', DIR_WS_CATALOG . \'includes/languages/\');' . "\n" .
 167                     '  define(\'DIR_FS_CATALOG_LANGUAGES\', DIR_FS_CATALOG . \'includes/languages/\');' . "\n" .
 168                     '  define(\'DIR_FS_CATALOG_IMAGES\', DIR_FS_CATALOG . \'images/\');' . "\n" .
 169                     '  define(\'DIR_FS_CATALOG_MODULES\', DIR_FS_CATALOG . \'includes/modules/\');' . "\n" .
 170                     '  define(\'DIR_FS_BACKUP\', DIR_FS_ADMIN . \'backups/\');' . "\n" .
 171                     '  define(\'DIR_FCKEDITOR\', DIR_FS_CATALOG . \'FCKeditor/\');' . "\n" .
 172                     '  define(\'DIR_WS_FCKEDITOR\', DIR_WS_CATALOG . \'FCKeditor/\');' . "\n" .
 173                     '' . "\n" .
 174                     '// define our database connection' . "\n" .
 175                     '  define(\'DB_SERVER\', \'' . trim($HTTP_POST_VARS['DB_SERVER']) . '\');' . "\n" .
 176                     '  define(\'DB_SERVER_USERNAME\', \'' . trim($HTTP_POST_VARS['DB_SERVER_USERNAME']) . '\');' . "\n" .
 177                     '  define(\'DB_SERVER_PASSWORD\', \'' . trim($HTTP_POST_VARS['DB_SERVER_PASSWORD']) . '\');' . "\n" .
 178                     '  define(\'DB_DATABASE\', \'' . trim($HTTP_POST_VARS['DB_DATABASE']) . '\');' . "\n" .
 179                     '  define(\'USE_PCONNECT\', \'false\');' . "\n" .
 180                     '  define(\'STORE_SESSIONS\', \'mysql\');' . "\n" .
 181                     '?>';
 182  
 183    $fp = fopen($dir_fs_document_root . 'admin/includes/configure.php', 'w');
 184    fputs($fp, $file_contents);
 185    fclose($fp);
 186  ?>
 187  
 188      <p>The installation and configuration was successful!</p>
 189  
 190      <br />
 191  
 192      <table border="0" width="99%" cellspacing="0" cellpadding="0">
 193        <tr>
 194          <td align="center" width="50%"><a href="<?php echo $http_server . $http_catalog . 'index.php'; ?>" target="_blank"><img src="images/button_catalog.gif" border="0" alt="Catalog" /></a></td>
 195          <td align="center" width="50%"><a href="<?php echo $http_server . $http_catalog . 'admin/index.php'; ?>" target="_blank"><img src="images/button_administration_tool.gif" border="0" alt="Administration Tool" /></a></td>
 196        </tr>
 197      </table>
 198    </div>
 199  </div>


Generated: Fri Jan 1 13:43:16 2010 Cross-referenced by PHPXref 0.7