forked from extern/egroupware
Converted current users to use templates
This commit is contained in:
parent
557054abf8
commit
b00f3a6928
@ -71,6 +71,9 @@
|
|||||||
$t->set_var("row_lo",$li);
|
$t->set_var("row_lo",$li);
|
||||||
$t->set_var("row_total",$total);
|
$t->set_var("row_total",$total);
|
||||||
|
|
||||||
|
if ($phpgw->db->num_rows() == 1) {
|
||||||
|
$t->set_var("output","");
|
||||||
|
}
|
||||||
if ($phpgw->db->num_rows() != ++$i) {
|
if ($phpgw->db->num_rows() != ++$i) {
|
||||||
$t->parse("output","row",True);
|
$t->parse("output","row",True);
|
||||||
}
|
}
|
||||||
|
@ -87,6 +87,9 @@
|
|||||||
$t->set_var("row_view",'<a href="' . $phpgw->link("viewaccount.php", "con="
|
$t->set_var("row_view",'<a href="' . $phpgw->link("viewaccount.php", "con="
|
||||||
. $phpgw->db->f("con")) . '"> ' . lang_common("View") . ' </a>');
|
. $phpgw->db->f("con")) . '"> ' . lang_common("View") . ' </a>');
|
||||||
|
|
||||||
|
if ($phpgw->db->num_rows() == 1) {
|
||||||
|
$t->set_var("output","");
|
||||||
|
}
|
||||||
if ($phpgw->db->num_rows() != ++$i) {
|
if ($phpgw->db->num_rows() != ++$i) {
|
||||||
$t->parse("output","row",True);
|
$t->parse("output","row",True);
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,13 @@
|
|||||||
$phpgw_flags["currentapp"] = "admin";
|
$phpgw_flags["currentapp"] = "admin";
|
||||||
include("../header.inc.php");
|
include("../header.inc.php");
|
||||||
|
|
||||||
|
$t = new Template($phpgw_info["server"]["template_dir"]);
|
||||||
|
$t->set_file(array( "header" => "currentusers.tpl",
|
||||||
|
"row" => "currentusers.tpl",
|
||||||
|
"footer" => "currentusers.tpl" ));
|
||||||
|
|
||||||
|
$t->set_block("header","row","footer","output");
|
||||||
|
|
||||||
if (! $start)
|
if (! $start)
|
||||||
$start = 0;
|
$start = 0;
|
||||||
|
|
||||||
@ -23,61 +30,59 @@
|
|||||||
|
|
||||||
$total = $phpgw->db->f(0);
|
$total = $phpgw->db->f(0);
|
||||||
$limit = $phpgw->nextmatchs->sql_limit($start);
|
$limit = $phpgw->nextmatchs->sql_limit($start);
|
||||||
?>
|
|
||||||
<center>
|
|
||||||
<?php echo lang_admin("List of current users"); ?>:
|
|
||||||
<table border="0" width="50%">
|
|
||||||
<tr bgcolor="<?php echo $phpgw_info["theme"][bg_color]; ?>">
|
|
||||||
<?php echo $phpgw->nextmatchs->left("currentusers.php",$start,$total);
|
|
||||||
?>
|
|
||||||
<td> </td>
|
|
||||||
<?php echo $phpgw->nextmatchs->right("currentusers.php",$start,$total);
|
|
||||||
?>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr bgcolor="<?php echo $phpgw_info["theme"][th_bg]; ?>">
|
$t->set_var("lang_current_users",lang_admin("List of current users"));
|
||||||
<?php // This will pass unneeded vars, not a big deal ?>
|
$t->set_var("bg_color",$phpgw_info["theme"][bg_color]);
|
||||||
<td><?php echo $phpgw->nextmatchs->show_sort_order($sort,"loginid",$order,"currentusers.php",
|
$t->set_var("left_next_matchs",$phpgw->nextmatchs->left("currentusers.php",$start,$total));
|
||||||
lang_admin("LoginID")); ?></td>
|
$t->set_var("right_next_matchs",$phpgw->nextmatchs->right("currentusers.php",$start,$total));
|
||||||
<td><?php echo $phpgw->nextmatchs->show_sort_order($sort,"ip",$order,"currentusers.php",
|
$t->set_var("th_bg",$phpgw_info["theme"]["th_bg"]);
|
||||||
lang_admin("IP")); ?></td>
|
|
||||||
<td><?php echo $phpgw->nextmatchs->show_sort_order($sort,"logintime",$order,"currentusers.php",
|
|
||||||
lang_admin("Login Time"));?></td>
|
|
||||||
<td><?php echo $phpgw->nextmatchs->show_sort_order($sort,"dla",$order,"currentusers.php",
|
|
||||||
lang_admin("idle")); ?></td>
|
|
||||||
<td><?php echo lang_admin("Kill"); ?></td>
|
|
||||||
</tr>
|
|
||||||
<?php
|
|
||||||
if ($order)
|
|
||||||
$ordermethod = "order by $order $sort";
|
|
||||||
else
|
|
||||||
$ordermethod = "order by dla asc";
|
|
||||||
|
|
||||||
$phpgw->db->query("select * from sessions $ordermethod limit $limit");
|
$t->set_var("sort_loginid",$phpgw->nextmatchs->show_sort_order($sort,"loginid",$order,
|
||||||
|
"currentusers.php",lang_admin("LoginID")));
|
||||||
|
$t->set_var("sort_ip",$phpgw->nextmatchs->show_sort_order($sort,"ip",$order,
|
||||||
|
"currentusers.php",lang_admin("IP")));
|
||||||
|
$t->set_var("sort_login_time",$phpgw->nextmatchs->show_sort_order($sort,"logintime",$order,
|
||||||
|
"currentusers.php",lang_admin("Login Time")));
|
||||||
|
$t->set_var("sort_idle",$phpgw->nextmatchs->show_sort_order($sort,"dla",$order,
|
||||||
|
"currentusers.php",lang_admin("idle")));
|
||||||
|
$t->set_var("lang_kill",lang_admin("Kill"));
|
||||||
|
|
||||||
while ($phpgw->db->next_record()) {
|
$t->parse("out","header");
|
||||||
|
|
||||||
|
|
||||||
|
if ($order) {
|
||||||
|
$ordermethod = "order by $order $sort";
|
||||||
|
} else {
|
||||||
|
$ordermethod = "order by dla asc";
|
||||||
|
}
|
||||||
|
|
||||||
|
$phpgw->db->query("select * from sessions $ordermethod limit $limit");
|
||||||
|
|
||||||
|
while ($phpgw->db->next_record()) {
|
||||||
$tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
|
$tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
|
||||||
|
$t->set_var("tr_color",$tr_color);
|
||||||
|
|
||||||
?>
|
$t->set_var("row_loginid",$phpgw->db->f("loginid"));
|
||||||
<tr bgcolor="<?php echo $tr_color; ?>">
|
$t->set_var("row_ip",$phpgw->db->f("ip"));
|
||||||
<td><?php echo $phpgw->db->f("loginid"); ?></td>
|
$t->set_var("row_logintime",$phpgw->preferences->show_date($phpgw->db->f("logintime")));
|
||||||
<td><?php echo $phpgw->db->f("ip"); ?></td>
|
$t->set_var("row_idle",gmdate("G:i:s",(time() - $phpgw->db->f("dla"))));
|
||||||
<td><?php echo $phpgw->preferences->show_date($phpgw->db->f("logintime")); ?></td>
|
|
||||||
<td><?php echo gmdate("G:i:s",(time() - $phpgw->db->f("dla")) ); ?></td>
|
if ($phpgw->db->f("sessionid") != $phpgw->session->id) {
|
||||||
<td><?php if ($phpgw->db->f("sessionid") != $phpgw->session->id) {
|
$t->set_var("row_kill",'<a href="' . $phpgw->link("killsession.php","ksession="
|
||||||
echo "<a href=\"" . $phpgw->link("killsession.php","ksession="
|
. $phpgw->db->f("sessionid") . "&kill=true\">" . lang_admin("Kill")).'</a>');
|
||||||
. $phpgw->db->f("sessionid") . "&kill=true\">"
|
} else {
|
||||||
. lang_admin("Kill"));
|
$t->set_var("row_kill"," ");
|
||||||
} else {
|
}
|
||||||
echo " ";
|
|
||||||
}
|
if ($phpgw->db->num_rows() == 1) {
|
||||||
?></a></td>
|
$t->set_var("output","");
|
||||||
</tr>
|
}
|
||||||
<?php
|
if ($phpgw->db->num_rows() != ++$i) {
|
||||||
|
$t->parse("output","row",True);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<?php
|
||||||
|
$t->pparse("out","footer");
|
||||||
|
include($phpgw_info["server"]["api_dir"] . "/footer.inc.php");
|
||||||
?>
|
?>
|
||||||
</center>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<?php include($phpgw_info["server"]["api_dir"] . "/footer.inc.php"); ?>
|
|
||||||
|
Loading…
Reference in New Issue
Block a user