mirror of
https://bitbucket.org/jsuto/piler.git
synced 2025-06-12 23:17:02 +02:00
added online users feature
This commit is contained in:
@ -18,6 +18,9 @@ class ControllerHealthWorker extends Controller {
|
||||
|
||||
$this->load->model('health/health');
|
||||
$this->load->model('stat/counter');
|
||||
if(ENABLE_SAAS == 1) {
|
||||
$this->load->model('saas/customer');
|
||||
}
|
||||
|
||||
$request = Registry::get('request');
|
||||
|
||||
@ -37,6 +40,9 @@ class ControllerHealthWorker extends Controller {
|
||||
$this->data['health'][] = $this->model_health_health->checksmtp($smtp, $lang->data['text_error']);
|
||||
}
|
||||
|
||||
if(ENABLE_SAAS == 1) {
|
||||
$this->data['num_of_online_users'] = $this->model_saas_customer->count_online();
|
||||
}
|
||||
|
||||
$this->data['processed_emails'] = $this->model_health_health->count_processed_emails();
|
||||
|
||||
|
@ -29,6 +29,7 @@ class ControllerLoginLogin extends Controller {
|
||||
|
||||
if(ENABLE_SAAS == 1) {
|
||||
$this->load->model('saas/ldap');
|
||||
$this->load->model('saas/customer');
|
||||
}
|
||||
|
||||
$this->document->title = $this->data['text_login'];
|
||||
@ -39,6 +40,10 @@ class ControllerLoginLogin extends Controller {
|
||||
|
||||
$this->model_user_prefs->get_user_preferences($_SESSION['username']);
|
||||
|
||||
if(ENABLE_SAAS == 1) {
|
||||
$this->model_saas_customer->online($_SESSION['username']);
|
||||
}
|
||||
|
||||
LOGGER('logged in');
|
||||
|
||||
if(isAdminUser() == 1) {
|
||||
|
@ -18,6 +18,11 @@ class ControllerLoginLogout extends Controller {
|
||||
|
||||
$this->document->title = $this->data['text_logout'];
|
||||
|
||||
if(ENABLE_SAAS == 1) {
|
||||
$this->load->model('saas/customer');
|
||||
$this->model_saas_customer->offline(Registry::get('username'));
|
||||
}
|
||||
|
||||
logout();
|
||||
|
||||
$this->render();
|
||||
|
33
webui/controller/stat/online.php
Normal file
33
webui/controller/stat/online.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
|
||||
class ControllerStatOnline extends Controller {
|
||||
private $error = array();
|
||||
|
||||
public function index(){
|
||||
|
||||
$this->id = "content";
|
||||
$this->template = "stat/online.tpl";
|
||||
$this->layout = "common/layout";
|
||||
|
||||
|
||||
$request = Registry::get('request');
|
||||
$db = Registry::get('db');
|
||||
|
||||
$this->load->model('saas/customer');
|
||||
|
||||
$this->document->title = $this->data['text_statistics'];
|
||||
|
||||
if(Registry::get('admin_user') == 0) {
|
||||
die("go away");
|
||||
}
|
||||
|
||||
$this->data['users'] = $this->model_saas_customer->get_online_users();
|
||||
|
||||
$this->render();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
Reference in New Issue
Block a user