diff --git a/lib/WebGUI/Asset/Wobject/Article.pm b/lib/WebGUI/Asset/Wobject/Article.pm index 9e32b9c75..c05c52412 100644 --- a/lib/WebGUI/Asset/Wobject/Article.pm +++ b/lib/WebGUI/Asset/Wobject/Article.pm @@ -21,6 +21,51 @@ use WebGUI::Asset::Wobject; our @ISA = qw(WebGUI::Asset::Wobject); +=head1 NAME + +Package WebGUI::Asset::Wobject::Article + +=head1 DESCRIPTION + +Asset to display content to the user. Most content in WebGUI sites +will be Articles. + +Articles are Wobjects, so they inherit all the methods and properties of +Wobjects. + +=head2 definition ( $class, $definition ) + +This method defines all properties of an Article and is used to autogenerate +most methods used by the Article. + +=head3 $class + +$class is used to make sure that inheritance works on Assets and Wobjects. + +=head3 $definition + +Definition hashref from subclasses. + +=head3 Article specific properties + +=over 4 + +=item templateId + +ID of a tempate from the Article namespace to display the contents of the Article. + +=item linkTitle + +The text displayed to the user as a hyperlink to the linkURL. + +=item convertCarriageReturns + +A boolean. If set to true, all newlines will be converted to Break tags so that simple +text will come out formatted as paragraphs. + +=back + +=cut #------------------------------------------------------------------- sub definition { @@ -75,6 +120,14 @@ sub definition { } #------------------------------------------------------------------- + +=head2 view ( ) + +view defines all template variables, processes the template and +returns the output. + +=cut + sub view { my $self = shift; my %var; diff --git a/lib/WebGUI/Operation/ActiveSessions.pm b/lib/WebGUI/Operation/ActiveSessions.pm index 15907ac15..e2f00ba6c 100644 --- a/lib/WebGUI/Operation/ActiveSessions.pm +++ b/lib/WebGUI/Operation/ActiveSessions.pm @@ -21,7 +21,26 @@ use WebGUI::Privilege; use WebGUI::Session; use WebGUI::SQL; +=head1 NAME + +Package WebGUI::Operations::ActiveSessions + +=head1 DESCRIPTION + +Operation handler for displaying and killing active sessions. + +=cut + #------------------------------------------------------------------- + +=head2 www_killSession ( ) + +This method can be called directly, but is usually called +from www_viewActiveSessions. It ends the active session in +$session{form}{sid}. Afterwards, it calls www_viewActiveSessions. + +=cut + sub www_killSession { return www_viewActiveSessions() if $session{form}{sid} eq $session{var}{sessionId}; return WebGUI::Privilege::adminOnly() unless (WebGUI::Grouping::isInGroup(3)); @@ -30,6 +49,14 @@ sub www_killSession { } #------------------------------------------------------------------- + +=head2 www_viewActiveSessions ( ) + +Display a list of all active user sessions, along with an icon to +delete (kill) each one via www_killSession + +=cut + sub www_viewActiveSessions { return WebGUI::Privilege::adminOnly() unless (WebGUI::Grouping::isInGroup(3)); my ($output, $p, @row, $i, $sth, %data); diff --git a/lib/WebGUI/Operation/Admin.pm b/lib/WebGUI/Operation/Admin.pm index 6adcf9e5b..ff00903c6 100644 --- a/lib/WebGUI/Operation/Admin.pm +++ b/lib/WebGUI/Operation/Admin.pm @@ -15,7 +15,24 @@ use WebGUI::AdminConsole; use WebGUI::Grouping; use WebGUI::Session; +=head1 NAME + +Package WebGUI::Operation::Admin + +=head1 DESCRIPTION + +Operation handler for admin functions + +=cut + #------------------------------------------------------------------- + +=head2 www_adminConsole ( ) + +If the current user is in the Turn On Admin Group, then return an Admin Console. + +=cut + sub www_adminConsole { return "" unless (WebGUI::Grouping::isInGroup(12)); my $ac = WebGUI::AdminConsole->new; @@ -23,6 +40,15 @@ sub www_adminConsole { } #------------------------------------------------------------------- + +=head2 www_switchOffAdmin ( ) + +If the current user is in the Turn On Admin Group, then allow them to turn off Admin mode +via WebGUI::Session::switchAdminOff() + + +=cut + sub www_switchOffAdmin { return "" unless (WebGUI::Grouping::isInGroup(12)); WebGUI::Session::switchAdminOff(); @@ -30,6 +56,14 @@ sub www_switchOffAdmin { } #------------------------------------------------------------------- + +=head2 www_adminConsole ( ) + +If the current user is in the Turn On Admin Group, then allow them to turn on Admin mode. +via WebGUI::Session::switchAdminOn() + +=cut + sub www_switchOnAdmin { return "" unless (WebGUI::Grouping::isInGroup(12)); WebGUI::Session::switchAdminOn(); diff --git a/lib/WebGUI/Operation/Auth.pm b/lib/WebGUI/Operation/Auth.pm index 0a29aba73..61bff63c7 100644 --- a/lib/WebGUI/Operation/Auth.pm +++ b/lib/WebGUI/Operation/Auth.pm @@ -49,6 +49,16 @@ sub getInstance { } #------------------------------------------------------------------- + +=head2 www_auth ( ) + +This subroutine does authentication dispatch. It looks up the authentication method for +the current user, makes sure that it supports the operation that has been requested, +and then executes it. If an illegal method was requested, then an error message +is returned. + +=cut + sub www_auth { my $auth; ($auth) = WebGUI::SQL->quickArray("select authMethod from users where username=".quote($session{form}{username})) if($session{form}{username}); diff --git a/lib/WebGUI/Operation/Cache.pm b/lib/WebGUI/Operation/Cache.pm index fd834311a..f3082cfb2 100644 --- a/lib/WebGUI/Operation/Cache.pm +++ b/lib/WebGUI/Operation/Cache.pm @@ -18,7 +18,34 @@ use WebGUI::Privilege; use WebGUI::Session; use WebGUI::Form; +=head1 NAME + +Package WebGUI::Operation::Cache + +=head1 DESCRIPTION + +Operational handler for caching functions. + +=cut + #------------------------------------------------------------------- + +=head2 _submenu ( $workarea [,$title ] ) + +Internal subroutine for rendering output with an Admin Console. Returns +the rendered output. + +=head3 $workarea + +The output that should be wrapped with an Admin Console. + +=head3 $title + +An optional title for the Admin Console. If it evaluates to true, the title +is looked up in the i18n table in the WebGUI namespace. + +=cut + sub _submenu { my $workarea = shift; my $title = shift; @@ -32,6 +59,20 @@ sub _submenu { #------------------------------------------------------------------- + +=head2 www_flushCache ( duration ) + + +This method can be called directly, but is usually called from +www_manageCache. It flushes the cache. Afterwards, it calls +www_manageCache. + +=head3 duration + +Text description of how long the subscription lasts. + +=cut + sub www_flushCache { return WebGUI::Privilege::adminOnly() unless (WebGUI::Grouping::isInGroup(3)); my $cache = WebGUI::Cache->new(); @@ -40,6 +81,14 @@ sub www_flushCache { } #------------------------------------------------------------------- + +=head2 www_manageCache ( ) + +Display information about the current cache type and cache statistics. Also +provides an option to clear the cache. + +=cut + sub www_manageCache { return WebGUI::Privilege::adminOnly() unless (WebGUI::Grouping::isInGroup(3)); my ($output, $data); diff --git a/lib/WebGUI/Operation/LoginHistory.pm b/lib/WebGUI/Operation/LoginHistory.pm index 003130f0a..78418cda1 100644 --- a/lib/WebGUI/Operation/LoginHistory.pm +++ b/lib/WebGUI/Operation/LoginHistory.pm @@ -20,15 +20,30 @@ use WebGUI::Privilege; use WebGUI::Session; use WebGUI::SQL; +=head1 NAME + +Package WebGUI::Operation::LoginHistory + +=cut #------------------------------------------------------------------- + +=head2 www_viewLoginHistory ( ) + +Display the login history for all users by when they logged in. +The login history is a table of username, userId, status, login date, +IP address they logged in from and what browser (really userAgent) +they used. + +=cut + 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"); + $data{username} = WebGUI::International::get('unknown user') if ($data{userId} eq "0"); $row[$i] = '