started adding new admin console
This commit is contained in:
parent
802e917376
commit
c4fa16700d
17 changed files with 705 additions and 152 deletions
66
lib/WebGUI/Operation/ActiveSessions.pm
Normal file
66
lib/WebGUI/Operation/ActiveSessions.pm
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
package WebGUI::Operation::ActiveSessions;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001-2004 Plain Black Corporation.
|
||||
#-------------------------------------------------------------------
|
||||
# Please read the legal notices (docs/legal.txt) and the license
|
||||
# (docs/license.txt) that came with this distribution before using
|
||||
# this software.
|
||||
#-------------------------------------------------------------------
|
||||
# http://www.plainblack.com info@plainblack.com
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
use strict;
|
||||
use WebGUI::AdminConsole;
|
||||
use WebGUI::DateTime;
|
||||
use WebGUI::Grouping;
|
||||
use WebGUI::Icon;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Paginator;
|
||||
use WebGUI::Privilege;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::SQL;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_killSession {
|
||||
return WebGUI::Privilege::adminOnly() unless (WebGUI::Grouping::isInGroup(3));
|
||||
WebGUI::Session::end($session{form}{sid});
|
||||
return www_viewActiveSessions();
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_viewActiveSessions {
|
||||
return WebGUI::Privilege::adminOnly() unless (WebGUI::Grouping::isInGroup(3));
|
||||
my ($output, $p, @row, $i, $sth, %data);
|
||||
tie %data, 'Tie::CPHash';
|
||||
$sth = WebGUI::SQL->read("select users.username,users.userId,userSession.sessionId,userSession.expires,
|
||||
userSession.lastPageView,userSession.lastIP from users,userSession where users.userId=userSession.userId
|
||||
and users.userId<>1 order by users.username,userSession.lastPageView desc");
|
||||
while (%data = $sth->hash) {
|
||||
$row[$i] = '<tr class="tableData"><td>'.$data{username}.' ('.$data{userId}.')</td>';
|
||||
$row[$i] .= '<td>'.$data{sessionId}.'</td>';
|
||||
$row[$i] .= '<td>'.epochToHuman($data{expires}).'</td>';
|
||||
$row[$i] .= '<td>'.epochToHuman($data{lastPageView}).'</td>';
|
||||
$row[$i] .= '<td>'.$data{lastIP}.'</td>';
|
||||
$row[$i] .= '<td align="center">'.deleteIcon("op=killSession&sid=$data{sessionId}").'</td></tr>';
|
||||
$i++;
|
||||
}
|
||||
$sth->finish;
|
||||
$p = WebGUI::Paginator->new(WebGUI::URL::page('op=viewActiveSessions'));
|
||||
$p->setDataByArrayRef(\@row);
|
||||
$output .= '<table border=1 cellpadding=5 cellspacing=0 align="center">';
|
||||
$output .= '<tr class="tableHeader"><td>'.WebGUI::International::get(428).'</td>';
|
||||
$output .= '<td>'.WebGUI::International::get(435).'</td>';
|
||||
$output .= '<td>'.WebGUI::International::get(432).'</td>';
|
||||
$output .= '<td>'.WebGUI::International::get(430).'</td>';
|
||||
$output .= '<td>'.WebGUI::International::get(431).'</td>';
|
||||
$output .= '<td>'.WebGUI::International::get(436).'</td></tr>';
|
||||
$output .= $p->getPage($session{form}{pn});
|
||||
$output .= '</table>';
|
||||
$output .= $p->getBarTraditional($session{form}{pn});
|
||||
my $ac = WebGUI::AdminConsole->new;
|
||||
$ac->setAdminFunction("activeSessions");
|
||||
return $ac->render($output);
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
@ -11,10 +11,18 @@ package WebGUI::Operation::Admin;
|
|||
#-------------------------------------------------------------------
|
||||
|
||||
use strict;
|
||||
use WebGUI::AdminConsole;
|
||||
use WebGUI::Grouping;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::SQL;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_adminConsole {
|
||||
return "" unless (WebGUI::Grouping::isInGroup(12));
|
||||
my $ac = WebGUI::AdminConsole->new;
|
||||
return $ac->render;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_switchOffAdmin {
|
||||
return "" unless (WebGUI::Grouping::isInGroup(12));
|
||||
|
|
|
|||
|
|
@ -11,12 +11,12 @@ package WebGUI::Operation::Clipboard;
|
|||
#-------------------------------------------------------------------
|
||||
|
||||
use strict;
|
||||
use WebGUI::AdminConsole;
|
||||
use WebGUI::DateTime;
|
||||
use WebGUI::Grouping;
|
||||
use WebGUI::HTMLForm;
|
||||
use WebGUI::Icon;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Operation::Shared;
|
||||
use WebGUI::Page;
|
||||
use WebGUI::Paginator;
|
||||
use WebGUI::Privilege;
|
||||
|
|
@ -26,21 +26,29 @@ use WebGUI::TabForm;
|
|||
use WebGUI::URL;
|
||||
use WebGUI::Utility;
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub _submenu {
|
||||
my (%menu);
|
||||
tie %menu, 'Tie::IxHash';
|
||||
$menu{WebGUI::URL::page('op=manageClipboard')} = WebGUI::International::get(949);
|
||||
my $workarea = shift;
|
||||
my $title = shift;
|
||||
$title = WebGUI::International::get($title) if ($title);
|
||||
my $help = shift;
|
||||
my $ac = WebGUI::AdminConsole->new;
|
||||
if ($help) {
|
||||
$ac->setHelp($help);
|
||||
}
|
||||
$ac->setAdminFunction("clipboard");
|
||||
$ac->addSubmenuItem(WebGUI::URL::page('op=manageClipboard'), WebGUI::International::get(949));
|
||||
if ($session{form}{systemClipboard} ne "1") {
|
||||
$menu{WebGUI::URL::page('op=emptyClipboard')} = WebGUI::International::get(950);
|
||||
$ac->addSubmenuItem(WebGUI::URL::page('op=emptyClipboard'), WebGUI::International::get(950));
|
||||
}
|
||||
if ( ($session{setting}{sharedClipboard} ne "1") && (WebGUI::Grouping::isInGroup(3)) ) {
|
||||
$menu{WebGUI::URL::page('op=manageClipboard&systemClipboard=1')} = WebGUI::International::get(954);
|
||||
$ac->addSubmenuItem(WebGUI::URL::page('op=manageClipboard&systemClipboard=1'), WebGUI::International::get(954));
|
||||
if ($session{form}{systemClipboard} eq "1") {
|
||||
$menu{WebGUI::URL::page('op=emptyClipboard&systemClipboard=1')} = WebGUI::International::get(959);
|
||||
$ac->addSubmenuItem(WebGUI::URL::page('op=emptyClipboard&systemClipboard=1'), WebGUI::International::get(959));
|
||||
}
|
||||
}
|
||||
return menuWrapper($_[0],\%menu);
|
||||
return $ac->render($workarea, $title);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -48,12 +56,12 @@ sub _submenu {
|
|||
sub www_deleteClipboardItem {
|
||||
return WebGUI::Privilege::insufficient() unless (WebGUI::Grouping::isInGroup(4));
|
||||
my ($output);
|
||||
my $help;
|
||||
if ($session{form}{wid} ne "") {
|
||||
$output .= helpIcon("wobject delete");
|
||||
$help = "wobject delete";
|
||||
} elsif ($session{form}{pageId} ne "") {
|
||||
$output .= helpIcon("page delete");
|
||||
$help = "page delete";
|
||||
}
|
||||
$output .= '<h1>'.WebGUI::International::get(42).'</h1>';
|
||||
$output .= WebGUI::International::get(956).'<p>';
|
||||
if ($session{form}{wid} ne "") {
|
||||
$output .= '<div align="center"><a href="'.WebGUI::URL::page('op=deleteClipboardItemConfirm&wid='
|
||||
|
|
@ -64,7 +72,7 @@ sub www_deleteClipboardItem {
|
|||
}
|
||||
$output .= ' <a href="'.WebGUI::URL::page().'">'
|
||||
.WebGUI::International::get(45).'</a></div>';
|
||||
return $output;
|
||||
return _submenu($output,"42",$help);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -119,8 +127,6 @@ sub www_deleteClipboardItemConfirm {
|
|||
sub www_emptyClipboard {
|
||||
return WebGUI::Privilege::insufficient() unless (WebGUI::Grouping::isInGroup(4));
|
||||
my ($output);
|
||||
$output = helpIcon("clipboard empty");
|
||||
$output .= '<h1>'.WebGUI::International::get(42).'</h1>';
|
||||
$output .= WebGUI::International::get(951).'<p>';
|
||||
if ( ($session{setting}{sharedClipboard} ne "1") && (WebGUI::Grouping::isInGroup(3)) ) {
|
||||
$output .= '<div align="center"><a href="'.WebGUI::URL::page('op=emptyClipboardConfirm&systemClipboard=1')
|
||||
|
|
@ -129,9 +135,9 @@ sub www_emptyClipboard {
|
|||
$output .= '<div align="center"><a href="'.WebGUI::URL::page('op=emptyClipboardConfirm')
|
||||
.'">'.WebGUI::International::get(44).'</a>';
|
||||
}
|
||||
$output .= ' <a href="'.WebGUI::URL::page().'">'
|
||||
$output .= ' <a href="'.WebGUI::URL::page("op=manageClipboard").'">'
|
||||
.WebGUI::International::get(45).'</a></div>';
|
||||
return $output;
|
||||
return _submenu($output,"42","clipboard empty");
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -181,20 +187,18 @@ sub www_emptyClipboardConfirm {
|
|||
sub www_manageClipboard {
|
||||
return WebGUI::Privilege::insufficient() unless (WebGUI::Grouping::isInGroup(4));
|
||||
|
||||
my ($sth, @data, @row, @sorted_row, $i, $p, $allUsers);
|
||||
my $output = helpIcon("clipboard manage");
|
||||
my ($sth, @data, @row, @sorted_row, $i, $p, $allUsers, $title);
|
||||
my $output;
|
||||
|
||||
# Add appropriate html page header
|
||||
if ($session{setting}{sharedClipboard} eq "1") {
|
||||
$allUsers = 1;
|
||||
$output .= '<h1>'. WebGUI::International::get(948) .'</h1>';
|
||||
} elsif ($session{form}{systemClipboard} eq "1") {
|
||||
return WebGUI::Privilege::adminOnly() unless (WebGUI::Grouping::isInGroup(3));
|
||||
$allUsers = 1;
|
||||
$output .= '<h1>'. WebGUI::International::get(955) .'</h1>';
|
||||
$title = '955';
|
||||
} else {
|
||||
$allUsers = 0;
|
||||
$output .= '<h1>'. WebGUI::International::get(948) .'</h1>';
|
||||
}
|
||||
|
||||
# Generate list of pages in clipboard
|
||||
|
|
@ -331,7 +335,7 @@ sub www_manageClipboard {
|
|||
$output .= $p->getPage($session{form}{pn});
|
||||
$output .= '</table>';
|
||||
$output .= $p->getBarTraditional($session{form}{pn});
|
||||
return _submenu($output);
|
||||
return _submenu($output, $title, "clipboard manage");
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
|
|||
|
|
@ -12,12 +12,12 @@ package WebGUI::Operation::DatabaseLink;
|
|||
|
||||
use strict;
|
||||
use Tie::CPHash;
|
||||
use WebGUI::AdminConsole;
|
||||
use WebGUI::DatabaseLink;
|
||||
use WebGUI::Grouping;
|
||||
use WebGUI::Icon;
|
||||
use WebGUI::Id;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Operation::Shared;
|
||||
use WebGUI::Paginator;
|
||||
use WebGUI::Privilege;
|
||||
use WebGUI::Session;
|
||||
|
|
@ -26,16 +26,23 @@ use WebGUI::URL;
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub _submenu {
|
||||
my (%menu);
|
||||
tie %menu, 'Tie::IxHash';
|
||||
$menu{WebGUI::URL::page('op=editDatabaseLink&dlid=new')} = WebGUI::International::get(982);
|
||||
my $workarea = shift;
|
||||
my $title = shift;
|
||||
$title = WebGUI::International::get($title) if ($title);
|
||||
my $help = shift;
|
||||
my $ac = WebGUI::AdminConsole->new;
|
||||
if ($help) {
|
||||
$ac->setHelp($help);
|
||||
}
|
||||
$ac->setAdminFunction("databases");
|
||||
$ac->addSubmenuItem(WebGUI::URL::page('op=editDatabaseLink&dlid=new'), WebGUI::International::get(982));
|
||||
if (($session{form}{op} eq "editDatabaseLink" && $session{form}{dlid} ne "new") || $session{form}{op} eq "deleteDatabaseLink") {
|
||||
$menu{WebGUI::URL::page('op=editDatabaseLink&dlid='.$session{form}{dlid})} = WebGUI::International::get(983);
|
||||
$menu{WebGUI::URL::page('op=copyDatabaseLink&dlid='.$session{form}{dlid})} = WebGUI::International::get(984);
|
||||
$menu{WebGUI::URL::page('op=deleteDatabaseLink&dlid='.$session{form}{dlid})} = WebGUI::International::get(985);
|
||||
$menu{WebGUI::URL::page('op=listDatabaseLinks')} = WebGUI::International::get(986);
|
||||
$ac->addSubmenuItem(WebGUI::URL::page('op=editDatabaseLink&dlid='.$session{form}{dlid}), WebGUI::International::get(983));
|
||||
$ac->addSubmenuItem(WebGUI::URL::page('op=copyDatabaseLink&dlid='.$session{form}{dlid}), WebGUI::International::get(984));
|
||||
$ac->addSubmenuItem(WebGUI::URL::page('op=deleteDatabaseLink&dlid='.$session{form}{dlid}), WebGUI::International::get(985));
|
||||
$ac->addSubmenuItem(WebGUI::URL::page('op=listDatabaseLinks'), WebGUI::International::get(986));
|
||||
}
|
||||
return menuWrapper($_[0],\%menu);
|
||||
return $ac->render($workarea, $title);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -53,8 +60,6 @@ sub www_copyDatabaseLink {
|
|||
sub www_deleteDatabaseLink {
|
||||
return WebGUI::Privilege::insufficient unless (WebGUI::Grouping::isInGroup(3));
|
||||
my ($output);
|
||||
$output .= helpIcon("database link delete");
|
||||
$output .= '<h1>'.WebGUI::International::get(987).'</h1>';
|
||||
$output .= WebGUI::International::get(988).'<p>';
|
||||
foreach my $using (WebGUI::DatabaseLink::whatIsUsing($session{form}{dlid})) {
|
||||
if ($using->{title}) {
|
||||
|
|
@ -69,7 +74,7 @@ sub www_deleteDatabaseLink {
|
|||
.'">'.WebGUI::International::get(44).'</a>';
|
||||
$output .= ' <a href="'.WebGUI::URL::page('op=listDatabaseLinks').
|
||||
'">'.WebGUI::International::get(45).'</a></div>';
|
||||
return _submenu($output);
|
||||
return _submenu($output,"987","database link delete");
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -89,8 +94,6 @@ sub www_editDatabaseLink {
|
|||
} else {
|
||||
%db = WebGUI::SQL->quickHash("select * from databaseLink where databaseLinkId=".quote($session{form}{dlid}));
|
||||
}
|
||||
$output .= helpIcon("database link add/edit");
|
||||
$output .= '<h1>'.WebGUI::International::get(990).'</h1>';
|
||||
$f = WebGUI::HTMLForm->new;
|
||||
$f->hidden("op","editDatabaseLinkSave");
|
||||
$f->hidden("dlid",$session{form}{dlid});
|
||||
|
|
@ -101,7 +104,7 @@ sub www_editDatabaseLink {
|
|||
$f->password("identifier",WebGUI::International::get(995),$db{identifier});
|
||||
$f->submit;
|
||||
$output .= $f->print;
|
||||
return _submenu($output);
|
||||
return _submenu($output,"990","database link add/edit");
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -120,8 +123,6 @@ sub www_editDatabaseLinkSave {
|
|||
sub www_listDatabaseLinks {
|
||||
return WebGUI::Privilege::adminOnly() unless(WebGUI::Grouping::isInGroup(3));
|
||||
my ($output, $p, $sth, %data, @row, $i);
|
||||
$output = helpIcon("database links manage");
|
||||
$output .= '<h1>'.WebGUI::International::get(996).'</h1>';
|
||||
$sth = WebGUI::SQL->read("select * from databaseLink order by title");
|
||||
$row[$i] = '<tr><td valign="top" class="tableData"></td><td valign="top" class="tableData">'.WebGUI::International::get(1076).'</td></tr>';
|
||||
$i++;
|
||||
|
|
@ -141,7 +142,7 @@ sub www_listDatabaseLinks {
|
|||
$output .= $p->getPage;
|
||||
$output .= '</table>';
|
||||
$output .= $p->getBarTraditional;
|
||||
return _submenu($output);
|
||||
return _submenu($output,"database links manage");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
56
lib/WebGUI/Operation/LoginHistory.pm
Normal file
56
lib/WebGUI/Operation/LoginHistory.pm
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
package WebGUI::Operation::LoginHistory;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001-2004 Plain Black Corporation.
|
||||
#-------------------------------------------------------------------
|
||||
# Please read the legal notices (docs/legal.txt) and the license
|
||||
# (docs/license.txt) that came with this distribution before using
|
||||
# this software.
|
||||
#-------------------------------------------------------------------
|
||||
# http://www.plainblack.com info@plainblack.com
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
use strict;
|
||||
use WebGUI::AdminConsole;
|
||||
use WebGUI::DateTime;
|
||||
use WebGUI::Grouping;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Paginator;
|
||||
use WebGUI::Privilege;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::SQL;
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_viewLoginHistory {
|
||||
return WebGUI::Privilege::adminOnly() unless (WebGUI::Grouping::isInGroup(3));
|
||||
my ($output, $p, @row, $i, $sth, %data);
|
||||
tie %data, 'Tie::CPHash';
|
||||
$sth = WebGUI::SQL->read("select * from users,userLoginLog where users.userId=userLoginLog.userId order by userLoginLog.timeStamp desc");
|
||||
while (%data = $sth->hash) {
|
||||
$data{username} = 'unknown user' if ($data{userId} eq "0");
|
||||
$row[$i] = '<tr class="tableData"><td>'.$data{username}.' ('.$data{userId}.')</td>';
|
||||
$row[$i] .= '<td>'.$data{status}.'</td>';
|
||||
$row[$i] .= '<td>'.epochToHuman($data{timeStamp},"%H:%n%p %M/%D/%y").'</td>';
|
||||
$row[$i] .= '<td>'.$data{ipAddress}.'</td>';
|
||||
$row[$i] .= '<td>'.$data{userAgent}.'</td></tr>';
|
||||
$i++;
|
||||
}
|
||||
$sth->finish;
|
||||
$p = WebGUI::Paginator->new(WebGUI::URL::page('op=viewLoginHistory'));
|
||||
$p->setDataByArrayRef(\@row);
|
||||
$output .= '<table border=1 cellpadding=5 cellspacing=0 align="center">';
|
||||
$output .= '<tr class="tableHeader"><td>'.WebGUI::International::get(428).'</td>';
|
||||
$output .= '<td>'.WebGUI::International::get(434).'</td>';
|
||||
$output .= '<td>'.WebGUI::International::get(429).'</td>';
|
||||
$output .= '<td>'.WebGUI::International::get(431).'</td>';
|
||||
$output .= '<td>'.WebGUI::International::get(433).'</td></tr>';
|
||||
$output .= $p->getPage($session{form}{pn});
|
||||
$output .= '</table>';
|
||||
$output .= $p->getBar($session{form}{pn});
|
||||
my $ac = WebGUI::AdminConsole->new;
|
||||
$ac->setAdminFunction("loginHistory");
|
||||
return $ac->render($output);
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
@ -11,99 +11,27 @@ package WebGUI::Operation::Statistics;
|
|||
#-------------------------------------------------------------------
|
||||
|
||||
use strict;
|
||||
use WebGUI::AdminConsole;
|
||||
use WebGUI::Cache;
|
||||
use WebGUI::DateTime;
|
||||
use WebGUI::Grouping;
|
||||
use WebGUI::Icon;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Operation::Shared;
|
||||
use WebGUI::Paginator;
|
||||
use WebGUI::Privilege;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::SQL;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub _submenu {
|
||||
my (%menu);
|
||||
tie %menu, 'Tie::IxHash';
|
||||
$menu{WebGUI::URL::page("op=viewActiveSessions")} = WebGUI::International::get(423);
|
||||
$menu{WebGUI::URL::page("op=viewLoginHistory")} = WebGUI::International::get(424);
|
||||
$menu{WebGUI::URL::page("op=viewPageReport")} = WebGUI::International::get(796);
|
||||
# $menu{WebGUI::URL::page("op=viewTrafficReport")} = WebGUI::International::get(797);
|
||||
$menu{WebGUI::URL::page('op=viewStatistics')} = WebGUI::International::get(144);
|
||||
return menuWrapper($_[0],\%menu);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_killSession {
|
||||
return WebGUI::Privilege::adminOnly() unless (WebGUI::Grouping::isInGroup(3));
|
||||
WebGUI::Session::end($session{form}{sid});
|
||||
return www_viewActiveSessions();
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_viewActiveSessions {
|
||||
return WebGUI::Privilege::adminOnly() unless (WebGUI::Grouping::isInGroup(3));
|
||||
my ($output, $p, @row, $i, $sth, %data);
|
||||
tie %data, 'Tie::CPHash';
|
||||
$output = '<h1>'.WebGUI::International::get(425).'</h1>';
|
||||
$sth = WebGUI::SQL->read("select users.username,users.userId,userSession.sessionId,userSession.expires,
|
||||
userSession.lastPageView,userSession.lastIP from users,userSession where users.userId=userSession.userId
|
||||
and users.userId<>1 order by users.username,userSession.lastPageView desc");
|
||||
while (%data = $sth->hash) {
|
||||
$row[$i] = '<tr class="tableData"><td>'.$data{username}.' ('.$data{userId}.')</td>';
|
||||
$row[$i] .= '<td>'.$data{sessionId}.'</td>';
|
||||
$row[$i] .= '<td>'.epochToHuman($data{expires}).'</td>';
|
||||
$row[$i] .= '<td>'.epochToHuman($data{lastPageView}).'</td>';
|
||||
$row[$i] .= '<td>'.$data{lastIP}.'</td>';
|
||||
$row[$i] .= '<td align="center">'.deleteIcon("op=killSession&sid=$data{sessionId}").'</td></tr>';
|
||||
$i++;
|
||||
my $workarea = shift;
|
||||
my $title = shift;
|
||||
$title = WebGUI::International::get($title) if ($title);
|
||||
my $ac = WebGUI::AdminConsole->new;
|
||||
$ac->setAdminFunction("statistics");
|
||||
if ($session{setting}{trackPageStatistics}) {
|
||||
$ac->addSubmenuItem( WebGUI::URL::page("op=viewPageReport"), WebGUI::International::get(796));
|
||||
# $ac->addSubmenuItem( WebGUI::URL::page("op=viewTrafficReport"), WebGUI::International::get(797));
|
||||
$ac->addSubmenuItem( WebGUI::URL::page('op=viewStatistics'), WebGUI::International::get(144));
|
||||
}
|
||||
$sth->finish;
|
||||
$p = WebGUI::Paginator->new(WebGUI::URL::page('op=viewActiveSessions'));
|
||||
$p->setDataByArrayRef(\@row);
|
||||
$output .= '<table border=1 cellpadding=5 cellspacing=0 align="center">';
|
||||
$output .= '<tr class="tableHeader"><td>'.WebGUI::International::get(428).'</td>';
|
||||
$output .= '<td>'.WebGUI::International::get(435).'</td>';
|
||||
$output .= '<td>'.WebGUI::International::get(432).'</td>';
|
||||
$output .= '<td>'.WebGUI::International::get(430).'</td>';
|
||||
$output .= '<td>'.WebGUI::International::get(431).'</td>';
|
||||
$output .= '<td>'.WebGUI::International::get(436).'</td></tr>';
|
||||
$output .= $p->getPage($session{form}{pn});
|
||||
$output .= '</table>';
|
||||
$output .= $p->getBarTraditional($session{form}{pn});
|
||||
return _submenu($output);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_viewLoginHistory {
|
||||
return WebGUI::Privilege::adminOnly() unless (WebGUI::Grouping::isInGroup(3));
|
||||
my ($output, $p, @row, $i, $sth, %data);
|
||||
tie %data, 'Tie::CPHash';
|
||||
$output = '<h1>'.WebGUI::International::get(426).'</h1>';
|
||||
$sth = WebGUI::SQL->read("select * from users,userLoginLog where users.userId=userLoginLog.userId order by userLoginLog.timeStamp desc");
|
||||
while (%data = $sth->hash) {
|
||||
$data{username} = 'unknown user' if ($data{userId} eq "0");
|
||||
$row[$i] = '<tr class="tableData"><td>'.$data{username}.' ('.$data{userId}.')</td>';
|
||||
$row[$i] .= '<td>'.$data{status}.'</td>';
|
||||
$row[$i] .= '<td>'.epochToHuman($data{timeStamp},"%H:%n%p %M/%D/%y").'</td>';
|
||||
$row[$i] .= '<td>'.$data{ipAddress}.'</td>';
|
||||
$row[$i] .= '<td>'.$data{userAgent}.'</td></tr>';
|
||||
$i++;
|
||||
}
|
||||
$sth->finish;
|
||||
$p = WebGUI::Paginator->new(WebGUI::URL::page('op=viewLoginHistory'));
|
||||
$p->setDataByArrayRef(\@row);
|
||||
$output .= '<table border=1 cellpadding=5 cellspacing=0 align="center">';
|
||||
$output .= '<tr class="tableHeader"><td>'.WebGUI::International::get(428).'</td>';
|
||||
$output .= '<td>'.WebGUI::International::get(434).'</td>';
|
||||
$output .= '<td>'.WebGUI::International::get(429).'</td>';
|
||||
$output .= '<td>'.WebGUI::International::get(431).'</td>';
|
||||
$output .= '<td>'.WebGUI::International::get(433).'</td></tr>';
|
||||
$output .= $p->getPage($session{form}{pn});
|
||||
$output .= '</table>';
|
||||
$output .= $p->getBar($session{form}{pn});
|
||||
return _submenu($output);
|
||||
return $ac->render($workarea, $title);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -111,7 +39,6 @@ sub www_viewPageReport {
|
|||
return WebGUI::Privilege::adminOnly() unless (WebGUI::Grouping::isInGroup(3));
|
||||
my ($output, $count, $user, $data, $sth, %page, $pageId);
|
||||
tie %page, "Tie::IxHash";
|
||||
$output = '<h1>Page Statistics</h1>';
|
||||
unless ($session{setting}{trackPageStatistics}) {
|
||||
$output .= WebGUI::International::get(802);
|
||||
} else {
|
||||
|
|
@ -146,7 +73,7 @@ sub www_viewPageReport {
|
|||
}
|
||||
$output .= '</table>';
|
||||
}
|
||||
return _submenu($output);
|
||||
return _submenu($output,"page statistics");
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -160,9 +87,8 @@ sub www_viewStatistics {
|
|||
$version = $cache->setByHTTP($url,43200);
|
||||
}
|
||||
chomp $version;
|
||||
$output .= '<h1>'.WebGUI::International::get(437).'</h1>';
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td align="right" class="tableHeader">'.WebGUI::International::get(145).':</td><td class="tableData">'.$WebGUI::VERSION.'</td></tr>';
|
||||
$output .= '<tr><td align="right" class="tableHeader">'.WebGUI::International::get(145).':</td><td class="tableData">'.$WebGUI::VERSION.'-'.$WebGUI::STATUS.'</td></tr>';
|
||||
if ($version ne $WebGUI::VERSION) {
|
||||
my @rev = split(/\./,$version);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue