111 lines
4.5 KiB
Plaintext
111 lines
4.5 KiB
Plaintext
|
#!/usr/bin/perl
|
|||
|
# tta_sesscount.cgi
|
|||
|
# Display Services with Tarantella Sessions Counters
|
|||
|
# STTA Rev. 1.3 Copyright (c) 2001-2004 Jes<65>s P<>rez Lorenzo --- license GNU GPL
|
|||
|
# stta: (@#) 1.31051043346- [2004_01_29_102036]
|
|||
|
|
|||
|
require './stta-lib.pl';
|
|||
|
if ($access{'sessions'} ne 1 ) { &redirect("index.cgi"); }
|
|||
|
if ( $config{has_cronsess} ne "true" || $config{'countsessout_file'} eq "" ) {
|
|||
|
&headerstta($text{'index_ttasess_count'}, "", "ttasess_count",undef,1,0,"$text{'headpage_right'}"."$text{'head_logout'}",undef,undef,"$text{head_below}" );
|
|||
|
$err_msg=$text{'nohascountsess_err'};
|
|||
|
&footHere;
|
|||
|
exit;
|
|||
|
}
|
|||
|
|
|||
|
$ahora=&set_now();
|
|||
|
$ahora_str=set_datetime_str($ahora);
|
|||
|
$counter_time="";
|
|||
|
%h_countsess=&list_countsess();
|
|||
|
$counter_time_str=set_datetime_str($counter_time);
|
|||
|
$counter_times=get_datetime_str($counter_time_str);
|
|||
|
$limit=$config{sessout_timeout};
|
|||
|
|
|||
|
# Just in case reset to every hour as default !!
|
|||
|
if ($limit < 1 || $limit > 14 ) { $limit=10 };
|
|||
|
|
|||
|
if (substr($counter_time_str,0,$limit) ne substr($ahora_str,0,$limit) ) {
|
|||
|
&redirect("tta_sess.cgi?sort_on=user");
|
|||
|
}
|
|||
|
|
|||
|
# this is only to get date
|
|||
|
$temp_f=$config{'tta_sessout_file'};
|
|||
|
&load_tta_emulses("getdate");
|
|||
|
if ( "$counter_time" ne "$ttasess_time" ) {
|
|||
|
&redirect("tta_sess.cgi?sort_on=user");
|
|||
|
}
|
|||
|
|
|||
|
&headerstta($text{'index_ttasess_count'}, "", "ttasess_count",undef,1,0,"$text{'headpage_right'}"."$text{'head_logout'}",undef,undef,"$text{head_below}" );
|
|||
|
&ReadParse();
|
|||
|
|
|||
|
print "<table width=100% border>\n";
|
|||
|
print "<tr $tb> <td><font color='$revtext'><b>$text{'titidx_ttasess_count'} $ahora </b></td> </tr>\n";
|
|||
|
print "<TR><TD><B>$text{l_ses_count} $text{'user_update'} $counter_time </B></TD><TR>\n";
|
|||
|
# print "<TR><TD><B>$aho - $con</B></TD><TR>\n";
|
|||
|
# print "<TR><TD><B>$counter_times - $counter_time_str</B></TD><TR>\n";
|
|||
|
# print "<TR><TD><B>$counter_time_str $ahora_str </B></TD><TR>\n";
|
|||
|
# if ( $counter_time_str gt $ahora_str ) {
|
|||
|
# print "<TR><TD><B>No actualizado </B></TD><TR>\n";
|
|||
|
# }
|
|||
|
print "</td></tr>\n";
|
|||
|
if ( !%h_countsess) {
|
|||
|
$err_msg=$text{nosess_err};
|
|||
|
&footHere();
|
|||
|
exit;
|
|||
|
}
|
|||
|
print "<tr><td><table width=50%>\n";
|
|||
|
print "</b><TR $tb>\n";
|
|||
|
print "<TD><center><B>".$text{l_ses_object} . "</B></center></TD>\n";
|
|||
|
print "<TD><center><B>".$text{l_ses_num} . "</B></center></TD>\n";
|
|||
|
if ( $debug eq 2 ) {
|
|||
|
print "<TD><center><B> obj </B></center></TD>\n";
|
|||
|
print "<TD><center><B> objalias </B></center></TD>\n";
|
|||
|
print "<TD><center><B> alias </B></center></TD>\n";
|
|||
|
print "<TD><center><B> maxsess </B></center></TD>\n";
|
|||
|
print "<TD><center><B> objgrpalias </B></center></TD>\n";
|
|||
|
print "<TD><center><B> grpalias </B></center></TD>\n";
|
|||
|
print "<TD><center><B> name </B></center></TD>\n";
|
|||
|
}
|
|||
|
foreach $item (keys (%h_countsess)) {
|
|||
|
if ($item ne "TOTAL" && $item ne "" ) {
|
|||
|
$objdescrip=$h_countsess{$item}->{'descrip'};
|
|||
|
print "<TR $cb>\n";
|
|||
|
print "<TD><A class=\"menu1\" href=\"javascript: alert('".$h_countsess{$item}->{'name'};
|
|||
|
if ( $objdescrip ne $h_countsess{$item}->{'alias'} ) { print " (".$objdescrip.")"; }
|
|||
|
print "')\">";
|
|||
|
$objdescrip=~s/ou=//g;
|
|||
|
$objdescrip=~s/cn=//g;
|
|||
|
print $objdescrip;
|
|||
|
print "</A></TD>\n";
|
|||
|
print "<TD>" . $h_countsess{$item}->{'numsess'}."</TD>\n";
|
|||
|
if ( $debug eq 2 ) {
|
|||
|
print "<TD>" . $h_countsess{$item}->{'obj'}."</TD>\n";
|
|||
|
print "<TD>" . $h_countsess{$item}->{'objalias'}."</TD>\n";
|
|||
|
print "<TD>" . $h_countsess{$item}->{'alias'}."</TD>\n";
|
|||
|
print "<TD>" . $h_countsess{$item}->{'maxsess'}."</TD>\n";
|
|||
|
print "<TD>" . $h_countsess{$item}->{'objgrpalias'}."</TD>\n";
|
|||
|
print "<TD>" . $h_countsess{$item}->{'grpalias'}."</TD>\n";
|
|||
|
print "<TD>" . $h_countsess{$item}->{'name'}."</TD>\n";
|
|||
|
}
|
|||
|
print "<\TR>\n";
|
|||
|
}
|
|||
|
}
|
|||
|
print "<TR $cb>\n";
|
|||
|
print "<TD>".$h_countsess{"TOTAL"}->{'descrip'}."</A></TD>\n";
|
|||
|
print "<TD>" . $h_countsess{"TOTAL"}->{'numsess'}."</TD>\n";
|
|||
|
print "<\TR>\n";
|
|||
|
print "<p></table>\n";
|
|||
|
print "<p></table>\n";
|
|||
|
print "<tr>\n";
|
|||
|
print "<tr>\n";
|
|||
|
#if ( $config{has_cronsess} eq "true" && $config{'countsessout_file'} ne "" ) {
|
|||
|
# &write_countsess();
|
|||
|
# print "<tr><p><b>".$text{'msg_count_update'}.$appname."</b></tr>\n";
|
|||
|
#}
|
|||
|
print "<tr>\n";
|
|||
|
print "</table></table><p>\n";
|
|||
|
&footer($config{'back_return'},$text{'index'});
|
|||
|
print "<p><p><p>\n";
|
|||
|
do "footer.pl";
|
|||
|
exit;
|