PageRenderTime 40ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/catalog/install/templates/pages/index.php

https://github.com/chrish123/oscommerce2
PHP | 233 lines | 177 code | 46 blank | 10 comment | 38 complexity | 10df8d1007ebd82fdff2561c51dbf116 MD5 | raw file
  1. <?php
  2. /*
  3. $Id$
  4. osCommerce, Open Source E-Commerce Solutions
  5. http://www.oscommerce.com
  6. Copyright (c) 2007 osCommerce
  7. Released under the GNU General Public License
  8. */
  9. $compat_register_globals = true;
  10. if (function_exists('ini_get') && (PHP_VERSION < 4.3) && ((int)ini_get('register_globals') == 0)) {
  11. $compat_register_globals = false;
  12. }
  13. ?>
  14. <div class="mainBlock">
  15. <h1>Welcome to osCommerce Online Merchant v<?php echo osc_get_version(); ?>!</h1>
  16. <p>osCommerce Online Merchant helps you sell products worldwide with your own online store. Its Administration Tool manages products, customers, orders, newsletters, specials, and more to successfully build the success of your online business.</p>
  17. <p>osCommerce has attracted a large community of store owners and developers who support each other and have provided over 6,000 free add-ons that can extend the features and potential of your online store.</p>
  18. </div>
  19. <div class="contentBlock">
  20. <div class="infoPane">
  21. <h3>Server Capabilities</h3>
  22. <div class="infoPaneContents">
  23. <table border="0" width="100%" cellspacing="0" cellpadding="2">
  24. <tr>
  25. <td><strong>PHP Version</strong></td>
  26. <td align="right"><?php echo PHP_VERSION; ?></td>
  27. <td align="right" width="25"><img src="images/<?php echo ((PHP_VERSION >= 4) ? 'tick.gif' : 'cross.gif'); ?>" border="0" width="16" height="16"></td>
  28. </tr>
  29. </table>
  30. <?php
  31. if (function_exists('ini_get')) {
  32. ?>
  33. <br />
  34. <table border="0" width="100%" cellspacing="0" cellpadding="2">
  35. <tr>
  36. <td><strong>PHP Settings</strong></td>
  37. <td align="right"></td>
  38. <td align="right" width="25"></td>
  39. </tr>
  40. <tr>
  41. <td>register_globals</td>
  42. <td align="right"><?php echo (((int)ini_get('register_globals') == 0) ? 'Off' : 'On'); ?></td>
  43. <td align="right"><img src="images/<?php echo (($compat_register_globals == true) ? 'tick.gif' : 'cross.gif'); ?>" border="0" width="16" height="16"></td>
  44. </tr>
  45. <tr>
  46. <td>magic_quotes</td>
  47. <td align="right"><?php echo (((int)ini_get('magic_quotes') == 0) ? 'Off' : 'On'); ?></td>
  48. <td align="right"><img src="images/<?php echo (((int)ini_get('magic_quotes') == 0) ? 'tick.gif' : 'cross.gif'); ?>" border="0" width="16" height="16"></td>
  49. </tr>
  50. <tr>
  51. <td>file_uploads</td>
  52. <td align="right"><?php echo (((int)ini_get('file_uploads') == 0) ? 'Off' : 'On'); ?></td>
  53. <td align="right"><img src="images/<?php echo (((int)ini_get('file_uploads') == 1) ? 'tick.gif' : 'cross.gif'); ?>" border="0" width="16" height="16"></td>
  54. </tr>
  55. <tr>
  56. <td>session.auto_start</td>
  57. <td align="right"><?php echo (((int)ini_get('session.auto_start') == 0) ? 'Off' : 'On'); ?></td>
  58. <td align="right"><img src="images/<?php echo (((int)ini_get('session.auto_start') == 0) ? 'tick.gif' : 'cross.gif'); ?>" border="0" width="16" height="16"></td>
  59. </tr>
  60. <tr>
  61. <td>session.use_trans_sid</td>
  62. <td align="right"><?php echo (((int)ini_get('session.use_trans_sid') == 0) ? 'Off' : 'On'); ?></td>
  63. <td align="right"><img src="images/<?php echo (((int)ini_get('session.use_trans_sid') == 0) ? 'tick.gif' : 'cross.gif'); ?>" border="0" width="16" height="16"></td>
  64. </tr>
  65. </table>
  66. <br />
  67. <table border="0" width="100%" cellspacing="0" cellpadding="2">
  68. <tr>
  69. <td><strong>Required PHP Extensions</strong></td>
  70. <td align="right" width="25"></td>
  71. </tr>
  72. <tr>
  73. <td>MySQL</td>
  74. <td align="right"><img src="images/<?php echo (extension_loaded('mysql') ? 'tick.gif' : 'cross.gif'); ?>" border="0" width="16" height="16"></td>
  75. </tr>
  76. </table>
  77. <br />
  78. <table border="0" width="100%" cellspacing="0" cellpadding="2">
  79. <tr>
  80. <td><strong>Optional PHP Extensions</strong></td>
  81. <td align="right" width="25"></td>
  82. </tr>
  83. <tr>
  84. <td>GD</td>
  85. <td align="right"><img src="images/<?php echo (extension_loaded('gd') ? 'tick.gif' : 'cross.gif'); ?>" border="0" width="16" height="16"></td>
  86. </tr>
  87. <tr>
  88. <td>cURL</td>
  89. <td align="right"><img src="images/<?php echo (extension_loaded('curl') ? 'tick.gif' : 'cross.gif'); ?>" border="0" width="16" height="16"></td>
  90. </tr>
  91. <tr>
  92. <td>OpenSSL</td>
  93. <td align="right"><img src="images/<?php echo (extension_loaded('openssl') ? 'tick.gif' : 'cross.gif'); ?>" border="0" width="16" height="16"></td>
  94. </tr>
  95. </table>
  96. <?php
  97. }
  98. ?>
  99. </div>
  100. </div>
  101. <div class="contentPane">
  102. <h2>New Installation</h2>
  103. <?php
  104. $configfile_array = array();
  105. if (file_exists(osc_realpath(dirname(__FILE__) . '/../../../includes') . '/configure.php') && !osc_is_writable(osc_realpath(dirname(__FILE__) . '/../../../includes') . '/configure.php')) {
  106. @chmod(osc_realpath(dirname(__FILE__) . '/../../../includes') . '/configure.php', 0777);
  107. }
  108. if (file_exists(osc_realpath(dirname(__FILE__) . '/../../../admin/includes') . '/configure.php') && !osc_is_writable(osc_realpath(dirname(__FILE__) . '/../../../admin/includes') . '/configure.php')) {
  109. @chmod(osc_realpath(dirname(__FILE__) . '/../../../admin/includes') . '/configure.php', 0777);
  110. }
  111. if (file_exists(osc_realpath(dirname(__FILE__) . '/../../../includes') . '/configure.php') && !osc_is_writable(osc_realpath(dirname(__FILE__) . '/../../../includes') . '/configure.php')) {
  112. $configfile_array[] = osc_realpath(dirname(__FILE__) . '/../../../includes') . '/configure.php';
  113. }
  114. if (file_exists(osc_realpath(dirname(__FILE__) . '/../../../admin/includes') . '/configure.php') && !osc_is_writable(osc_realpath(dirname(__FILE__) . '/../../../admin/includes') . '/configure.php')) {
  115. $configfile_array[] = osc_realpath(dirname(__FILE__) . '/../../../admin/includes') . '/configure.php';
  116. }
  117. $warning_array = array();
  118. if (function_exists('ini_get')) {
  119. if ($compat_register_globals == false) {
  120. $warning_array['register_globals'] = 'Compatibility with register_globals is supported from PHP 4.3+. This setting <u>must be enabled</u> due to an older PHP version being used.';
  121. }
  122. }
  123. if (!extension_loaded('mysql')) {
  124. $warning_array['mysql'] = 'The MySQL extension is required but is not installed. Please enable it to continue installation.';
  125. }
  126. if ((sizeof($configfile_array) > 0) || (sizeof($warning_array) > 0)) {
  127. ?>
  128. <div class="noticeBox">
  129. <?php
  130. if (sizeof($warning_array) > 0) {
  131. ?>
  132. <table border="0" width="100%" cellspacing="0" cellpadding="2" style="background: #fffbdf; border: 1px solid #ffc20b; padding: 2px;">
  133. <?php
  134. reset($warning_array);
  135. while (list($key, $value) = each($warning_array)) {
  136. echo ' <tr>' . "\n" .
  137. ' <td valign="top"><strong>' . $key . '</strong></td>' . "\n" .
  138. ' <td valign="top">' . $value . '</td>' . "\n" .
  139. ' </tr>' . "\n";
  140. }
  141. ?>
  142. </table>
  143. <?php
  144. }
  145. if (sizeof($configfile_array) > 0) {
  146. ?>
  147. <p>The webserver is not able to save the installation parameters to its configuration files.</p>
  148. <p>The following files need to have their file permissions set to world-writeable (chmod 777):</p>
  149. <p>
  150. <?php
  151. for ($i=0, $n=sizeof($configfile_array); $i<$n; $i++) {
  152. echo $configfile_array[$i];
  153. if (isset($configfile_array[$i+1])) {
  154. echo '<br />';
  155. }
  156. }
  157. ?>
  158. </p>
  159. <?php
  160. }
  161. ?>
  162. </div>
  163. <?php
  164. }
  165. if ((sizeof($configfile_array) > 0) || (sizeof($warning_array) > 0)) {
  166. ?>
  167. <p>Please correct the above errors and retry the installation procedure with the changes in place.</p>
  168. <?php
  169. if (sizeof($warning_array) > 0) {
  170. echo ' <p><i>Changing webserver configuration parameters may require the webserver service to be restarted before the changes take affect.</i></p>' . "\n";
  171. }
  172. ?>
  173. <p align="right"><a href="index.php"><img src="images/button_retry.gif" border="0" alt="Retry" /></a></p>
  174. <?php
  175. } else {
  176. ?>
  177. <p>The webserver environment has been verified to proceed with a successful installation and configuration of your online store.</p>
  178. <p>Please continue to start the installation procedure.</p>
  179. <p align="right"><a href="install.php"><img src="images/button_continue.gif" border="0" alt="Continue" /></a></p>
  180. <?php
  181. }
  182. ?>
  183. </div>
  184. </div>