2000-08-18 05:24:22 +02:00
|
|
|
<?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$ */
|
|
|
|
|
2000-11-16 09:00:18 +01:00
|
|
|
$phpgw_info["flags"] = array("currentapp" => "admin", "enable_nextmatchs_class" => True);
|
2000-08-18 05:24:22 +02:00
|
|
|
include("../header.inc.php");
|
2000-08-19 08:17:20 +02:00
|
|
|
|
2000-11-08 00:50:02 +01:00
|
|
|
$phpgw->template->set_file(array("header" => "currentusers.tpl",
|
|
|
|
"row" => "currentusers.tpl",
|
|
|
|
"footer" => "currentusers.tpl"));
|
2000-08-22 02:58:29 +02:00
|
|
|
|
2000-11-07 21:37:02 +01:00
|
|
|
$phpgw->template->set_block("header","row","footer","output");
|
2000-08-22 02:58:29 +02:00
|
|
|
|
2000-11-08 00:50:02 +01:00
|
|
|
if (! $start) {
|
2000-08-18 05:24:22 +02:00
|
|
|
$start = 0;
|
2000-11-08 00:50:02 +01:00
|
|
|
}
|
2000-08-18 05:24:22 +02:00
|
|
|
|
2000-08-19 08:17:20 +02:00
|
|
|
$limit = $phpgw->nextmatchs->sql_limit($start);
|
2000-11-08 00:50:02 +01:00
|
|
|
$phpgw->db->query("select count(*) from sessions",__LINE__,__FILE__);
|
2000-08-18 05:24:22 +02:00
|
|
|
$phpgw->db->next_record();
|
|
|
|
|
2000-11-07 21:37:02 +01:00
|
|
|
$phpgw->templateotal = $phpgw->db->f(0);
|
2000-08-18 05:24:22 +02:00
|
|
|
$limit = $phpgw->nextmatchs->sql_limit($start);
|
|
|
|
|
2000-11-07 21:37:02 +01:00
|
|
|
$phpgw->template->set_var("lang_current_users",lang("List of current users"));
|
|
|
|
$phpgw->template->set_var("bg_color",$phpgw_info["theme"][bg_color]);
|
|
|
|
$phpgw->template->set_var("left_next_matchs",$phpgw->nextmatchs->left("currentusers.php",$start,$phpgw->templateotal));
|
|
|
|
$phpgw->template->set_var("right_next_matchs",$phpgw->nextmatchs->right("currentusers.php",$start,$phpgw->templateotal));
|
|
|
|
$phpgw->template->set_var("th_bg",$phpgw_info["theme"]["th_bg"]);
|
2000-08-22 02:58:29 +02:00
|
|
|
|
2000-11-07 21:37:02 +01:00
|
|
|
$phpgw->template->set_var("sort_loginid",$phpgw->nextmatchs->show_sort_order($sort,"session_lid",$order,
|
2000-11-08 00:50:02 +01:00
|
|
|
"currentusers.php",lang("LoginID")));
|
2000-11-07 21:37:02 +01:00
|
|
|
$phpgw->template->set_var("sort_ip",$phpgw->nextmatchs->show_sort_order($sort,"session_ip",$order,
|
2000-11-08 00:50:02 +01:00
|
|
|
"currentusers.php",lang("IP")));
|
2000-11-07 21:37:02 +01:00
|
|
|
$phpgw->template->set_var("sort_login_time",$phpgw->nextmatchs->show_sort_order($sort,"session_logintime",$order,
|
2000-11-08 00:50:02 +01:00
|
|
|
"currentusers.php",lang("Login Time")));
|
2000-11-07 21:37:02 +01:00
|
|
|
$phpgw->template->set_var("sort_idle",$phpgw->nextmatchs->show_sort_order($sort,"session_dla",$order,
|
2000-11-08 00:50:02 +01:00
|
|
|
"currentusers.php",lang("idle")));
|
2000-11-07 21:37:02 +01:00
|
|
|
$phpgw->template->set_var("lang_kill",lang("Kill"));
|
2000-08-22 02:58:29 +02:00
|
|
|
|
2000-11-07 21:37:02 +01:00
|
|
|
$phpgw->template->parse("out","header");
|
2000-08-22 02:58:29 +02:00
|
|
|
|
2000-08-18 05:24:22 +02:00
|
|
|
|
2000-08-22 02:58:29 +02:00
|
|
|
if ($order) {
|
|
|
|
$ordermethod = "order by $order $sort";
|
|
|
|
} else {
|
2000-09-28 07:06:27 +02:00
|
|
|
$ordermethod = "order by session_dla asc";
|
2000-08-22 02:58:29 +02:00
|
|
|
}
|
|
|
|
|
2000-11-08 00:50:02 +01:00
|
|
|
$phpgw->db->query("select * from sessions $ordermethod limit $limit",__LINE__,__FILE__);
|
2000-08-22 02:58:29 +02:00
|
|
|
|
2000-09-28 07:06:27 +02:00
|
|
|
$i = 0;
|
2000-08-22 02:58:29 +02:00
|
|
|
while ($phpgw->db->next_record()) {
|
2000-11-07 21:37:02 +01:00
|
|
|
$phpgw->templater_color = $phpgw->nextmatchs->alternate_row_color($phpgw->templater_color);
|
|
|
|
$phpgw->template->set_var("tr_color",$phpgw->templater_color);
|
2000-08-22 02:58:29 +02:00
|
|
|
|
2000-11-07 21:37:02 +01:00
|
|
|
$phpgw->template->set_var("row_loginid",$phpgw->db->f("session_lid"));
|
|
|
|
$phpgw->template->set_var("row_ip",$phpgw->db->f("session_ip"));
|
|
|
|
$phpgw->template->set_var("row_logintime",$phpgw->common->show_date($phpgw->db->f("session_logintime")));
|
|
|
|
$phpgw->template->set_var("row_idle",gmdate("G:i:s",(time() - $phpgw->db->f("session_dla"))));
|
2000-08-18 05:24:22 +02:00
|
|
|
|
2000-09-28 07:06:27 +02:00
|
|
|
if ($phpgw->db->f("session_id") != $phpgw_info["user"]["sessionid"]) {
|
2000-11-07 21:37:02 +01:00
|
|
|
$phpgw->template->set_var("row_kill",'<a href="' . $phpgw->link("killsession.php","ksession="
|
2000-11-08 00:50:02 +01:00
|
|
|
. $phpgw->db->f("session_id") . "&kill=true\">" . lang("Kill")).'</a>');
|
2000-08-22 02:58:29 +02:00
|
|
|
} else {
|
2000-11-08 00:50:02 +01:00
|
|
|
$phpgw->template->set_var("row_kill"," ");
|
2000-08-22 02:58:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if ($phpgw->db->num_rows() == 1) {
|
2000-11-07 21:37:02 +01:00
|
|
|
$phpgw->template->set_var("output","");
|
2000-08-22 02:58:29 +02:00
|
|
|
}
|
|
|
|
if ($phpgw->db->num_rows() != ++$i) {
|
2000-11-07 21:37:02 +01:00
|
|
|
$phpgw->template->parse("output","row",True);
|
2000-08-22 02:58:29 +02:00
|
|
|
}
|
2000-08-18 05:24:22 +02:00
|
|
|
}
|
|
|
|
|
2000-11-07 21:37:02 +01:00
|
|
|
$phpgw->template->pparse("out","footer");
|
2000-09-29 07:24:18 +02:00
|
|
|
$phpgw->common->phpgw_footer();
|
2000-11-08 00:50:02 +01:00
|
|
|
?>
|