Commit 90bbdf7dd27d1775f65d4c4f11cbf7150dcef917

Authored by Neil Blakey-Milner
1 parent d6e28ac2

Mention .htaccess, and test that .htaccess is working.

Also, perform a through-the-web test of the Documents directory to make
sure it isn't left accessible via the web.


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@3252 c91229c3-7414-0410-bfa2-8a42b809f60b
setup/postcheckup.php
@@ -44,10 +44,18 @@ that things are still set up correctly.</p> @@ -44,10 +44,18 @@ that things are still set up correctly.</p>
44 <?php 44 <?php
45 45
46 if (substr($default->documentRoot, 0, strlen(KT_DIR)) == KT_DIR) { 46 if (substr($default->documentRoot, 0, strlen(KT_DIR)) == KT_DIR) {
47 - print '<p><font color="orange">Your document directory seems to be  
48 - accessible from the web. Change the documentRoot in your  
49 - environment.php configuration file to a place not accessible from  
50 - the web to prevent access outside of KnowledgeTree.</font></p>'; 47 + print '<p><strong><font color="orange">Your document directory is
  48 + set to the default, which is inside the web root. This may present
  49 + a security problem if your documents can be accessed from the web,
  50 + working around the permission system in
  51 + KnowledgeTree.</font></strong></p>';
  52 +}
  53 +
  54 +$linkcheck = generateLink('/Documents/', '');
  55 +$handle = @fopen($linkcheck, 'rb');
  56 +if ($handle !== false) {
  57 + print '<p><strong><font color="red">Your document directory seems to
  58 + be accessible via the web!</font></strong></p>';
51 } 59 }
52 60
53 ?> 61 ?>
setup/precheckup.php
@@ -127,6 +127,7 @@ function bigEnough($name, $setting, $preferred, $bytes = false, $red = true) { @@ -127,6 +127,7 @@ function bigEnough($name, $setting, $preferred, $bytes = false, $red = true) {
127 } 127 }
128 128
129 function must_extension_loaded($ext, $message = "") { 129 function must_extension_loaded($ext, $message = "") {
  130 + @dl($ext);
130 if (extension_loaded($ext)) { 131 if (extension_loaded($ext)) {
131 return '<b><font color="green">Available</font></b>'; 132 return '<b><font color="green">Available</font></b>';
132 } 133 }
@@ -167,6 +168,13 @@ function running_user() { @@ -167,6 +168,13 @@ function running_user() {
167 return null; 168 return null;
168 } 169 }
169 170
  171 +function htaccess() {
  172 + if (array_key_exists('kt_htaccess_worked', $_SERVER)) {
  173 + return '<p><strong><font color="green">Your web server is set up to use the .htaccess files.</font></strong></p>';
  174 + }
  175 + return '<p><strong><font color="red">Your web server is NOT set up to use the .htaccess files.</font></strong></p>';
  176 +}
  177 +
170 ?> 178 ?>
171 <html> 179 <html>
172 <head> 180 <head>
@@ -189,6 +197,16 @@ added. Green items means you&#39;re ready to go in this area. You can @@ -189,6 +197,16 @@ added. Green items means you&#39;re ready to go in this area. You can
189 check back here to see if anything has changed in your environment if 197 check back here to see if anything has changed in your environment if
190 you have any problems.</p> 198 you have any problems.</p>
191 199
  200 +<h2>.htaccess file</h2>
  201 +
  202 +<p>You can let KnowledgeTree manage the PHP settings that apply to the
  203 +KnowledgeTree application (it won't affect your other applications) by
  204 +configuring your web server to use the .htaccess files that come with
  205 +KnowledgeTree. This will ensure that the settings for KnowledgeTree
  206 +(detailed below) are set up for optimal, reliable performance.</p>
  207 +
  208 +<?=htaccess()?>
  209 +
192 <h2>PHP version and extensions</h2> 210 <h2>PHP version and extensions</h2>
193 211
194 <p>This relates to your PHP installation environment - which version of 212 <p>This relates to your PHP installation environment - which version of
@@ -222,7 +240,7 @@ PHP you are running, and which modules are available.&lt;/p&gt; @@ -222,7 +240,7 @@ PHP you are running, and which modules are available.&lt;/p&gt;
222 </tr> 240 </tr>
223 <tr> 241 <tr>
224 <th>Fileinfo support</th> 242 <th>Fileinfo support</th>
225 - <td><?=can_extension_loaded('fileinfo', "Provides better file identification support - not necessary if you use file entensions");?></td> 243 + <td><?=can_extension_loaded('fileinfo', "Provides better file identification support - not necessary if you use file extensions");?></td>
226 </tr> 244 </tr>
227 </tbody> 245 </tbody>
228 </table> 246 </table>