2001-08-16 03:38:14 +02:00
|
|
|
<?php
|
|
|
|
/**************************************************************************\
|
|
|
|
* phpGroupWare - Administration *
|
|
|
|
* http://www.phpgroupware.org *
|
|
|
|
* This file written by Joseph Engo <jengo@phpgroupware.org> *
|
|
|
|
* -------------------------------------------- *
|
|
|
|
* This program is free software; you can redistribute it and/or modify it *
|
|
|
|
* under the terms of the GNU General Public License as published by the *
|
|
|
|
* Free Software Foundation; either version 2 of the License, or (at your *
|
|
|
|
* option) any later version. *
|
|
|
|
\**************************************************************************/
|
|
|
|
|
|
|
|
/* $Id$ */
|
|
|
|
|
|
|
|
class bocurrentsessions
|
|
|
|
{
|
2001-09-05 04:13:27 +02:00
|
|
|
var $ui;
|
2001-08-16 03:38:14 +02:00
|
|
|
var $so;
|
2001-09-05 04:13:27 +02:00
|
|
|
var $public_functions = array(
|
2001-12-21 04:41:06 +01:00
|
|
|
'kill' => True
|
|
|
|
);
|
2001-08-16 03:38:14 +02:00
|
|
|
|
|
|
|
function bocurrentsessions()
|
|
|
|
{
|
|
|
|
$this->so = CreateObject('admin.socurrentsessions');
|
|
|
|
}
|
|
|
|
|
|
|
|
function total()
|
|
|
|
{
|
|
|
|
return $this->so->total();
|
|
|
|
}
|
|
|
|
|
|
|
|
function list_sessions($start,$order,$sort)
|
|
|
|
{
|
|
|
|
$values = $this->so->list_sessions($start,$sort,$order);
|
|
|
|
|
2002-01-04 01:39:00 +01:00
|
|
|
while (list(,$value) = @each($values))
|
2001-08-16 03:38:14 +02:00
|
|
|
{
|
|
|
|
if (ereg('@',$value['session_lid']))
|
|
|
|
{
|
|
|
|
$t = split('@',$value['session_lid']);
|
|
|
|
$session_lid = $t[0];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$session_lid = $value['session_lid'];
|
|
|
|
}
|
|
|
|
|
|
|
|
$_values[] = array(
|
|
|
|
'session_id' => $value['session_id'],
|
|
|
|
'session_lid' => $session_lid,
|
|
|
|
'session_ip' => $value['session_ip'],
|
|
|
|
'session_logintime' => $GLOBALS['phpgw']->common->show_date($value['session_logintime']),
|
|
|
|
'session_action' => $value['session_action'],
|
|
|
|
'session_dla' => $value['session_dla'],
|
2002-10-14 16:26:03 +02:00
|
|
|
'session_idle' => gmdate('G:i:s',($GLOBALS['phpgw']->datetime->gmtnow - $value['session_dla']))
|
2001-08-16 03:38:14 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
return $_values;
|
|
|
|
}
|
|
|
|
|
2001-09-05 04:13:27 +02:00
|
|
|
function kill()
|
|
|
|
{
|
2001-09-29 00:04:10 +02:00
|
|
|
if ($GLOBALS['HTTP_GET_VARS']['ksession'] &&
|
|
|
|
($GLOBALS['sessionid'] != $GLOBALS['HTTP_GET_VARS']['ksession']) &&
|
|
|
|
! $GLOBALS['phpgw']->acl->check('current_sessions_access',8,'admin'))
|
2001-09-05 04:13:27 +02:00
|
|
|
{
|
2001-09-29 00:04:10 +02:00
|
|
|
$GLOBALS['phpgw']->session->destroy($GLOBALS['HTTP_GET_VARS']['ksession'],0);
|
2001-09-05 04:13:27 +02:00
|
|
|
}
|
|
|
|
$this->ui = createobject('admin.uicurrentsessions');
|
|
|
|
$this->ui->list_sessions();
|
|
|
|
}
|
2001-09-29 00:04:10 +02:00
|
|
|
}
|