PageRenderTime 44ms CodeModel.GetById 22ms RepoModel.GetById 1ms app.codeStats 0ms

/install/step2.php

https://github.com/jinzora/jinzora3
PHP | 653 lines | 616 code | 13 blank | 24 comment | 86 complexity | 87c5a5b00aafda56ceea89732094409e MD5 | raw file
  1. <?php if (!defined(JZ_SECURE_ACCESS)) die ('Security breach detected.');
  2. // Let's figure out the path stuff so we'll know how/where to include from$form_action = "index.php?install=step3";
  3. $form_action = setThisPage() . "install=step3";
  4. $recheck_action = setThisPage() . "install=step2";
  5. // Choose ezPublish Siteaccess, based on choosen installer language:
  6. switch ($_POST['jz_lang_file']){
  7. case "dutch";
  8. $siteaccess = "nl";
  9. break;
  10. // Every other installer language defaults to English Siteaccess:
  11. case
  12. $siteaccess = "en";
  13. break;
  14. }
  15. // Now let's include the left
  16. include_once($include_path. 'install/leftnav.php');
  17. $fatal = false;
  18. ?>
  19. <script language="JavaScript">
  20. <!--
  21. var siteaccess;
  22. var nodeid;
  23. var helpurl;
  24. function popuphelp(siteaccess,nodeid){
  25. helpurl='http://www.jinzorahelp.com/' + siteaccess + '/layout/set/program/content/view/base/' + nodeid;
  26. newwindow2=window.open(helpurl,'helpwindow','height=760,width=556');
  27. if (window.focus) {newwindow.focus()}
  28. }
  29. // -->
  30. </script>
  31. <div id="main">
  32. <a href="http://www.jinzora.com" target="_blank"><img src="<?php echo $include_path; ?>install/logo.gif" border="0" align="right" vspace="5" hspace="0"></a>
  33. <h1><?php echo $word_package_verify; ?></h1>
  34. <p>
  35. <?php echo $word_package_verify_note; ?>
  36. <form action="<?php echo $form_action; ?>" name="setup3" method="post">
  37. <?php
  38. $PostArray = $_POST;
  39. foreach ($PostArray as $key => $val) {
  40. if (!stristr($key,"submit")){
  41. echo '<input type="hidden" name="' . htmlentities($key) . '" value="' . htmlentities($val) .'">'. "\n";
  42. }
  43. }
  44. ?>
  45. <div class="go">
  46. <span class="goToNext">
  47. <?php echo $word_checking_requirements; ?>
  48. </span>
  49. </div>
  50. <table width="100%" cellspacing="0" cellpadding="0" border="0">
  51. <tr>
  52. <td class="td" width="30%" align="left">
  53. <?php echo $word_php_version; ?>
  54. </td>
  55. <td class="td" width="1">&nbsp;</td>
  56. <td class="td" width="70%" align="left">
  57. <?php
  58. $fatal = false;
  59. // First let's check the PHP Version
  60. if (phpversion() < 5.3){
  61. echo '<font color="red">4.2+ required, '. phpversion(). ' found - fatal error!</font>';
  62. ?>
  63. &nbsp; <a class="helpbox2" href="javascript:void(0);" onmouseover="return overlib('<?php echo $php_version_error; ?>');" onmouseout="return nd();">?</a>
  64. <?php
  65. $fatal = true;
  66. } else {
  67. echo '<font color="green">'. phpversion(). ' found (5.3 or higher required)</font>';
  68. }
  69. ?>
  70. </td>
  71. </tr>
  72. <tr>
  73. <td class="td" width="30%" align="left">
  74. <?php echo $word_php_session_support; ?>
  75. </td>
  76. <td class="td" width="1">&nbsp;</td>
  77. <td class="td" width="70%" align="left">
  78. <?php
  79. $fatal = false;
  80. // First let's check the PHP Version
  81. $jz_sess_test_var = 2;
  82. $jz_sess_test_var = $_SESSION['jz_sess_test'] + 1;
  83. if (!function_exists('session_name') or $jz_sess_test_var <> 1){
  84. echo '<font color="red">PHP Session Support not found/functioning - fatal!</font>';
  85. ?>
  86. &nbsp; <a class="helpbox2" href="javascript:void(0);" onmouseover="return overlib('<?php echo $php_session_error; ?>');" onmouseout="return nd();">?</a>
  87. <?php
  88. $fatal = true;
  89. } else {
  90. echo '<font color="green">PHP Session Support Enabled!</font>';
  91. }
  92. ?>
  93. </td>
  94. </tr>
  95. </table>
  96. <div class="go">
  97. <span class="goToNext">
  98. <?php echo $word_checking_optional; ?>
  99. </span>
  100. </div>
  101. <table width="100%" cellspacing="0" cellpadding="0" border="0">
  102. <tr>
  103. <td class="td" width="30%" align="left" valign="top">
  104. PHP MySQL Support:
  105. </td>
  106. <td class="td" width="1">&nbsp;</td>
  107. <td class="td" width="70%" align="left">
  108. <?php
  109. // Now let's check for GD support
  110. ob_start();
  111. phpinfo(INFO_MODULES);
  112. $module_info = ob_get_contents();
  113. ob_end_clean();
  114. if (stristr($module_info,"MySQL Support")){
  115. $mySQL = true;
  116. } else {
  117. $mySQL = false;
  118. }
  119. if (!$mySQL){
  120. echo '<font color="red">Native MySQL Support not found.</font>';
  121. } else {
  122. echo '<font color="green">MySQL Support found!</font>';
  123. }
  124. ?>
  125. </td>
  126. </tr>
  127. <tr>
  128. <td class="td" width="30%" align="left" valign="top">
  129. PHP SQLite Support:
  130. </td>
  131. <td class="td" width="1">&nbsp;</td>
  132. <td class="td" width="70%" align="left">
  133. <?php
  134. // Now let's check for GD support
  135. if (function_exists("sqlite_query")) {
  136. $pg = true;
  137. } else {
  138. $pg = false;
  139. }
  140. if (!$pg){
  141. echo '<font color="orange">Not found - only necessary if you want to use SQLite.</font>';
  142. } else {
  143. echo '<font color="green">SQLite Support found!</font>';
  144. }
  145. ?>
  146. </td>
  147. </tr>
  148. <tr>
  149. <td class="td" width="30%" align="left" valign="top" nowrap>
  150. PHP PostgreSQL Support:
  151. </td>
  152. <td class="td" width="1">&nbsp;</td>
  153. <td class="td" width="70%" align="left">
  154. <?php
  155. // Now let's check for GD support
  156. if (function_exists("pg_connect")) {
  157. $pg = true;
  158. } else {
  159. $pg = false;
  160. }
  161. if (!$pg){
  162. echo '<font color="orange">Not found - only necessary if you want to use PostgreSQL.</font>';
  163. } else {
  164. echo '<font color="green">Postgres Support found!</font>';
  165. }
  166. ?>
  167. </td>
  168. </tr>
  169. <tr>
  170. <td class="td" width="30%" align="left" valign="top" nowrap>
  171. PHP MSSQL Support:
  172. </td>
  173. <td class="td" width="1">&nbsp;</td>
  174. <td class="td" width="70%" align="left">
  175. <?php
  176. // Now let's check for GD support
  177. if (function_exists("mssql_connect")) {
  178. $pg = true;
  179. } else {
  180. $pg = false;
  181. }
  182. if (!$pg){
  183. echo '<font color="orange">Not found - only necessary if you want to use Microsft SQL.</font>';
  184. } else {
  185. echo '<font color="green">MSSQL Support found!</font>';
  186. }
  187. ?>
  188. </td>
  189. </tr>
  190. <tr>
  191. <td class="td" width="30%" align="left" valign="top">
  192. DBX Support:
  193. </td>
  194. <td class="td" width="1">&nbsp;</td>
  195. <td class="td" width="70%" align="left">
  196. <?php
  197. // Now let's check for GD support
  198. if (function_exists("dbx_query")) {
  199. $pg = true;
  200. } else {
  201. $pg = false;
  202. }
  203. if (!$pg){
  204. echo '<font color="orange">Not found - only necessary for DBX databases.</font>';
  205. } else {
  206. echo '<font color="green">DBX Support found!</font>';
  207. }
  208. ?>
  209. </td>
  210. </tr>
  211. <tr>
  212. <td class="td" width="30%" align="left" valign="top">
  213. PHP Register Globals:
  214. </td>
  215. <td class="td" width="1">&nbsp;</td>
  216. <td class="td" width="70%" align="left">
  217. <?php
  218. // Now let's check for GD support
  219. if (ini_get('register_globals') == "1"){
  220. echo '<font color="red">On - <strong>HUGE Possible Security Risk</strong></font>';
  221. ?>
  222. &nbsp; <a class="helpbox2" href="javascript:void(0);" onmouseover="return overlib('<?php echo $word_reg_global_error; ?>');" onmouseout="return nd();">?</a>
  223. <?php
  224. } else {
  225. echo '<font color="green">Off</font>';
  226. }
  227. ?>
  228. </td>
  229. </tr>
  230. <tr>
  231. <td class="td" width="30%" align="left" valign="top">
  232. Magic Quotes:
  233. </td>
  234. <td class="td" width="1">&nbsp;</td>
  235. <td class="td" width="70%" align="left">
  236. <?php
  237. // Now let's check for magic quotes
  238. $magic_quotes_err = false;
  239. if (function_exists('get_magic_quotes_runtime') && get_magic_quotes_runtime()) {
  240. echo '<font color="red">On - magic_quotes_runtime should be disabled.</font>';
  241. $magic_quotes_err = true;
  242. } elseif (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) {
  243. echo '<font color="red">On - magic_quotes_gpc should be disabled.</font>';
  244. $magic_quotes_err = true;
  245. }
  246. if ($magic_quotes_err == true) {
  247. ?>
  248. &nbsp; <a class="helpbox2" href="javascript:void(0);" onmouseover="return overlib('<?php echo $word_magic_quotes_error; ?>');" onmouseout="return nd();">?</a>
  249. <?php
  250. } else {
  251. echo '<font color="green">Off</font>';
  252. }
  253. ?>
  254. </td>
  255. </tr>
  256. <tr>
  257. <td class="td" width="30%" align="left" valign="top">
  258. <?php echo $word_gd; ?>
  259. </td>
  260. <td class="td" width="1">&nbsp;</td>
  261. <td class="td" width="70%" align="left">
  262. <?php
  263. // Now let's check for GD support
  264. ob_start();
  265. phpinfo(INFO_MODULES);
  266. $module_info = ob_get_contents();
  267. ob_end_clean();
  268. if (preg_match("/\bgd\s+version\b[^\d\n\r]+?([\d\.]+)/i",$module_info,$matches)) {
  269. $gd_version_number = $matches[1];
  270. } else {
  271. $gd_version_number = 0;
  272. }
  273. if ($gd_version_number == 0){
  274. echo $word_gd_error;
  275. ?>
  276. &nbsp; <a class="helpbox2" href="javascript:void(0);" onmouseover="return overlib('<?php echo $word_gd_error_note; ?>');" onmouseout="return nd();">?</a>
  277. <?php
  278. } else {
  279. echo '<font color="green">GD found!</font>';
  280. }
  281. ?>
  282. </td>
  283. </tr>
  284. <tr>
  285. <td class="td" width="30%" align="left" valign="top">
  286. <?php echo $word_iconv; ?>
  287. </td>
  288. <td class="td" width="1">&nbsp;</td>
  289. <td class="td" width="70%" align="left">
  290. <?php
  291. // Now let's check for GD support
  292. ob_start();
  293. phpinfo(INFO_MODULES);
  294. $module_info = ob_get_contents();
  295. ob_end_clean();
  296. if (stristr($module_info,"iconv library version")){
  297. // Now let's get the iconv version
  298. $iconv = substr($module_info,strpos($module_info,"iconv library version"));
  299. $iconv = substr($iconv,strpos($iconv,'class="v">')+strlen('class="v">'),10);
  300. $iconv = trim(substr($iconv,0,strpos($iconv,"<")));
  301. } else {
  302. $iconv = 0;
  303. }
  304. if ($iconv == 0){
  305. echo $word_iconv_error;
  306. ?>
  307. &nbsp; <a class="helpbox2" href="javascript:void(0);" onmouseover="return overlib('<?php echo $word_iconv_error_note; ?>');" onmouseout="return nd();">?</a>
  308. <?php
  309. } else {
  310. echo '<font color="green">Iconv found!</font>';
  311. }
  312. ?>
  313. </td>
  314. </tr>
  315. <tr>
  316. <td class="td" width="30%" align="left" valign="top">
  317. <?php echo $word_pdf; ?>
  318. </td>
  319. <td class="td" width="1">&nbsp;</td>
  320. <td class="td" width="70%" align="left">
  321. <?php
  322. // Now let's check for GD support
  323. ob_start();
  324. phpinfo(INFO_MODULES);
  325. $module_info = ob_get_contents();
  326. ob_end_clean();
  327. if (stristr($module_info,"pdf")){
  328. // Now let's get the iconv version
  329. $pdf = true;
  330. } else {
  331. $pdf = false;
  332. }
  333. if (!$pdf){
  334. echo '<font color="orange">'. $word_pdf_error. '</font>';
  335. } else {
  336. echo '<font color="green">PDF support found!</font>';
  337. }
  338. ?>
  339. </td>
  340. </tr>
  341. </table>
  342. <div class="go">
  343. <span class="goToNext">
  344. <?php echo $word_checking_permissions; ?>
  345. </span>
  346. </div>
  347. <table width="100%" cellspacing="0" cellpadding="0" border="0">
  348. <tr>
  349. <td class="td" width="30%" align="left" valign="top">
  350. settings.php
  351. </td>
  352. <td class="td" width="1">&nbsp;</td>
  353. <td class="td" width="70%" align="left">
  354. <?php
  355. // Now let's check to see if things are writeable
  356. $file = $include_path. "settings.php";
  357. $error = true;
  358. if (!is_file($file)){
  359. if (@touch($file)){
  360. unlink($file);
  361. $error = false;
  362. }
  363. } else {
  364. if (is_writable($file)){
  365. $error = false;
  366. }
  367. }
  368. if ($error){
  369. echo '<font color="red">'. $word_not_writable. '</font>';
  370. ?>
  371. <a class="helpbox2" href="javascript:void(0);" onmouseover="return overlib('<?php echo $word_settings_perm_error; ?>');" onmouseout="return nd();">?</a>
  372. <?php
  373. echo '<br>';
  374. } else {
  375. echo '<font color="green">'. $word_writable. '</font><br>';
  376. }
  377. ?>
  378. </td>
  379. </tr>
  380. <tr>
  381. <td class="td" width="30%" align="left" valign="top">
  382. data dir
  383. </td>
  384. <td class="td" width="1">&nbsp;</td>
  385. <td class="td" width="70%" align="left">
  386. <?php
  387. // Now let's check all the directories
  388. $dirs = array("data/artists","data/cache","data/cache/discussions","data/cache/featured","data/cache/nodes","data/cache/request","data/cache/tracks","data/counter","data/database","data/database/discussions","data/discussions","data/downloads","data/featured","data/featured/albums","data/featured/artists","data/images","data/ratings","data/tracks","data/users","data/viewed");
  389. // Now let's test each dir
  390. $fileError = false;
  391. foreach($dirs as $dir){
  392. $file = $include_path. $dir;
  393. if (!is_writable($file)){
  394. $fileError = true;
  395. echo $file. " - not writable!<br>";
  396. }
  397. }
  398. if ($fileError){
  399. $error = true;
  400. }
  401. if ($error){
  402. $fatal = true;
  403. echo '<font color="red">'. $word_not_writable. ' ('. $word_fatal_error. ')</font>';
  404. ?>
  405. <a class="helpbox2" href="javascript:void(0);" onmouseover="return overlib('<?php echo $word_data_perm_error; ?>');" onmouseout="return nd();">?</a>
  406. <?php
  407. echo '<br>';
  408. } else {
  409. echo '<font color="green">'. $word_writable. '</font><br>';
  410. }
  411. ?>
  412. </td>
  413. </tr>
  414. <tr>
  415. <td class="td" width="30%" align="left" valign="top">
  416. temp dir
  417. </td>
  418. <td class="td" width="1">&nbsp;</td>
  419. <td class="td" width="70%" align="left">
  420. <?php
  421. $file = $include_path. "temp/test.txt";
  422. $error = true;
  423. if (!is_file($file)){
  424. if (@touch($file)){
  425. unlink($file);
  426. $error = false;
  427. }
  428. } else {
  429. if (is_writable($file)){
  430. $error = false;
  431. }
  432. }
  433. if ($error){
  434. $fatal = true;
  435. echo '<font color="red">'. $word_not_writable. ' ('. $word_fatal_error. ')</font>';
  436. ?>
  437. <a class="helpbox2" href="javascript:void(0);" onmouseover="return overlib('<?php echo $word_temp_perm_error; ?>');" onmouseout="return nd();">?</a>
  438. <?php
  439. echo '<br>';
  440. } else {
  441. echo '<font color="green">'. $word_writable. '</font><br>';
  442. }
  443. ?>
  444. </td>
  445. </tr>
  446. </table>
  447. <div class="go">
  448. <span class="goToNext">
  449. <?php echo $word_checking_files; ?>
  450. </span>
  451. </div>
  452. <?php
  453. // Now let's make sure ALL the files exist
  454. $fileMiss = false;
  455. $cArray = file($include_path. 'install/filelist.txt');
  456. for ($i=0; $i < count($cArray); $i++){
  457. if (!is_file(trim(getcwd(). "/". $include_path. $cArray[$i]))){
  458. $fatal = true;
  459. $fileMiss = true;
  460. $missing[] = $cArray[$i];
  461. }
  462. }
  463. ?>
  464. <table width="100%" cellspacing="0" cellpadding="0" border="0">
  465. <tr>
  466. <td class="td" width="30%" align="left" valign="top">
  467. <?php echo $word_checking. " ". $i. " ". $word_files; ?>
  468. </td>
  469. <td class="td" width="1">&nbsp;</td>
  470. <td class="td" width="70%" align="left">
  471. <?php
  472. if (!$fileMiss){
  473. echo '<font color="green">'. $word_all_files_found. '</font>';
  474. } else {
  475. echo '<font color="red"><strong>'. $word_files_missing. '</strong>';
  476. echo '<br>Missing:<br>';
  477. foreach($missing as $file){
  478. echo $file. "<br>";
  479. }
  480. echo '</font>';
  481. }
  482. ?>
  483. </td>
  484. </tr>
  485. </table>
  486. <div class="go">
  487. <span class="goToNext">
  488. <?php echo $word_recommended_settings; ?>
  489. </span>
  490. </div>
  491. <?php $recheck = false; ?>
  492. <table width="100%" cellspacing="0" cellpadding="0" border="0">
  493. <tr>
  494. <td class="td" width="30%" align="left" valign="top">
  495. PHP Settings:<br>
  496. (php.ini)
  497. </td>
  498. <td class="td" width="1">&nbsp;</td>
  499. <td class="td" width="70%" align="left">
  500. <table width="100%" cellspacing="0" cellpadding="0" border="0">
  501. <tr>
  502. <td width="50%" class="td">
  503. <strong>Setting</strong>
  504. </td>
  505. <td width="25%" align="center" class="td">
  506. <strong>Actual</strong>
  507. </td>
  508. <td width="25%" align="center" class="td">
  509. <strong>Recommend</strong>
  510. </td>
  511. </tr>
  512. <tr>
  513. <td width="50%" class="td">
  514. max_execution_time:
  515. </td>
  516. <td width="25%" align="center" class="td">
  517. <?php
  518. if (ini_get('max_execution_time') > 299 || ini_get('max_execution_time') <= 0) {
  519. echo '<font color="green">';
  520. } else {
  521. echo '<font color="red">';
  522. $recheck = true;
  523. }
  524. echo ini_get('max_execution_time'). "</font><br>\n"
  525. ?>
  526. </td>
  527. <td width="25%" align="center" class="td">
  528. 300+
  529. </td>
  530. </tr>
  531. <tr>
  532. <td width="50%" class="td">
  533. memory_limit:
  534. </td>
  535. <td width="25%" align="center" class="td">
  536. <?php
  537. if (ini_get('memory_limit') >= 32){
  538. echo '<font color="green">';
  539. } else {
  540. echo '<font color="red">';
  541. $recheck = true;
  542. }
  543. echo ini_get('memory_limit'). "</font><br>\n"
  544. ?>
  545. </td>
  546. <td width="25%" align="center" class="td">
  547. 32M+
  548. </td>
  549. </tr>
  550. <tr>
  551. <td width="50%" class="td">
  552. post_max_size:
  553. </td>
  554. <td width="25%" align="center" class="td">
  555. <?php
  556. if (ini_get('post_max_size') >= 32){
  557. echo '<font color="green">';
  558. } else {
  559. echo '<font color="red">';
  560. $recheck = true;
  561. }
  562. echo ini_get('post_max_size'). "</font><br>\n";
  563. ?>
  564. </td>
  565. <td width="25%" align="center" class="td">
  566. 32M+
  567. </td>
  568. </tr>
  569. <tr>
  570. <td width="50%" class="td">
  571. file_uploads:
  572. </td>
  573. <td width="25%" align="center" class="td">
  574. <?php
  575. if (ini_get('file_uploads') > 0){
  576. echo '<font color="green">';
  577. } else {
  578. echo '<font color="red">';
  579. $recheck = true;
  580. }
  581. echo ini_get('file_uploads'). "</font><br>\n";
  582. ?>
  583. </td>
  584. <td width="25%" align="center" class="td">
  585. 1 (on)
  586. </td>
  587. </tr>
  588. <tr>
  589. <td width="50%" class="td">
  590. upload_max_filesize:
  591. </td>
  592. <td width="25%" align="center" class="td">
  593. <?php
  594. if (ini_get('upload_max_filesize') >= 32){
  595. echo '<font color="green">';
  596. } else {
  597. echo '<font color="red">';
  598. $recheck = true;
  599. }
  600. echo ini_get('upload_max_filesize'). "</font><br>\n";
  601. ?>
  602. </td>
  603. <td width="25%" align="center" class="td">
  604. 32M+
  605. </td>
  606. </tr>
  607. </table>
  608. </td>
  609. </tr>
  610. </table>
  611. <div class="go">
  612. <span class="goToNext">
  613. <?php
  614. if (!$fatal){
  615. echo '&nbsp; <input type="submit" name="submit_step3" value="'. $word_proceed_license. '" class="submit">';
  616. echo '</form>';
  617. }
  618. if ($fatal){
  619. echo $word_fatal_errors;
  620. }
  621. if ($fatal or $recheck){
  622. echo '</form>';
  623. echo '<form action="'. $recheck_action. '" name="setup2" method="post">';
  624. $PostArray = $_POST;
  625. foreach ($PostArray as $key => $val) {
  626. if (!stristr($key,"submit")){
  627. echo '<input type="hidden" name="' . htmlentities($key) . '" value="' . htmlentities($val) .'">'. "\n";
  628. }
  629. }
  630. echo '<br>&nbsp; <input type="submit" name="reload" value="'. $word_recheck_req. '" class="submit">';
  631. echo '</form>';
  632. }
  633. ?>
  634. </span>
  635. </div>
  636. </div>
  637. <?php
  638. // Now let's include the top
  639. include_once($include_path. 'install/footer.php');
  640. ?>