mirror of
https://bitbucket.org/jsuto/piler.git
synced 2025-06-12 23:17:02 +02:00
added the webui to the tarball
This commit is contained in:
45
webui/controller/stat/chart.php
Normal file
45
webui/controller/stat/chart.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
|
||||
class ControllerStatChart extends Controller {
|
||||
private $error = array();
|
||||
|
||||
public function index(){
|
||||
|
||||
$request = Registry::get('request');
|
||||
$db = Registry::get('db');
|
||||
$db_history = Registry::get('db_history');
|
||||
|
||||
$this->load->model('user/user');
|
||||
|
||||
$this->load->model('stat/chart');
|
||||
|
||||
$this->load->helper('libchart/classes/libchart');
|
||||
|
||||
$this->data['username'] = Registry::get('username');
|
||||
|
||||
$timespan = @$this->request->get['timespan'];
|
||||
|
||||
$db->select_db($db->database);
|
||||
|
||||
$emails = "";
|
||||
|
||||
/* let the admin users see the whole statistics */
|
||||
|
||||
if(Registry::get('admin_user') == 0 && Registry::get('readonly_admin') == 0) {
|
||||
$uid = $this->model_user_user->getUidByName($this->data['username']);
|
||||
$emails = "AND rcpt IN ('" . preg_replace("/\n/", "','", $this->model_user_user->getEmailsByUid((int)$uid)) . "')";
|
||||
}
|
||||
else if(isset($this->request->get['uid']) && is_numeric($this->request->get['uid']) && $this->request->get['uid'] > 0){
|
||||
$emails = "AND rcpt IN ('" . preg_replace("/\n/", "','", $this->model_user_user->getEmailsByUid((int)$this->request->get['uid'])) . "')";
|
||||
}
|
||||
|
||||
$aa = new ModelStatChart();
|
||||
$aa->pieChartHamSpam($emails, $timespan, $this->data['text_ham_and_spam_messages'], "");
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
51
webui/controller/stat/counter.php
Normal file
51
webui/controller/stat/counter.php
Normal file
@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
|
||||
class ControllerStatCounter extends Controller {
|
||||
private $error = array();
|
||||
|
||||
public function index(){
|
||||
|
||||
$this->id = "content";
|
||||
$this->template = "stat/counter.tpl";
|
||||
$this->layout = "common/layout";
|
||||
|
||||
|
||||
$request = Registry::get('request');
|
||||
|
||||
$db = Registry::get('db');
|
||||
$db->select_db($db->database);
|
||||
|
||||
$this->load->model('stat/counter');
|
||||
|
||||
$this->document->title = $this->data['text_counters'];
|
||||
|
||||
|
||||
if(Registry::get('admin_user') == 1) {
|
||||
|
||||
if($this->request->server['REQUEST_METHOD'] == 'POST' && @$this->request->post['reset'] == 1) {
|
||||
$this->model_stat_counter->resetCounters();
|
||||
header("Location: index.php?route=stat/counter");
|
||||
exit;
|
||||
}
|
||||
|
||||
$this->data['counters'] = $this->model_stat_counter->getCounters();
|
||||
|
||||
$this->data['prefix'] = '';
|
||||
|
||||
if(isset($this->data['counters']['_c:rcvd'])) { $this->data['prefix'] = '_c:'; }
|
||||
|
||||
}
|
||||
else {
|
||||
$this->template = "common/error.tpl";
|
||||
$this->data['errorstring'] = $this->data['text_you_are_not_admin'];
|
||||
}
|
||||
|
||||
|
||||
$this->render();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
47
webui/controller/stat/graph.php
Normal file
47
webui/controller/stat/graph.php
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
|
||||
class ControllerStatGraph extends Controller {
|
||||
private $error = array();
|
||||
|
||||
public function index(){
|
||||
|
||||
$request = Registry::get('request');
|
||||
$db = Registry::get('db');
|
||||
$db_history = Registry::get('db_history');
|
||||
|
||||
$this->load->model('user/user');
|
||||
|
||||
|
||||
$this->load->model('stat/chart');
|
||||
|
||||
$this->load->helper('libchart/classes/libchart');
|
||||
|
||||
$this->data['username'] = Registry::get('username');
|
||||
|
||||
$timespan = @$this->request->get['timespan'];
|
||||
|
||||
$db->select_db($db->database);
|
||||
|
||||
$emails = "";
|
||||
|
||||
/* let the admin users see the whole statistics */
|
||||
|
||||
if(Registry::get('admin_user') == 0 && Registry::get('readonly_admin') == 0) {
|
||||
$uid = $this->model_user_user->getUidByName($this->data['username']);
|
||||
$emails = "AND rcpt IN ('" . preg_replace("/\n/", "','", $this->model_user_user->getEmailsByUid((int)$uid)) . "')";
|
||||
}
|
||||
else if(isset($this->request->get['uid']) && is_numeric($this->request->get['uid']) && $this->request->get['uid'] > 0){
|
||||
$emails = "AND rcpt IN ('" . preg_replace("/\n/", "','", $this->model_user_user->getEmailsByUid((int)$this->request->get['uid'])) . "')";
|
||||
}
|
||||
|
||||
|
||||
$aa = new ModelStatChart();
|
||||
|
||||
$aa->lineChartHamSpam($emails, $timespan, $this->data['text_archived_messages'], SIZE_X, SIZE_Y, "");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
33
webui/controller/stat/stat.php
Normal file
33
webui/controller/stat/stat.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
|
||||
class ControllerStatStat extends Controller {
|
||||
private $error = array();
|
||||
|
||||
public function index(){
|
||||
|
||||
$this->id = "content";
|
||||
$this->template = "stat/stat.tpl";
|
||||
$this->layout = "common/layout";
|
||||
|
||||
|
||||
$request = Registry::get('request');
|
||||
$db = Registry::get('db');
|
||||
|
||||
$this->load->model('user/user');
|
||||
|
||||
$this->document->title = $this->data['text_statistics'];
|
||||
|
||||
$this->data['timespan'] = @$this->request->get['timespan'];
|
||||
$this->data['uid'] = @$this->request->get['uid'];
|
||||
|
||||
$this->data['admin_user'] = Registry::get('admin_user');
|
||||
$this->data['readonly_admin'] = Registry::get('readonly_admin');
|
||||
|
||||
$this->render();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
Reference in New Issue
Block a user