updating number of current users via notifications

This commit is contained in:
Ralf Becker 2011-04-14 09:50:35 +00:00
parent 23c21cb372
commit 42bf4dbc3c
2 changed files with 14 additions and 7 deletions

View File

@ -52,7 +52,7 @@ class notifications_ajax {
/**
* reference to global db object
*
* @var db
* @var egw_db
*/
private $db;
@ -75,7 +75,7 @@ class notifications_ajax {
/**
* the xml response object
*
* @var response
* @var xajaxResponse
*/
private $response;
@ -87,8 +87,7 @@ class notifications_ajax {
$this->response = new xajaxResponse();
$this->recipient = (object)$GLOBALS['egw']->accounts->read();
$config = new config(self::_appname);
$this->config = (object)$config->read_repository();
$this->config = (object)config::read(self::_appname);
$prefs = new preferences($this->recipient->account_id);
$preferences = $prefs->read();
@ -113,6 +112,14 @@ class notifications_ajax {
*/
public function get_notifications() {
if ($GLOBALS['egw_info']['user']['apps']['felamimail']) $this->check_mailbox();
// update currentusers
if ($GLOBALS['egw_info']['user']['apps']['admin'] &&
$GLOBALS['egw_info']['user']['preferences']['common']['show_currentusers'])
{
$this->response->assign('currentusers', 'innerText', $GLOBALS['egw']->session->session_count());
}
$this->get_egwpopup();
return $this->response->getXML();
@ -123,7 +130,7 @@ class notifications_ajax {
* After they've seen it, remove it from the database
*/
public function confirm_message($message) {
error_log( html_entity_decode($message));
//error_log( html_entity_decode($message));
$myval=$this->db->delete(self::_notification_table,array(
'account_id' => $this->recipient->account_id,
'message' => html_entity_decode($message)

View File

@ -440,7 +440,7 @@ abstract class egw_framework
if( $GLOBALS['egw_info']['user']['apps']['admin'] && $GLOBALS['egw_info']['user']['preferences']['common']['show_currentusers'])
{
$current_users = '<a href="' . egw::link('/index.php','menuaction=admin.admin_accesslog.sessions') . '">' .
lang('Current users') . ': ' . $GLOBALS['egw']->session->session_count() . '</a>';
lang('Current users') . ': <span id="currentusers">' . $GLOBALS['egw']->session->session_count() . '</span></a>';
return $current_users;
}
}