"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "DADA/App.pm" between
dada-11_14_1.tar.gz and dada-11_14_2.tar.gz

About: Dada is a web-based electronic (mass) mailing list management system.

App.pm  (dada-11_14_1):App.pm  (dada-11_14_2)
skipping to change at line 37 skipping to change at line 37
my $b__dir = ( getpwuid($>) )[7] . '/perl'; my $b__dir = ( getpwuid($>) )[7] . '/perl';
push @INC, $b__dir . '5/lib/perl5', push @INC, $b__dir . '5/lib/perl5',
$b__dir . '5/lib/perl5/x86_64-linux-thread-multi', $b__dir . 'lib', $b__dir . '5/lib/perl5/x86_64-linux-thread-multi', $b__dir . 'lib',
map { $b__dir . $_ } @INC; map { $b__dir . $_ } @INC;
} }
$ENV{PATH} = "/bin:/usr/bin"; $ENV{PATH} = "/bin:/usr/bin";
delete @ENV{ 'IFS', 'CDPATH', 'ENV', 'BASH_ENV' }; delete @ENV{ 'IFS', 'CDPATH', 'ENV', 'BASH_ENV' };
#---------------------------------------------------------------------# #---------------------------------------------------------------------#
use Carp qw(carp croak); use Carp qw(carp croak);
#$CARP::Verbose = 1; # $CARP::Verbose = 1;
# use Devel::Confess; # use Devel::Confess;
#---------------------------------------------------------------------# #---------------------------------------------------------------------#
use DADA::Config 11.0.0; use DADA::Config 11.0.0;
use DADA::App::ScreenCache; use DADA::App::ScreenCache;
my $c = DADA::App::ScreenCache->new; my $c = DADA::App::ScreenCache->new;
use DADA::App::Guts; use DADA::App::Guts;
use DADA::MailingList::Subscribers; use DADA::MailingList::Subscribers;
skipping to change at line 1139 skipping to change at line 1139
sub admin_menu_mailing_sending_mass_mailing_options_notification { sub admin_menu_mailing_sending_mass_mailing_options_notification {
my $self = shift; my $self = shift;
my $q = $self->query(); my $q = $self->query();
try { try {
my ( $admin_list, $root_login, $checksout, $error_msg ) = my ( $admin_list, $root_login, $checksout, $error_msg ) =
check_list_security( -cgi_obj => $q, ); check_list_security( -cgi_obj => $q, );
if ($checksout) { if ($checksout) {
my $list = $admin_list; my $list = $admin_list;
require DADA::Mail::MailOut; require DADA::Mail::MailOut;
my $mo = DADA::Mail::MailOut->new( { -list => $list } ); my $mo = DADA::Mail::MailOut->new( { -list => $list } );
my ( $batch_sending_enabled, $batch_size, $batch_wait ) =
$mo->batch_params(); require DADA::MailingList::Settings;
my $ls = DADA::MailingList::Settings->new( { -list => $l
ist } );
my ( $batch_sending_enabled, $batch_size, $batch_wait ) = $mo->batch
_params();
my $per_sec = $batch_size / $batch_wait; my $per_sec = $batch_size / $batch_wait;
my $per_hour = int( $per_sec * 60 * 60 + .5 ) my $per_hour = int( $per_sec * 60 * 60 + .5 )
; # DEV .5 is some sort of rounding thing (with int). That's wrong . ; # DEV .5 is some sort of rounding thing (with int). That's wrong .
if ( $batch_sending_enabled == 1 ) {
return commify($per_hour) . '/hr'; if( $ls->param('sending_method') eq 'amazon_ses'
} && $ls->param('amazon_ses_auto_batch_settings')
else { == 1
return ''; && $batch_sending_enabled == 1
} ){
my $per_hour_thirded;
$per_sec = ($batch_size / $batch_wait) - ($batch_
size - $batch_wait);
$per_hour = int( $per_sec * 60 * 60 + .5 );
$per_hour_thirded = int(($per_hour * 3) + .5);
$per_hour_thirded = commify($per_hour_thirded);
$per_hour = commify($per_hour);
return $per_hour . '/hr - ' . $per_hour_thirded
. '/hr';
}
else {
if ( $batch_sending_enabled == 1 ) {
return commify($per_hour) . '/hr';
}
else {
return '';
}
}
} }
} }
catch { catch {
carp($_); carp($_);
return ''; return '';
}; };
} }
sub admin_menu_profiles_notification { sub admin_menu_profiles_notification {
my $self = shift; my $self = shift;
skipping to change at line 4249 skipping to change at line 4271
my $scrn = DADA::Template::Widgets::wrap_screen( my $scrn = DADA::Template::Widgets::wrap_screen(
{ {
-screen => 'web_services.tmpl', -screen => 'web_services.tmpl',
-with => 'admin', -with => 'admin',
-expr => 1, -expr => 1,
-wrapper_params => { -wrapper_params => {
-Root_Login => $root_login, -Root_Login => $root_login,
-List => $list, -List => $list,
}, },
-vars => { -vars => {
root_login => $root_login,
keys_reset => $keys_reset, keys_reset => $keys_reset,
GLOBAL_API_OPTIONS_enabled => $DADA::Config::GLOB
AL_API_OPTIONS->{enabled},
GLOBAL_API_OPTIONS_public_key => $DADA::Config::G
LOBAL_API_OPTIONS->{public_key},
GLOBAL_API_OPTIONS_private_key => $DADA::Config::
GLOBAL_API_OPTIONS->{private_key},
}, },
-list_settings_vars_param => { -list_settings_vars_param => {
-list => $list, -list => $list,
-dot_it => 1, -dot_it => 1,
}, },
} }
); );
return $scrn; return $scrn;
} }
skipping to change at line 4713 skipping to change at line 4740
my $lh = DADA::MailingList::Subscribers->new( { -list => $list } ); my $lh = DADA::MailingList::Subscribers->new( { -list => $list } );
my $enable_bulk_batching = my $enable_bulk_batching =
xss_filter( scalar $q->param('enable_bulk_batching') ); xss_filter( scalar $q->param('enable_bulk_batching') );
my $mass_send_amount = xss_filter( scalar $q->param('mass_send_amount') ); my $mass_send_amount = xss_filter( scalar $q->param('mass_send_amount') );
my $bulk_sleep_amount = xss_filter( scalar $q->param('bulk_sleep_amount') ); my $bulk_sleep_amount = xss_filter( scalar $q->param('bulk_sleep_amount') );
my $amazon_ses_auto_batch_settings = xss_filter( scalar $q->param('amazon_se s_auto_batch_settings') ); my $amazon_ses_auto_batch_settings = xss_filter( scalar $q->param('amazon_se s_auto_batch_settings') );
my $per_hour = 0; my $per_hour = 0;
my $per_hour_thirded;
my $num_subs = 0; my $num_subs = 0;
my $time_to_send = 0; my $time_to_send = 0;
my $time_to_send_thirded;
my $somethings_wrong = 0; my $somethings_wrong = 0;
if ( $enable_bulk_batching == 1 ) { if ( $enable_bulk_batching == 1 ) {
if ( $amazon_ses_auto_batch_settings == 1 ) { if ( $amazon_ses_auto_batch_settings == 1 ) {
require DADA::Mail::MailOut; require DADA::Mail::MailOut;
my $mo = DADA::Mail::MailOut->new( { -list => $list } ); my $mo = DADA::Mail::MailOut->new( { -list => $list } );
my $enabled; my $enabled;
( $enabled, $mass_send_amount, $bulk_sleep_amount ) = ( $enabled, $mass_send_amount, $bulk_sleep_amount ) =
$mo->batch_params( { -amazon_ses_auto_batch_settings => 1 } ); $mo->batch_params( { -amazon_ses_auto_batch_settings => 1 } );
} }
if ( $bulk_sleep_amount > 0 && $mass_send_amount > 0 ) { if ( $bulk_sleep_amount > 0 && $mass_send_amount > 0 ) {
my $per_sec = $mass_send_amount / $bulk_sleep_amount; my $per_sec;
$per_hour =
if ( $amazon_ses_auto_batch_settings == 1 ) {
# This adds a second to each message sent, less t
he time spend sleeping
# This is to take into consideration how long a m
essage actually takes to send
# to the service.
$per_sec = ($mass_send_amount / $bulk_sleep_amoun
t) - ($mass_send_amount - $bulk_sleep_amount);
}
else {
$per_sec = ($mass_send_amount / $bulk_sleep_amoun
t);
}
$per_hour =
int( $per_sec * 60 * 60 + .5 ) int( $per_sec * 60 * 60 + .5 )
; # DEV .5 is some sort of rounding thing (with int). That's wrong . ; # DEV .5 is some sort of rounding thing (with int). That's wrong .
$num_subs = $lh->num_subscribers; $num_subs = $lh->num_subscribers;
my $total_hours = 0; my $total_hours = 0;
if ( $num_subs > 0 && $per_hour > 0 ) { if ( $num_subs > 0 && $per_hour > 0 ) {
$total_hours = $lh->num_subscribers / $per_hour; $total_hours = $lh->num_subscribers / $per_hour;
} }
$per_hour_thirded = int(($per_hour * 3) + .5);
$per_hour_thirded = commify($per_hour_thirded);
$per_hour = commify($per_hour); $per_hour = commify($per_hour);
$num_subs = commify($num_subs); $num_subs = commify($num_subs);
$time_to_send = formatted_runtime( $total_hours * 60 * 60 ); $time_to_send = formatted_runtime( $total_hours * 60 * 60 );
if ( $amazon_ses_auto_batch_settings == 1 ) {
$time_to_send_thirded = formatted_runtime( ($tota
l_hours/3) * 60 * 60 );
}
} }
else { else {
$somethings_wrong = 1; $somethings_wrong = 1;
} }
} }
my $body = DADA::Template::Widgets::screen( my $body = DADA::Template::Widgets::screen(
{ {
-screen => 'previewBatchSendingSpeed_widget.tmpl', -screen => 'previewBatchSendingSpeed_widget.tmpl',
-vars => { -vars => {
enable_bulk_batching => $enable_bulk_batching, amazon_ses_auto_batch_settings => $amazon_ses_aut
per_hour => $per_hour, o_batch_settings,
num_subscribers => $num_subs, enable_bulk_batching => $enable_bulk_batching,
time_to_send => $time_to_send, per_hour => $per_hour,
somethings_wrong => $somethings_wrong, per_hour_thirded => $per_hour_third
ed,
num_subscribers => $num_subs,
time_to_send => $time_to_send,
time_to_send_thirded => $time_to_send_t
hirded,
somethings_wrong => $somethings_wrong,
} }
} }
); );
return $body; return $body;
} }
sub mail_sending_advanced_options { sub mail_sending_advanced_options {
my $self = shift; my $self = shift;
skipping to change at line 16123 skipping to change at line 16172
warn "PID: $$ Scheduled Tasks may be running in a different proce ss, stopping.\n"; warn "PID: $$ Scheduled Tasks may be running in a different proce ss, stopping.\n";
} }
else { else {
if ( $schedule eq '_all' ) { if ( $schedule eq '_all' ) {
$r .= "\nMonitor:\n" . '-' x 72 . "\n"; $r .= "\nMonitor:\n" . '-' x 72 . "\n";
try { try {
$r .= $dast->mass_mailing_monitor($list); $r .= $dast->mass_mailing_monitor($list);
} catch { } catch {
$r .= "* Error: $_\n"; $r .= "* Error: " . substr($_, 0, 100) . '...' . "\n";
}; };
$r .= "Mass Mailing Schedules:\n" . '-' x 72 . "\n"; $r .= "Mass Mailing Schedules:\n" . '-' x 72 . "\n";
try { try {
$r .= $dast->scheduled_mass_mailings($list); $r .= $dast->scheduled_mass_mailings($list);
} catch { } catch {
$r .= "* Error: $_\n"; $r .= "* Error: " . substr($_, 0, 100) . '...' . "\n";
}; };
$r .= "Rate Limits:\n" . '-' x 72 . "\n"; $r .= "Rate Limits:\n" . '-' x 72 . "\n";
try { try {
$r .= $dast->expire_rate_limit_checks($list); $r .= $dast->expire_rate_limit_checks($list);
} catch { } catch {
$r .= "* Error: $_\n"; $r .= "* Error: " . substr($_, 0, 100) . '...' . "\n";
}; };
$r .= "Cleaning Out MIME Cache:\n" . '-' x 72 . "\n"; $r .= "Cleaning Out MIME Cache:\n" . '-' x 72 . "\n";
try { try {
$r .= $dast->clean_out_mime_cache(); $r .= $dast->clean_out_mime_cache();
} catch { } catch {
$r .= "* Error: $_\n"; $r .= "* Error: " . substr($_, 0, 100) . '...' . "\n";
}; };
$r .= "\nRemoving old archive messages:\n" . '-' x 72 . "\n"; $r .= "\nRemoving old archive messages:\n" . '-' x 72 . "\n";
try { try {
$r .= $dast->remove_old_archive_messages($list); $r .= $dast->remove_old_archive_messages($list);
} catch { } catch {
$r .= "* Error: $_\n"; $r .= "* Error: " . substr($_, 0, 100) . '...' . "\n";
}; };
$r .= "\nRemoving old tracker data:\n" . '-' x 72 . "\n"; $r .= "\nRemoving old tracker data:\n" . '-' x 72 . "\n";
try { try {
$r .= $dast->remove_old_tracker_data($list); $r .= $dast->remove_old_tracker_data($list);
} catch { } catch {
$r .= "* Error: $_\n"; $r .= "* Error: " . substr($_, 0, 100) . '...' . "\n";
}; };
$r .= "\nSending Analytics Email Notification:\n" . '-' x 72 . "\ n"; $r .= "\nSending Analytics Email Notification:\n" . '-' x 72 . "\ n";
try { try {
$r .= $dast->send_analytics_email_notification($list); $r .= $dast->send_analytics_email_notification($list);
} catch { } catch {
$r .= "* Error: $_\n"; $r .= "* Error: " . substr($_, 0, 100) . '...' . "\n";
}; };
for my $plugin ( keys %$DADA::Config::PLUGINS_ENABLED ) { for my $plugin ( keys %$DADA::Config::PLUGINS_ENABLED ) {
if ( exists( $DADA::Config::PLUGINS_ENABLED->{$plugin} ) ) { if ( exists( $DADA::Config::PLUGINS_ENABLED->{$plugin} ) ) {
next if ( $DADA::Config::PLUGINS_ENABLED->{$plugin} != 1 ); next if ( $DADA::Config::PLUGINS_ENABLED->{$plugin} != 1 );
next next
if ! if !
exists( exists(
$DADA::Config::PLUGIN_RUNMODES->{$plugin}->{sched_run } ); $DADA::Config::PLUGIN_RUNMODES->{$plugin}->{sched_run } );
$r .= "Plugin: $plugin\n" . '-' x 72 . "\n"; $r .= "Plugin: $plugin\n" . '-' x 72 . "\n";
try { try {
require 'plugins/' . $plugin; require 'plugins/' . $plugin;
$r .= $DADA::Config::PLUGIN_RUNMODES->{$plugin}->{sch ed_run} $r .= $DADA::Config::PLUGIN_RUNMODES->{$plugin}->{sch ed_run}
->($list); ->($list);
} }
catch { catch {
$r .= "* Error: $_\n"; $r .= "* Error: " . substr($_, 0, 100) . '...' . "\n" ;
}; };
} }
} }
} }
elsif ( $schedule eq 'mass_mailing_monitor' ) { elsif ( $schedule eq 'mass_mailing_monitor' ) {
$r .= "Monitor:\n" . '-' x 72 . "\n"; $r .= "Monitor:\n" . '-' x 72 . "\n";
try { try {
$r .= $dast->mass_mailing_monitor($list); $r .= $dast->mass_mailing_monitor($list);
} }
catch { catch {
$r .= "* Error: $_\n"; $r .= "* Error: " . substr($_, 0, 100) . '...' . "\n";
}; };
} }
elsif ( $schedule eq 'rate_limit_checks' ) { elsif ( $schedule eq 'rate_limit_checks' ) {
$r .= "Rate Limits:\n" . '-' x 72 . "\n"; $r .= "Rate Limits:\n" . '-' x 72 . "\n";
try { try {
$r .= $dast->expire_rate_limit_checks($list); $r .= $dast->expire_rate_limit_checks($list);
} }
catch { catch {
$r .= "* Error: $_\n"; $r .= "* Error: " . substr($_, 0, 100) . '...' . "\n";
}; };
} }
elsif ( $schedule eq 'mime_cache' ) { elsif ( $schedule eq 'mime_cache' ) {
$r .= "Cleaning Out MIME Cache:\n" . '-' x 72 . "\n"; $r .= "Cleaning Out MIME Cache:\n" . '-' x 72 . "\n";
try { try {
$r .= $dast->clean_out_mime_cache(); $r .= $dast->clean_out_mime_cache();
} }
catch { catch {
$r .= "* Error: $_\n"; $r .= "* Error: " . substr($_, 0, 100) . '...' . "\n";
}; };
} }
elsif ( $schedule eq 'remove_old_archive_messages' ) { elsif ( $schedule eq 'remove_old_archive_messages' ) {
$r .= "Removing out old archive messages:\n" . '-' x 72 . "\n"; $r .= "Removing out old archive messages:\n" . '-' x 72 . "\n";
try { try {
$r .= $dast->remove_old_archive_messages($list); $r .= $dast->remove_old_archive_messages($list);
} }
catch { catch {
$r .= "* Error: $_\n"; $r .= "* Error: " . substr($_, 0, 100) . '...' . "\n";
}; };
} }
elsif ( $schedule eq 'remove_old_tracker_data' ) { elsif ( $schedule eq 'remove_old_tracker_data' ) {
$r .= "Removing out old tracker data:\n" . '-' x 72 . "\n"; $r .= "Removing out old tracker data:\n" . '-' x 72 . "\n";
try { try {
$r .= $dast->remove_old_tracker_data($list); $r .= $dast->remove_old_tracker_data($list);
} }
catch { catch {
$r .= "* Error: $_\n"; $r .= "* Error: " . substr($_, 0, 100) . '...' . "\n";
}; };
} }
elsif ( $schedule eq 'send_analytics_email_notification' ) { elsif ( $schedule eq 'send_analytics_email_notification' ) {
$r .= "Sending Analytics Email Notification:\n" . '-' x 72 . "\n" ; $r .= "Sending Analytics Email Notification:\n" . '-' x 72 . "\n" ;
try { try {
$r .= $dast->send_analytics_email_notification($list); $r .= $dast->send_analytics_email_notification($list);
} }
catch { catch {
$r .= "* Error: $_\n"; $r .= "* Error: " . substr($_, 0, 100) . '...' . "\n";
}; };
} }
elsif ( $schedule eq 'scheduled_mass_mailings' ) { elsif ( $schedule eq 'scheduled_mass_mailings' ) {
$r .= "Mass Mailing Schedules:\n" . '-' x 72 . "\n"; $r .= "Mass Mailing Schedules:\n" . '-' x 72 . "\n";
try { try {
$r .= $dast->scheduled_mass_mailings($list); $r .= $dast->scheduled_mass_mailings($list);
} }
catch { catch {
$r .= "* Error: $_\n"; $r .= "* Error: " . substr($_, 0, 100) . '...' . "\n";
}; };
} }
elsif ($schedule eq 'bridge' elsif ($schedule eq 'bridge'
|| $schedule eq 'bounce_handler' ) || $schedule eq 'bounce_handler' )
{ {
if ( $DADA::Config::PLUGINS_ENABLED->{$schedule} != 1 ) { if ( $DADA::Config::PLUGINS_ENABLED->{$schedule} != 1 ) {
#.... #....
} }
else { else {
$r .= "Plugin: $schedule\n" . '-' x 72 . "\n"; $r .= "Plugin: $schedule\n" . '-' x 72 . "\n";
try { try {
require 'plugins/' . $schedule; require 'plugins/' . $schedule;
$r .= $DADA::Config::PLUGIN_RUNMODES->{$schedule}->{sched _run} $r .= $DADA::Config::PLUGIN_RUNMODES->{$schedule}->{sched _run}
->($list); ->($list);
} }
catch { catch {
$r .= "* Error: $_\n"; $r .= "* Error: " . substr($_, 0, 100) . '...' . "\n";
}; };
} }
} }
else { else {
$r .= 'No such schedule:"' . $schedule . '"'; $r .= 'No such schedule:"' . $schedule . '"';
} }
} }
if(defined($lock)){ if(defined($lock)){
$dast->unlock_file($lock); $dast->unlock_file($lock);
 End of changes. 27 change blocks. 
32 lines changed or deleted 97 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)