Commit 36011bb5b866c937d84441c1c16530b1112a97db

Authored by ydavids
1 parent 7e3a58e4

KTS-2606

"KnowledgeTree 3.5 requires php5 to be installed. It should detect php4 and provide an elegant error message that it is no longer supported."
Fixed. Inserted phpversion check in dmsDefaults.php.

Committed By:Yusuf Davids
Reviewed By:Jonathan Byrne

git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@7788 c91229c3-7414-0410-bfa2-8a42b809f60b
config/dmsDefaults.php
... ... @@ -609,6 +609,18 @@ require_once(KT_LIB_DIR . '/ktentity.inc');
609 609  
610 610 $KTInit->catchFatalErrors();
611 611  
  612 +if (phpversion()<5){
  613 +
  614 + $sErrorPage = 'http://'.$_SERVER['HTTP_HOST'].'/'.'customerrorpage.php';
  615 +
  616 + session_start();
  617 +
  618 + $_SESSION['sErrorMessage'] = 'KnowledgeTree now requires that PHP version 5 is installed. PHP version 4 is no longer supported.';
  619 +
  620 +
  621 + header('location:'. $sErrorPage ) ;
  622 +
  623 +}
612 624  
613 625 require_once(KT_LIB_DIR . '/config/config.inc.php');
614 626 require_once(KT_DIR . '/search2/indexing/indexerCore.inc.php');
... ...
customerrorpage.php
... ... @@ -12,6 +12,14 @@ if (array_key_exists(&#39;Error_MessageOne&#39;, $_POST) &amp;&amp; array_key_exists(&#39;Error_Mess
12 12  
13 13 }
14 14  
  15 +session_start();
  16 +if (array_key_exists('sErrorMessage', $_SESSION))
  17 +{
  18 +$phperror = $_SESSION['sErrorMessage'];
  19 +}
  20 +
  21 +
  22 +
15 23 ?>
16 24  
17 25 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html>
... ... @@ -39,7 +47,7 @@ open.style.display = &#39;block&#39;;
39 47  
40 48 <h1>Error!! - You have encountered a problem starting your document management system.</h1>
41 49 <p><h2>Please contact your systems administrator</h2></p>
42   - <p>For more details, click here <img src="/resources/graphics/info.gif" style="cursor: pointer;" onclick="Click()" /><div id ="exp" style="display: none; "> <?php if(isset($sErrorMessage)){ echo $sErrorMessage; }else if(isset($posted)){ echo $posted; } ?></div></p>
  50 + <p>For more details, click here <img src="/resources/graphics/info.gif" style="cursor: pointer;" onclick="Click()" /><div id ="exp" style="display: none; "> <?php if(isset($sErrorMessage)){ echo $sErrorMessage; }else if(isset($posted)){ echo $posted; } else if($phperror){ echo $phperror; } ?></div></p>
43 51  
44 52 </div>
45 53 </div>
... ...