PluginProbe
VikBooking Hotel Booking Engine & PMS / trunk
VikBooking Hotel Booking Engine & PMS vtrunk
1.8.15 1.8.14 1.8.13 1.8.12 1.8.11 1.8.10 1.8.9 1.8.6 1.8.7 1.8.8 trunk 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.6.8 1.6.9 1.7.0 1.7.1 1.7.2 1.7.3 All 36 releases
vikbooking / admin / views / cronexec / view.html.php

view.html.php in VikBooking Hotel Booking Engine & PMS trunk, at admin/views/cronexec/view.html.php

60 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * @package VikBooking
4 * @subpackage com_vikbooking
5 * @author Alessio Gaggii - e4j - Extensionsforjoomla.com
6 * @copyright Copyright (C) 2018 e4j - Extensionsforjoomla.com. All rights reserved.
7 * @license GNU General Public License version 2 or later; see LICENSE
8 * @link https://vikwp.com
9 */
10
11 defined('ABSPATH') or die('No script kiddies please!');
12
13 // import Joomla view library
14 jimport('joomla.application.component.view');
15
16 class VikBookingViewCronexec extends JViewVikBooking
17 {
18 function display($tpl = null)
19 {
20 // This view is usually called within a modal box, so it does not require the toolbar or page title
21
22 $app = JFactory::getApplication();
23
24 $id_cron = $app->input->getUint('cron_id', 0);
25 $key = $app->input->getString('cronkey', '');
26
27 $this->cronModel = VBOMvcModel::getInstance('cronjob');
28
29 $this->cron = $this->cronModel->getItem($id_cron);
30
31 // Dispatch the cron job by injecting the cron key within the
32 // configuration array, in order to make sure that the execution
33 // of the job has been requested by a reliable caller.
34 // Enable the debug mode to catch the output buffering and disable
35 // the strict model to allow the execution of unpublished jobs.
36 $this->response = $this->cronModel->dispatch($id_cron, [
37 'key' => $key,
38 'debug' => true,
39 'strict' => false,
40 ]);
41
42 if ($this->response === false)
43 {
44 // an error has occurred
45 $error = $this->cronModel->getError();
46
47 if (!$error instanceof Exception)
48 {
49 // wrap error message in an exception for a better ease of use
50 $error = new Exception($error ?: 'Error', 500);
51 }
52
53 // terminate session with an error
54 VBOHttpDocument::getInstance($app)->close($error->getCode(), $error->getMessage());
55 }
56
57 parent::display();
58 }
59 }
60