Updated the master build version
[moodle.git] / lib / customcheckslib.php
CommitLineData
3564771d 1<?php
6f5e0852
PS
2// This file is part of Moodle - http://moodle.org/
3//
3564771d 4// Moodle is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// Moodle is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
6f5e0852 13//
3564771d 14// You should have received a copy of the GNU General Public License
15// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
5075a6ca 16
3564771d 17/**
18 * This is a one-line short description of the file
19 *
20 * This library contains a collection of functions able to perform
21 * some custom checks executed by environmental tests (automatically
22 * executed on install & upgrade and under petition in the admin block).
23 *
24 * Any function in this library must return:
25 * - null: if the test isn't relevant and must not be showed (ignored)
26 * - environment_results object with the status set to:
27 * - true: if passed
28 * - false: if failed
3564771d 29 *
78bfb562
PS
30 * @package core
31 * @subpackage admin
32 * @copyright (C) 2001-3001 Eloy Lafuente (stronk7) {@link http://contiento.com}
33 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
3564771d 34 */
5075a6ca 35
78bfb562
PS
36defined('MOODLE_INTERNAL') || die();
37
5075a6ca 38/**
6cf05835 39 * This function will look for the risky PHP setting register_globals
40 * in order to inform about. MDL-12914
5075a6ca 41 *
3564771d 42 * @param object $result the environment_results object to be modified
5075a6ca 43 * @return mixed null if the test is irrelevant or environment_results object with
44 * status set to true (test passed) or false (test failed)
45 */
6cf05835 46function php_check_register_globals($result) {
47
48/// Check for register_globals. If enabled, security warning
49 if (ini_get_bool('register_globals')) {
50 $result->status = false;
51 } else {
52 $result = null;
53 }
54
55 return $result;
5075a6ca 56}