mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 06:30:59 +01:00
- Added banners
- Re-added the file I just deleted on mistake (currentusers.php) - accesslog.php is no longer needed
This commit is contained in:
parent
68577e4d12
commit
9b6cc18eb8
@ -1,119 +0,0 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* phpGroupWare - administration *
|
||||
* http://www.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$ */
|
||||
|
||||
$phpgw_info['flags'] = array(
|
||||
'currentapp' => 'admin',
|
||||
'enable_nextmatchs_class' => True
|
||||
);
|
||||
include('../header.inc.php');
|
||||
|
||||
$phpgw->template->set_file(array(
|
||||
'accesslog' => 'accesslog.tpl',
|
||||
));
|
||||
$phpgw->template->set_block('accesslog','list','list');
|
||||
$phpgw->template->set_block('accesslog','row','row');
|
||||
|
||||
$show_maxlog = 30;
|
||||
|
||||
$phpgw->template->set_var('th_bg',$phpgw_info['theme']['th_bg']);
|
||||
$phpgw->template->set_var('lang_last_x_logins',lang('Last x logins',$show_maxlog));
|
||||
|
||||
$phpgw->template->set_var('lang_loginid',lang('LoginID'));
|
||||
$phpgw->template->set_var('lang_ip',lang('IP'));
|
||||
$phpgw->template->set_var('lang_login',lang('Login'));
|
||||
$phpgw->template->set_var('lang_logout',lang('Logout'));
|
||||
$phpgw->template->set_var('lang_total',lang('Total'));
|
||||
|
||||
$phpgw->db->query("select loginid,ip,li,lo from phpgw_access_log order by li desc "
|
||||
. "limit $show_maxlog");
|
||||
while ($phpgw->db->next_record())
|
||||
{
|
||||
$tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
|
||||
$phpgw->template->set_var('tr_color',$tr_color);
|
||||
|
||||
if ($phpgw->db->f('li') && $phpgw->db->f('lo'))
|
||||
{
|
||||
$total = ($phpgw->db->f('lo') - $phpgw->db->f('li'));
|
||||
if ($total > 86400 && $total > 172800)
|
||||
{
|
||||
$total = gmdate('z \d\a\y\s - G:i:s',$total);
|
||||
}
|
||||
else if ($total > 172800)
|
||||
{
|
||||
$total = gmdate('z \d\a\y - G:i:s',$total);
|
||||
}
|
||||
else
|
||||
{
|
||||
$total = gmdate('G:i:s',$total);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$total = ' ';
|
||||
}
|
||||
|
||||
if ($phpgw->db->f('li'))
|
||||
{
|
||||
$li = $phpgw->common->show_date($phpgw->db->f('li'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$li = ' ';
|
||||
}
|
||||
|
||||
if ($phpgw->db->f('lo') != '')
|
||||
{
|
||||
$lo = $phpgw->common->show_date($phpgw->db->f('lo'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$lo = ' ';
|
||||
}
|
||||
|
||||
if (ereg('@',$phpgw->db->f('loginid')))
|
||||
{
|
||||
$t = split('@',$phpgw->db->f('loginid'));
|
||||
$loginid = $t[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
$loginid = $phpgw->db->f('loginid');
|
||||
}
|
||||
|
||||
$phpgw->template->set_var('row_loginid',$loginid);
|
||||
$phpgw->template->set_var('row_ip',$phpgw->db->f('ip'));
|
||||
$phpgw->template->set_var('row_li',$li);
|
||||
$phpgw->template->set_var('row_lo',$lo);
|
||||
$phpgw->template->set_var('row_total',$total);
|
||||
|
||||
$phpgw->template->parse('rows','row',True);
|
||||
}
|
||||
|
||||
$phpgw->db->query("select count(*) from phpgw_access_log");
|
||||
$phpgw->db->next_record();
|
||||
$total = $phpgw->db->f(0);
|
||||
|
||||
$phpgw->db->query("select count(*) from phpgw_access_log where lo!=''");
|
||||
$phpgw->db->next_record();
|
||||
$loggedout = $phpgw->db->f(0);
|
||||
|
||||
$percent = round((10000 * ($loggedout / $total)) / 100);
|
||||
|
||||
$phpgw->template->set_var('bg_color',$phpgw_info['themes']['bg_color']);
|
||||
$phpgw->template->set_var('footer_total',lang('Total records') . ': ' . $total);
|
||||
$phpgw->template->set_var('lang_percent',lang('Percent of users that logged out') . ': ' . $percent . '%');
|
||||
|
||||
$phpgw->template->pparse('out','list');
|
||||
|
||||
$phpgw->common->phpgw_footer();
|
||||
?>
|
108
admin/currentusers.php
Executable file
108
admin/currentusers.php
Executable file
@ -0,0 +1,108 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* phpGroupWare - administration *
|
||||
* http://www.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$ */
|
||||
|
||||
$phpgw_info['flags'] = array(
|
||||
'currentapp' => 'admin',
|
||||
'enable_nextmatchs_class' => True
|
||||
);
|
||||
include('../header.inc.php');
|
||||
|
||||
$p = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
|
||||
$p->set_file(array('current' => 'currentusers.tpl'));
|
||||
$p->set_block('current','list','list');
|
||||
$p->set_block('current','row','row');
|
||||
|
||||
if (! $start)
|
||||
{
|
||||
$start = 0;
|
||||
}
|
||||
|
||||
$phpgw->db->query("select count(*) from phpgw_sessions where session_flags != 'A'",__LINE__,__FILE__);
|
||||
$phpgw->db->next_record();
|
||||
|
||||
$total = $phpgw->db->f(0);
|
||||
|
||||
$p->set_var('lang_current_users',lang('List of current users'));
|
||||
$p->set_var('bg_color',$phpgw_info['theme'][bg_color]);
|
||||
$p->set_var('left_next_matchs',$phpgw->nextmatchs->left('/admin/currentusers.php',$start,$total));
|
||||
$p->set_var('right_next_matchs',$phpgw->nextmatchs->right('/admin/currentusers.php',$start,$total));
|
||||
$p->set_var('th_bg',$phpgw_info['theme']['th_bg']);
|
||||
|
||||
$p->set_var('sort_loginid',$phpgw->nextmatchs->show_sort_order($sort,'session_lid',$order,
|
||||
'/admin/currentusers.php',lang('LoginID')));
|
||||
$p->set_var('sort_ip',$phpgw->nextmatchs->show_sort_order($sort,'session_ip',$order,
|
||||
'/admin/currentusers.php',lang('IP')));
|
||||
$p->set_var('sort_login_time',$phpgw->nextmatchs->show_sort_order($sort,'session_logintime',$order,
|
||||
'/admin/currentusers.php',lang('Login Time')));
|
||||
$p->set_var('sort_action',$phpgw->nextmatchs->show_sort_order($sort,'session_action',$order,
|
||||
'/admin/currentusers.php',lang('Action')));
|
||||
$p->set_var('sort_idle',$phpgw->nextmatchs->show_sort_order($sort,'session_dla',$order,
|
||||
'/admin/currentusers.php',lang('idle')));
|
||||
$p->set_var('lang_kill',lang('Kill'));
|
||||
|
||||
if ($order)
|
||||
{
|
||||
$ordermethod = "order by $order $sort";
|
||||
}
|
||||
else
|
||||
{
|
||||
$ordermethod = 'order by session_dla asc';
|
||||
}
|
||||
|
||||
$phpgw->db->limit_query("select * from phpgw_sessions where session_flags != 'A' $ordermethod ",$start,__LINE__,__FILE__);
|
||||
|
||||
$i = 0;
|
||||
while ($phpgw->db->next_record())
|
||||
{
|
||||
$tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
|
||||
$p->set_var('tr_color',$tr_color);
|
||||
|
||||
if (ereg('@',$phpgw->db->f('session_lid')))
|
||||
{
|
||||
$t = split('@',$phpgw->db->f('session_lid'));
|
||||
$loginid = $t[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
$loginid = $phpgw->db->f('session_lid');
|
||||
}
|
||||
|
||||
$p->set_var('row_loginid',$loginid);
|
||||
$p->set_var('row_ip',$phpgw->db->f('session_ip'));
|
||||
$p->set_var('row_logintime',$phpgw->common->show_date($phpgw->db->f('session_logintime')));
|
||||
if($phpgw->db->f('session_action'))
|
||||
{
|
||||
$p->set_var('row_action',$phpgw->strip_html($phpgw->db->f('session_action')));
|
||||
}
|
||||
else
|
||||
{
|
||||
$p->set_var('row_action',' ');
|
||||
}
|
||||
$p->set_var('row_idle',gmdate('G:i:s',(time() - $phpgw->db->f('session_dla'))));
|
||||
|
||||
if ($phpgw->db->f('session_id') != $phpgw_info['user']['sessionid'])
|
||||
{
|
||||
$p->set_var('row_kill','<a href="' . $phpgw->link('/admin/killsession.php','ksession='
|
||||
. $phpgw->db->f('session_id') . '&kill=true') . '">' . lang('Kill').'</a>');
|
||||
}
|
||||
else
|
||||
{
|
||||
$p->set_var('row_kill',' ');
|
||||
}
|
||||
|
||||
$p->parse('rows','row',True);
|
||||
}
|
||||
|
||||
$p->pparse('out','list');
|
||||
$phpgw->common->phpgw_footer();
|
||||
?>
|
@ -1,4 +1,15 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* phpGroupWare - Administration *
|
||||
* http://www.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 boaccess_history
|
||||
{
|
||||
|
@ -1,4 +1,15 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* phpGroupWare - Administration *
|
||||
* http://www.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 soaccess_history
|
||||
{
|
||||
|
@ -1,4 +1,15 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* phpGroupWare - Administration *
|
||||
* http://www.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 uiaccess_history
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user