[ Index ]
 

Code source de Claroline 188

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/claroline/admin/technical/lib/Test/Core/ -> open_basedir.php (source)

   1  <?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 dirname(__FILE__) . '/../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 $_messages = array(
  31          PHPSECINFO_TEST_RESULT_OK => array(
  32                      'en' => 'open_basedir is enabled, which is the recommended setting. Keep in mind that other web
  33                      applications not written in PHP will not be restricted by this setting.',
  34                      ),
  35          PHPSECINFO_TEST_RESULT_NOTICE => array(
  36                      'en' => 'open_basedir is disabled.  When this is enabled, only files that are in the given directory/directories and
  37                      their subdirectories can be read by PHP scripts.  You should consider turning this on.  Keep in mind that other web
  38                      applications not written in PHP will not be restricted by this setting.',
  39                      ),
  40          );
  41  
  42      /**
  43       * Check to see if the open_basedir setting is enabled.
  44       *
  45       */
  46  	function _execTest() {
  47  
  48          if ($this->getBooleanIniValue('open_basedir')) {
  49              return PHPSECINFO_TEST_RESULT_OK;
  50          }
  51  
  52          return PHPSECINFO_TEST_RESULT_NOTICE;
  53      }
  54  
  55  
  56      /**
  57       * Set the messages specific to this test
  58       *
  59       */
  60  	function _setMessages() {
  61          parent::_setMessages();
  62  
  63          $this->setMessageForResult(PHPSECINFO_TEST_RESULT_OK, 'en', 'open_basedir is enabled, which is the
  64                  recommended setting. Keep in mind that other web applications not written in PHP will not
  65                  be restricted by this setting.');
  66          $this->setMessageForResult(PHPSECINFO_TEST_RESULT_NOTICE, 'en', 'open_basedir is disabled.  When
  67                      this is enabled, only files that are in the
  68                      given directory/directories and their subdirectories can be read by PHP scripts.
  69                      You should consider turning this on.  Keep in mind that other web applications not
  70                      written in PHP will not be restricted by this setting.');
  71      }
  72  
  73  
  74  }


Généré le : Thu Nov 29 14:38:42 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics