-
Notifications
You must be signed in to change notification settings - Fork 6
/
vtigercron.php
executable file
·62 lines (51 loc) · 1.91 KB
/
vtigercron.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
56
57
58
59
60
61
62
<?php
/*+*******************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
********************************************************************************/
/** Load the configuration file common to cron tasks. */
require_once('cron/config.cron.php');
global $VTIGER_CRON_CONFIGURATION;
/**
* To make sure we can work with command line and direct browser invocation.
*/
if($argv) {
if(!isset($_REQUEST)) $_REQUEST = Array();
for($index = 0; $index < count($argv); ++$index) {
$value = $argv[$index];
if(strpos($value, '=') === false) continue;
$keyval = explode('=', $value);
if(!isset($_REQUEST[$keyval[0]])) {
$_REQUEST[$keyval[0]] = $keyval[1];
}
}
/* If app_key is not set, pick the value from cron configuration */
if(empty($_REQUEST['app_key'])) $_REQUEST['app_key'] = $VTIGER_CRON_CONFIGURATION['app_key'];
}
/** All service invocation needs have valid app_key parameter sent */
require_once('config.inc.php');
/** Verify the script call is from trusted place. */
global $application_unique_key;
if($_REQUEST['app_key'] != $application_unique_key) {
echo "Access denied!";
exit;
}
/** Include the service file */
$service = $_REQUEST['service'];
if($service == 'MailScanner') {
include_once('cron/MailScanner.service');
}
if($service == 'RecurringInvoice') {
include_once('cron/modules/SalesOrder/RecurringInvoice.service');
}
if($service == 'com_vtiger_workflow'){
include_once('cron/modules/com_vtiger_workflow/com_vtiger_workflow.service');
}
if($service == 'VtigerBackup'){
include_once('cron/modules/VtigerBackup/VtigerBackup.service');
}
?>