Subversion Repositories ggsysinfo

[/] [modules/] [sysinfo/] [lib/] [PhpSecInfo/] [Test/] [Core/] [open_basedir.php] - Blame information for rev 123

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 123 gg
<?php
2
/**
3
 * Test Class for open_basedir
4
 *
5
 * @package PhpSecInfo
6
 * @author Ed Finkler <coj@funkatron.com>
7
 */
8
 
9
 
10
/**
11
 * require the PhpSecInfo_Test_Core class
12
 */
13
require_once(PHPSECINFO_BASE_DIR.'/Test/Test_Core.php');
14
 
15
/**
16
 * Test Class for open_basedir
17
 *
18
 * @package PhpSecInfo
19
 */
20
class PhpSecInfo_Test_Core_Open_Basedir extends PhpSecInfo_Test_Core
21
{
22
 
23
        /**
24
         * This should be a <b>unique</b>, human-readable identifier for this test
25
         *
26
         * @var string
27
         */
28
        var $test_name = "open_basedir";
29
 
30
        var $recommended_value = TRUE;
31
 
32
 
33
        function _retrieveCurrentValue() {
34
                $this->current_value = $this->getBooleanIniValue('open_basedir');
35
        }
36
 
37
 
38
        /**
39
         * Checks to see if allow_url_fopen is enabled
40
         *
41
         */
42
        function _execTest() {
43
                if ($this->current_value == $this->recommended_value) {
44
                        return PHPSECINFO_TEST_RESULT_OK;
45
                }
46
 
47
                return PHPSECINFO_TEST_RESULT_NOTICE;
48
        }
49
 
50
 
51
        /**
52
         * Set the messages specific to this test
53
         *
54
         */
55
        function _setMessages() {
56
                parent::_setMessages();
57
 
58
                $this->setMessageForResult(PHPSECINFO_TEST_RESULT_OK, 'en', 'open_basedir is enabled, which is the
59
                                recommended setting. Keep in mind that other web applications not written in PHP will not
60
                                be restricted by this setting.');
61
                $this->setMessageForResult(PHPSECINFO_TEST_RESULT_NOTICE, 'en', 'open_basedir is disabled.  When
62
                                        this is enabled, only files that are in the
63
                                        given directory/directories and their subdirectories can be read by PHP scripts.
64
                                        You should consider turning this on.  Keep in mind that other web applications not
65
                                        written in PHP will not be restricted by this setting.');
66
        }
67
 
68
 
69
}