piler/webui/controller/health/health.php

47 lines
1.0 KiB
PHP
Raw Normal View History

2012-02-08 23:14:28 +01:00
<?php
class ControllerHealthHealth extends Controller {
public function index(){
$this->id = "content";
$this->template = "health/health.tpl";
if(EXTERNAL_DASHBOARD_URL) {
$this->layout = "common/layout-empty";
}
else {
$this->layout = "common/layout";
}
2012-02-08 23:14:28 +01:00
2012-04-27 14:39:10 +02:00
$this->load->model('health/health');
2012-02-08 23:14:28 +01:00
$request = Registry::get('request');
$language = Registry::get('language');
$this->document->title = $language->get('text_health_monitor');
/* check if we are admin */
if(Registry::get('admin_user') != 1 && Registry::get('readonly_admin') != 1) {
2012-02-08 23:14:28 +01:00
$this->template = "common/error.tpl";
$this->data['errorstring'] = $this->data['text_you_are_not_admin'];
}
2012-04-27 14:39:10 +02:00
else {
if(isset($_GET['toggle_enable_purge'])) {
$this->model_health_health->toggle_option('enable_purge');
header("Location: " . HEALTH_URL);
exit;
}
}
2012-02-08 23:14:28 +01:00
$this->render();
}
}
?>