Merge branch 'master' into WebGUI8

This commit is contained in:
Graham Knop 2010-04-13 07:50:02 -05:00
commit 2400f19099
797 changed files with 33894 additions and 27196 deletions

View file

@ -74,7 +74,7 @@ if ($userMessageFile) {
print "Searching for users with a status of $currentStatus ...\n" unless ($quiet);
my $userList;
my $now = $session->datetime->time();
my $now = time();
my $inbox = WebGUI::Inbox->new($session);
my $sth = $session->db->read("select userId,assetId from InOutBoard_status where status=?",[$currentStatus]);
while (my ($userId,$assetId) = $sth->array) {

View file

@ -266,14 +266,15 @@ sub buildFileList {
exit 2;
}
my $filename = $session->url->urlize($file);
push(@filelist, {
ext=>$ext,
filename=>$file,
filename=>$filename,
fullPathFile => $fullpathfile,
});
$filelisthash{$file} = $fullpathfile;
print "Found file $file.\n" unless ($quiet);
$filelisthash{$filename} = $fullpathfile;
print "Found file $file as $filename.\n" unless ($quiet);
}
# TB : the recursive call
push(@filelist, buildFileList($now,"$fullpathfile")) if ((-d "$fullpathfile") && $recursive);

View file

@ -2,7 +2,9 @@ use strict;
my $webguiRoot = '/data/WebGUI';
unshift @INC, $webguiRoot . "/lib";
@INC = grep { $_ ne q{.} } @INC;
unshift @INC, "$webguiRoot/lib";
# add custom lib directories to library search path
unshift @INC, grep {

View file

@ -24,6 +24,7 @@ use Getopt::Long;
use POE::Component::IKC::ClientLite;
use Spectre::Admin;
use WebGUI::Config;
use JSON;
$|=1; # disable output buffering
my $help;
@ -158,7 +159,17 @@ sub getStatusReport {
return $POE::Component::IKC::ClientLite::error unless defined $result;
$remote->disconnect;
undef $remote;
return $result;
my $pattern = "%8.8s %-9.9s %-30.30s %-22.22s %-15.15s %-20.20s\n";
my $total = 0;
my $output = sprintf $pattern, "Priority", "Status", "Sitename", "Instance Id", "Last Run", "Last Run Time";
foreach my $instance (@{JSON->new->decode($result)}) {
my $originalPriority = ($instance->{priority} - 1) * 10;
my $priority = $instance->{workingPriority}."/".$originalPriority;
$output .= sprintf $pattern, $priority, $instance->{status}, $instance->{sitename}, $instance->{instanceId}, $instance->{lastState}, $instance->{lastRunTime};
$total++;
}
$output .= sprintf "\n%19.19s %4d\n", "Total Workflows", $total;
return $output;
}
__END__

View file

@ -20,6 +20,7 @@ use Fcntl ':flock';
use Getopt::Long;
use WebGUI::Session;
use WebGUI::Storage;
use Pod::Usage;
my $configFile;
my $help;
@ -32,17 +33,11 @@ GetOptions(
'override' => \$override,
'migrate' => \$migrate,
'quiet' => \$quiet,
'h|help' => \$help,
);
if ( $configFile eq "" ) {
printHelp();
exit 4;
}
if ($help) {
printHelp();
exit 2;
}
pod2usage( { verbose => 2, exitval => 2, } ) if $help;
pod2usage( { exitval => 4, } ) unless $configFile;
# don't want two copies of this to run simultaneously
unless ( flock( DATA, LOCK_EX | LOCK_NB ) ) {
@ -50,54 +45,6 @@ unless ( flock( DATA, LOCK_EX | LOCK_NB ) ) {
exit 3;
}
sub printHelp {
print <<STOP;
Usage: perl $0 --configfile=<webguiConfig>
--configFile WebGUI config file.
Options:
--override This utility is designed to be run as
a privileged user on Linux style systems.
If you wish to run this utility without
being the super user, then use this flag,
but note that it may not work as
intended.
--migrate Migrate entirety of uploads directory to CDN.
Ignore the CDN queue and sync everything.
--help Display this help message and exit.
--quiet Disable output unless there's an error.
EXIT STATUS
The following exit values are returned:
0
Successful execution.
1
Only super user may run the script.
2
Help requested.
3
Only one instance of this script can run at a time.
4
Error during invocation of the command.
5
Content Delivery Network (CDN) is not enabled.
STOP
} ## end sub printHelp
if ( !( $^O =~ /^Win/i ) && $> != 0 && !$override ) {
print "You must be the super user to use this utility.\n";
exit 1;
@ -213,3 +160,91 @@ sub syncUploads {
__DATA__
This exists so flock() code above works.
DO NOT REMOVE THIS DATA SECTION.
__END__
=head1 NAME
syncToCdn - WebGUI interface to a Content Delivery Network.
=head1 SYNOPSIS
syncToCdn.pl --configFile config.conf
[--override]
[--migrate]
[--quiet]
syncToCdn.pl --help
=head1 DESCRIPTION
This WebGUI utility script displays the amount of disk space used by
an asset and it's descendants. It has been modeled after the *nix 'du'
utility.
=over
=item B<--configFile config.conf>
The WebGUI config file to use. Only the file name needs to be specified,
since it will be looked up inside WebGUI's configuration directory.
This parameter is required.
=item B<--override>
This utility is designed to be run as a privileged user on Linux style
systems. If you wish to run this utility without being the super user,
then use this flag, but note that it may not work as intended.
=item B<--migrate>
Migrate entirety of uploads directory to CDN. Ignore the CDN queue and
sync everything.
=item B<--quiet>
Disable output unless there is an error.
=item B<--help>
Shows this documentation, then exits.
=back
=head1 EXIT CODES
The following exit values are returned:
=over 4
=item 0
Successful execution.
=item 1
Only super user may run the script.
=item 2
Help requested.
=item 3
Only one instance of this script can run at a time.
=item 4
Error during invocation of the command.
=item 5
Content Delivery Network (CDN) is not enabled.
=back
=head1 AUTHOR
Copyright 2001-2009 Plain Black Corporation.
=cut

View file

@ -60,10 +60,10 @@ if ($] >= 5.008) {
##Doing this as a global is not nice, but it works
my $missingModule = 0;
checkModule("LWP", 5.824 );
checkModule("LWP", 5.833 );
checkModule("HTTP::Request", 1.40 );
checkModule("HTTP::Headers", 1.61 );
checkModule("Test::More", 0.61, 2 );
checkModule("Test::More", 0.82, 2 );
checkModule("Test::MockObject", 1.02, 2 );
checkModule("Test::Deep", 0.095, 2 );
checkModule("Test::Exception", 0.27, 2 );
@ -88,6 +88,7 @@ checkModule("DateTime", 0.4501 );
checkModule("Time::HiRes", 1.9719 );
checkModule("DateTime::Format::Strptime", 1.0800 );
checkModule("DateTime::Format::Mail", 0.3001 );
checkModule("DateTime::Format::HTTP", 0.38 );
checkModule("Image::Magick", "6.0" );
checkModule("Log::Log4perl", 1.20 );
checkModule("Net::LDAP", 0.39 );
@ -95,12 +96,13 @@ checkModule("HTML::Highlight", 0.20 );
checkModule("HTML::TagFilter", 1.03 );
checkModule("HTML::Template", 2.9 );
checkModule("HTML::Template::Expr", 0.07, 2 );
checkModule("Template", 2.20, 2 );
checkModule("XML::FeedPP", 0.40 );
checkModule("JSON", 2.12 );
checkModule("JSON::Any", 1.22 );
checkModule("Config::JSON", "1.3.1" );
checkModule("Text::CSV_XS", "0.64" );
checkModule("Net::Subnets", 0.21 );
checkModule("Net::CIDR::Lite", 0.20 );
checkModule("Finance::Quote", 1.15 );
checkModule("POE", 1.005 );
checkModule("POE::Component::IKC::Server", 0.2001 );
@ -125,7 +127,7 @@ checkModule("Class::C3", "0.21" );
checkModule("Params::Validate", "0.91" );
checkModule("Clone", "0.31" );
checkModule('HTML::Packer', "0.4" );
checkModule('JavaScript::Packer', '0.02' );
checkModule('JavaScript::Packer', '0.04' );
checkModule('CSS::Packer', '0.2' );
checkModule('Business::Tax::VAT::Validation', '0.20' );
checkModule('Crypt::SSLeay', '0.57' );
@ -138,6 +140,10 @@ checkModule("Memcached::libmemcached", "0.3102" );
checkModule("Moose", "0.93" );
checkModule("MooseX::Storage", "0.23" );
checkModule("namespace::autoclean", "0.09" );
checkModule("Business::PayPal::API", "0.62" );
checkModule("Locales", "0.10" );
checkModule("Test::Harness", "3.17" );
checkModule("DateTime::Event::ICal", "0.10" );
failAndExit("Required modules are missing, running no more checks.") if $missingModule;

View file

@ -213,7 +213,7 @@ sub calculateExpireOffset {
}
}
if ($units eq "fixed") {
my $seconds = (($offset - $session->datetime->time()));
my $seconds = (($offset - time()));
if ($seconds < 1) {
return undef;
}
@ -362,7 +362,7 @@ It can be overridden in the import file for specific users.
=item B<--identifier string>
Specify the default password to use for loaded users. It can (and should)
be overriden in the import file for specific users. If left unspecified,
be overridden in the import file for specific users. If left unspecified,
it defaults to B<123qwe>.
=item B<--status status>