-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmnetcron.php
55 lines (50 loc) · 2.01 KB
/
mnetcron.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This file is a cron microclock script.
* It will be used as replacement of setting individual
* cron lines for all virtual instances.
*
* Setup this vcron to run at the smallest period possible, as
* it will schedule all availables vmoodle to be run as required.
* Note that one activaton of this cron may not always run real crons
* or may be run more than one cron.
*
* If used on a big system with clustering, ensure hostnames are adressed
* at the load balancer entry and not on physical hosts. Thus the cluster
* settings of vmoodle will NOT be applicable to the web operated vcron (this script) as
* the load balancer itself diverts the cron http processes.
*
* @package local_vmoodle
* @category local
* @author Valery fremaux ([email protected])
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
*/
require('../../config.php');
require_once($CFG->dirroot.'/local/vmoodle/mnetcronlib.php');
// extra safety
\core\session\manager::write_close();
// check if execution allowed
// This script is being called via the web, use the global password if set.
if (!empty($CFG->cronremotepassword)) {
$pass = optional_param('password', '', PARAM_RAW);
if ($pass != $CFG->cronremotepassword) {
// wrong password.
print_error('cronerrorpassword', 'admin');
exit;
}
}
cron_check_mnet_keys();