Added the session_action field, so admin can watch what users are working on. Just your basic big brother stuff ...

This commit is contained in:
jengo 2001-02-10 15:14:14 +00:00
parent 57e2b9408c
commit d5e4f4b587
11 changed files with 48 additions and 10 deletions

View File

@ -40,6 +40,8 @@
"currentusers.php",lang("IP")));
$phpgw->template->set_var("sort_login_time",$phpgw->nextmatchs->show_sort_order($sort,"session_logintime",$order,
"currentusers.php",lang("Login Time")));
$phpgw->template->set_var("sort_action",$phpgw->nextmatchs->show_sort_order($sort,"session_action",$order,
"currentusers.php",lang("Action")));
$phpgw->template->set_var("sort_idle",$phpgw->nextmatchs->show_sort_order($sort,"session_dla",$order,
"currentusers.php",lang("idle")));
$phpgw->template->set_var("lang_kill",lang("Kill"));
@ -67,6 +69,7 @@
$phpgw->template->set_var("row_loginid",$loginid);
$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_action",$phpgw->strip_html($phpgw->db->f("session_action")));
$phpgw->template->set_var("row_idle",gmdate("G:i:s",(time() - $phpgw->db->f("session_dla"))));
if ($phpgw->db->f("session_id") != $phpgw_info["user"]["sessionid"]) {

View File

@ -1,7 +1,7 @@
<!-- BEGIN list -->
<center>
{lang_current_users}:
<table border="0" width="50%">
<table border="0" width="95%">
<tr bgcolor="{bg_color}">
{left_next_matchs}
<td>&nbsp;</td>
@ -12,6 +12,7 @@
<td>{sort_loginid}</td>
<td>{sort_ip}</td>
<td>{sort_login_time}</td>
<td>{sort_action}</td>
<td>{sort_idle}</td>
<td>{lang_kill}</td>
</tr>

View File

@ -4,6 +4,7 @@
<td>{row_loginid}</td>
<td>{row_ip}</td>
<td>{row_logintime}</td>
<td>{row_action}</td>
<td>{row_idle}</td>
<td>{row_kill}</td>
</tr>

View File

@ -1,7 +1,7 @@
<!-- BEGIN list -->
<center>
{lang_current_users}:
<table border="0" width="50%">
<table border="0" width="95%">
<tr bgcolor="{bg_color}">
{left_next_matchs}
<td>&nbsp;</td>
@ -12,6 +12,7 @@
<td>{sort_loginid}</td>
<td>{sort_ip}</td>
<td>{sort_login_time}</td>
<td>{sort_action}</td>
<td>{sort_idle}</td>
<td>{lang_kill}</td>
</tr>

View File

@ -4,6 +4,7 @@
<td>{row_loginid}</td>
<td>{row_ip}</td>
<td>{row_logintime}</td>
<td>{row_action}</td>
<td>{row_idle}</td>
<td>{row_kill}</td>
</tr>

View File

@ -238,10 +238,10 @@
// This will update the DateLastActive column, so the login does not expire
function update_dla()
{
global $phpgw_info, $phpgw;
global $phpgw_info, $phpgw, $PHP_SELF;
$phpgw->db->query("update phpgw_sessions set session_dla='" . time() . "' where session_id='"
. $this->sessionid."'",__LINE__,__FILE__);
$phpgw->db->query("update phpgw_sessions set session_dla='" . time() . "', session_action='$PHP_SELF'"
. " where session_id='" . $this->sessionid."'",__LINE__,__FILE__);
}
function destroy()

View File

@ -65,7 +65,7 @@
session_ip varchar(255),
session_logintime int(11),
session_dla int(11),
session_info text,
session_action varchar(255),
UNIQUE sessionid (session_id)
)";
$phpgw_setup->db->query($sql);
@ -298,7 +298,7 @@
);";
$phpgw_setup->db->query($sql);
$phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.10pre8";
$phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.10pre9";
$phpgw_info["setup"]["oldver"]["phpgwapi"] = $phpgw_info["setup"]["currentver"]["phpgwapi"];
update_version_table();
// $phpgw_setup->update_version_table();

View File

@ -980,6 +980,16 @@
$phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.10pre8";
}
$test[] = "0.9.10pre8";
function upgrade0_9_10pre8()
{
global $phpgw_info, $phpgw_setup;
$phpgw_setup->db->query("alter table phpgw_sessions change session_info session_action varchar(255)",__LINE__,__FILE__);
$phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.10pre9";
}
reset ($test);
while (list ($key, $value) = each ($test)){
if ($phpgw_info["setup"]["currentver"]["phpgwapi"] == $value) {

View File

@ -64,7 +64,7 @@
session_ip varchar(255),
session_logintime int,
session_dla int,
session_info text,
session_action varchar(255),
unique(session_id)
)";
$phpgw_setup->db->query($sql);
@ -271,7 +271,7 @@
);";
$phpgw_setup->db->query($sql);
$phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.9";
$phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.10pre9";
$phpgw_info["setup"]["oldver"]["phpgwapi"] = $phpgw_info["setup"]["currentver"]["phpgwapi"];
update_version_table();
?>

View File

@ -1034,6 +1034,27 @@
$phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.10pre8";
}
$test[] = "0.9.10pre8";
function upgrade0_9_10pre8()
{
global $phpgw_info, $phpgw_setup;
// Just temp data anyway
$phpgw_setup->db->query("drop table phpgw_sessions",__LINE__,__FILE__);
$sql = "create table phpgw_sessions (
session_id varchar(255),
session_lid varchar(255),
session_ip varchar(255),
session_logintime int,
session_dla int,
session_action varchar(255),
unique(session_id)
)";
$phpgw_setup->db->query($sql);
$phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.10pre9";
}
reset ($test);
while (list ($key, $value) = each ($test)){
if ($phpgw_info["setup"]["currentver"]["phpgwapi"] == $value) {

View File

@ -11,5 +11,5 @@
/* $Id$ */
$phpgw_info["server"]["versions"]["phpgwapi"] = "0.9.10pre8";
$phpgw_info["server"]["versions"]["phpgwapi"] = "0.9.10pre9";
$phpgw_info["server"]["versions"]["current_header"] = "1.11";