74 lines
2.5 KiB
PHP
74 lines
2.5 KiB
PHP
<?php
|
|
|
|
class Default_ServicesController extends Zend_Controller_Action
|
|
{
|
|
|
|
protected $_configs;
|
|
protected $_ipManager;
|
|
|
|
protected $_genericModel;
|
|
|
|
public function init()
|
|
{
|
|
|
|
$this->_helper->getHelper('layout')->disableLayout();
|
|
|
|
$this->_configs = new App_Service_ConfigManager();
|
|
$this->_ipManager = new App_Service_IpManager();
|
|
$this->_genericModel = new Application_Model_Generic();
|
|
}
|
|
|
|
public function preDispatch()
|
|
{
|
|
$action = $this->getRequest()->getActionName();
|
|
if ($this->_configs->get('interrutore_services') == 'off' && $action != 'offline') {
|
|
$this->_helper->redirector('offline', 'services');
|
|
}
|
|
}
|
|
|
|
public function postDispatch()
|
|
{
|
|
|
|
}
|
|
|
|
public function offlineAction()
|
|
{
|
|
$this->_helper->viewRenderer->setNoRender();
|
|
echo 'I servizi sono al momento disabilitati.';
|
|
}
|
|
|
|
public function indexAction()
|
|
{
|
|
$this->_helper->redirector('index', 'index');
|
|
}
|
|
|
|
/**
|
|
* =====================================================================================================================
|
|
* ================ SERVIZI ================================================
|
|
* =====================================================================================================================
|
|
*/
|
|
|
|
/**
|
|
* =====================================================================================================================
|
|
* ========= FUNZIONI CRON DEL CPANEL ===================================================
|
|
* =====================================================================================================================
|
|
*/
|
|
|
|
/**
|
|
* =====================================================================================================================
|
|
* ========= FUNZIONI PRIVATE DEL CONTROLLER ===========================================
|
|
* =====================================================================================================================
|
|
*/
|
|
|
|
private function _errorToLog($e, $message)
|
|
{
|
|
Zend_Registry::get('error_log')->setEventItem('url', $this->getRequest()->getRequestUri())
|
|
->setEventItem('trace', Zend_Json::encode($e->getTrace()))
|
|
->setEventItem('params', Zend_Json::encode([]))
|
|
->setEventItem('section', 'services')
|
|
->info($message);
|
|
}
|
|
|
|
}
|
|
|