"MDL-14932, move the course section"
[moodle-linuxchix.git] / lib / customcheckslib.php
blobead8e83ce84d108bd7bfee473c4f1801c049b681
1 <?php //$Id$
3 ///////////////////////////////////////////////////////////////////////////
4 // //
5 // NOTICE OF COPYRIGHT //
6 // //
7 // Moodle - Modular Object-Oriented Dynamic Learning Environment //
8 // http://moodle.com //
9 // //
10 // Copyright (C) 1999 onwards Martin Dougiamas http://dougiamas.com //
11 // (C) 2001-3001 Eloy Lafuente (stronk7) http://contiento.com //
12 // //
13 // This program is free software; you can redistribute it and/or modify //
14 // it under the terms of the GNU General Public License as published by //
15 // the Free Software Foundation; either version 2 of the License, or //
16 // (at your option) any later version. //
17 // //
18 // This program is distributed in the hope that it will be useful, //
19 // but WITHOUT ANY WARRANTY; without even the implied warranty of //
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
21 // GNU General Public License for more details: //
22 // //
23 // http://www.gnu.org/copyleft/gpl.html //
24 // //
25 ///////////////////////////////////////////////////////////////////////////
27 /// This library contains a collection of functions able to perform
28 /// some custom checks executed by environmental tests (automatically
29 /// executed on install & upgrade and under petition in the admin block).
30 ///
31 /// Any function in this library must return:
32 /// - null: if the test isn't relevant and must not be showed (ignored)
33 /// - environment_results object with the status set to:
34 /// - true: if passed
35 /// - false: if failed
37 /**
38 * This function will look for the risky PHP setting register_globals
39 * in order to inform about. MDL-12914
41 * @param $result the environment_results object to be modified
42 * @return mixed null if the test is irrelevant or environment_results object with
43 * status set to true (test passed) or false (test failed)
45 function php_check_register_globals($result) {
47 /// Check for register_globals. If enabled, security warning
48 if (ini_get_bool('register_globals')) {
49 $result->status = false;
50 } else {
51 $result = null;
54 return $result;