| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Newsletter::Html::Templ; |
|
2
|
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
24
|
|
|
4
|
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
4
|
use strict; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
20
|
|
|
6
|
1
|
|
|
1
|
|
13943
|
use CGI; |
|
|
1
|
|
|
|
|
8476149
|
|
|
|
1
|
|
|
|
|
10
|
|
|
7
|
1
|
|
|
1
|
|
224
|
use Newsletter; |
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
use File::Path; |
|
9
|
|
|
|
|
|
|
use File::Type; |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub init { |
|
12
|
|
|
|
|
|
|
my ($self) = @_; |
|
13
|
|
|
|
|
|
|
$self->{'cgi'} = new CGI; |
|
14
|
|
|
|
|
|
|
} |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub forumBegin { |
|
18
|
|
|
|
|
|
|
my ($self, %param) = @_; |
|
19
|
|
|
|
|
|
|
$self->_out( $self->{'cgi'}->start_form( -method=> 'GET', %param ) ); |
|
20
|
|
|
|
|
|
|
} |
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub forumEnd { |
|
24
|
|
|
|
|
|
|
my ($self) = @_; |
|
25
|
|
|
|
|
|
|
$self->_out( "" ); |
|
26
|
|
|
|
|
|
|
} |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub startpage { |
|
30
|
|
|
|
|
|
|
my ($self) = @_; |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
$self->forumBegin; |
|
35
|
|
|
|
|
|
|
$self->_out( qq~ |
|
36
|
|
|
|
|
|
|
|
|
260
|
|
|
|
|
|
|
~ ); |
|
261
|
|
|
|
|
|
|
|
|
262
|
|
|
|
|
|
|
if( $self->{'nl'}->error ) { |
|
263
|
|
|
|
|
|
|
$self->_info( $self->{'nl'}->error ); |
|
264
|
|
|
|
|
|
|
} |
|
265
|
|
|
|
|
|
|
|
|
266
|
|
|
|
|
|
|
} |
|
267
|
|
|
|
|
|
|
|
|
268
|
|
|
|
|
|
|
|
|
269
|
|
|
|
|
|
|
sub openList { |
|
270
|
|
|
|
|
|
|
my ($self) = @_; |
|
271
|
|
|
|
|
|
|
|
|
272
|
|
|
|
|
|
|
my $listname = $self->{'persistent'}->{"pOpenList"}; |
|
273
|
|
|
|
|
|
|
|
|
274
|
|
|
|
|
|
|
$self->forumBegin; |
|
275
|
|
|
|
|
|
|
$self->_out( qq~ |
|
276
|
|
|
|
|
|
|
|
|
277
|
|
|
|
|
|
|
|
|
352
|
|
|
|
|
|
|
~ ); |
|
353
|
|
|
|
|
|
|
|
|
354
|
|
|
|
|
|
|
if( $self->{'nl'}->error ) { |
|
355
|
|
|
|
|
|
|
$self->_info( $self->{'nl'}->error(1) ); |
|
356
|
|
|
|
|
|
|
} |
|
357
|
|
|
|
|
|
|
|
|
358
|
|
|
|
|
|
|
} |
|
359
|
|
|
|
|
|
|
|
|
360
|
|
|
|
|
|
|
|
|
361
|
|
|
|
|
|
|
sub editTmpl { |
|
362
|
|
|
|
|
|
|
my ($self) = @_; |
|
363
|
|
|
|
|
|
|
|
|
364
|
|
|
|
|
|
|
$self->forumBegin; |
|
365
|
|
|
|
|
|
|
$self->_out( qq~ |
|
366
|
|
|
|
|
|
|
|
|
367
|
|
|
|
|
|
|
|
|
469
|
|
|
|
|
|
|
~ ); |
|
470
|
|
|
|
|
|
|
|
|
471
|
|
|
|
|
|
|
} |
|
472
|
|
|
|
|
|
|
|
|
473
|
|
|
|
|
|
|
|
|
474
|
|
|
|
|
|
|
sub openTmpl { |
|
475
|
|
|
|
|
|
|
my ($self, $path, $type) = @_; |
|
476
|
|
|
|
|
|
|
|
|
477
|
|
|
|
|
|
|
my $nr = int(rand(10000) + 1); |
|
478
|
|
|
|
|
|
|
|
|
479
|
|
|
|
|
|
|
$self->_out( qq~ |
|
480
|
|
|
|
|
|
|
|
|
501
|
|
|
|
|
|
|
~); |
|
502
|
|
|
|
|
|
|
} |
|
503
|
|
|
|
|
|
|
|
|
504
|
|
|
|
|
|
|
|
|
505
|
|
|
|
|
|
|
sub fileuploadTmpl { |
|
506
|
|
|
|
|
|
|
my ($self) = @_; |
|
507
|
|
|
|
|
|
|
|
|
508
|
|
|
|
|
|
|
my $fileName = $self->fileUpload("tmplFileUpload"); |
|
509
|
|
|
|
|
|
|
|
|
510
|
|
|
|
|
|
|
$self->forumBegin( -enctype => "multipart/form-data", -method => "post" ); |
|
511
|
|
|
|
|
|
|
|
|
512
|
|
|
|
|
|
|
$self->_out( qq~ |
|
513
|
|
|
|
|
|
|
|
|
556
|
|
|
|
|
|
|
~); |
|
557
|
|
|
|
|
|
|
|
|
558
|
|
|
|
|
|
|
$self->forumEnd; |
|
559
|
|
|
|
|
|
|
|
|
560
|
|
|
|
|
|
|
} |
|
561
|
|
|
|
|
|
|
|
|
562
|
|
|
|
|
|
|
|
|
563
|
|
|
|
|
|
|
sub sendList { |
|
564
|
|
|
|
|
|
|
my ($self) = @_; |
|
565
|
|
|
|
|
|
|
|
|
566
|
|
|
|
|
|
|
if(! exists $self->{'persistent'}->{"pOpenList"} ) { |
|
567
|
|
|
|
|
|
|
$self->startpage; |
|
568
|
|
|
|
|
|
|
$self->_info( "No Mailing List is selected!" ); |
|
569
|
|
|
|
|
|
|
return; |
|
570
|
|
|
|
|
|
|
} |
|
571
|
|
|
|
|
|
|
|
|
572
|
|
|
|
|
|
|
if(! $self->{'persistent'}->{"pOpenList"} ) { |
|
573
|
|
|
|
|
|
|
$self->startpage; |
|
574
|
|
|
|
|
|
|
$self->_info( "No Mailing List is selected!" ); |
|
575
|
|
|
|
|
|
|
return; |
|
576
|
|
|
|
|
|
|
} |
|
577
|
|
|
|
|
|
|
|
|
578
|
|
|
|
|
|
|
|
|
579
|
|
|
|
|
|
|
|
|
580
|
|
|
|
|
|
|
$self->forumBegin( -enctype => "multipart/form-data", -method => "post" ); |
|
581
|
|
|
|
|
|
|
|
|
582
|
|
|
|
|
|
|
|
|
583
|
|
|
|
|
|
|
my %mailType = ( |
|
584
|
|
|
|
|
|
|
'text' => 'Text', |
|
585
|
|
|
|
|
|
|
'multipart/related' => 'Html', |
|
586
|
|
|
|
|
|
|
'multipart/mixed' => 'Html + Text' |
|
587
|
|
|
|
|
|
|
); |
|
588
|
|
|
|
|
|
|
|
|
589
|
|
|
|
|
|
|
$self->_out( qq~ |
|
590
|
|
|
|
|
|
|
|
|
715
|
|
|
|
|
|
|
~); |
|
716
|
|
|
|
|
|
|
} |
|
717
|
|
|
|
|
|
|
|
|
718
|
|
|
|
|
|
|
|
|
719
|
|
|
|
|
|
|
sub sendListSetting { |
|
720
|
|
|
|
|
|
|
my($self) = @_; |
|
721
|
|
|
|
|
|
|
|
|
722
|
|
|
|
|
|
|
$self->forumBegin(); |
|
723
|
|
|
|
|
|
|
$self->_out( qq~ |
|
724
|
|
|
|
|
|
|
Settings |
|
725
|
|
|
|
|
|
|
|
|
868
|
|
|
|
|
|
|
~); |
|
869
|
|
|
|
|
|
|
|
|
870
|
|
|
|
|
|
|
$self->forumEnd; |
|
871
|
|
|
|
|
|
|
} |
|
872
|
|
|
|
|
|
|
|
|
873
|
|
|
|
|
|
|
|
|
874
|
|
|
|
|
|
|
sub sendListFileupload { |
|
875
|
|
|
|
|
|
|
my($self) = @_; |
|
876
|
|
|
|
|
|
|
|
|
877
|
|
|
|
|
|
|
if( $self->{'cgi'}->param("mailFromFileHtml") ) { |
|
878
|
|
|
|
|
|
|
$self->{'persistent'}->{'pMailFromFileHtml'} = $self->fileUpload("mailFromFileHtml"); |
|
879
|
|
|
|
|
|
|
$self->_out( qq~ |
|
880
|
|
|
|
|
|
|
|
|
881
|
|
|
|
|
|
|
~); |
|
882
|
|
|
|
|
|
|
} |
|
883
|
|
|
|
|
|
|
|
|
884
|
|
|
|
|
|
|
if( $self->{'cgi'}->param("mailFromFileText") ) { |
|
885
|
|
|
|
|
|
|
$self->{'persistent'}->{'pMailFromFileText'} = $self->fileUpload("mailFromFileText"); |
|
886
|
|
|
|
|
|
|
$self->_out( qq~ |
|
887
|
|
|
|
|
|
|
|
|
888
|
|
|
|
|
|
|
~); |
|
889
|
|
|
|
|
|
|
} |
|
890
|
|
|
|
|
|
|
|
|
891
|
|
|
|
|
|
|
|
|
892
|
|
|
|
|
|
|
for( my $a = 1; $a < 11; $a++ ) { |
|
893
|
|
|
|
|
|
|
if( $self->{'cgi'}->param("mailEmbFile$a") ) { |
|
894
|
|
|
|
|
|
|
$self->{'persistent'}->{"pMailEmbFile$a"} = $self->fileUpload("mailEmbFile$a"); |
|
895
|
|
|
|
|
|
|
$self->_out( qq~ |
|
896
|
|
|
|
|
|
|
{'persistent'}->{"pMailEmbFile$a"}> |
|
897
|
|
|
|
|
|
|
~); |
|
898
|
|
|
|
|
|
|
} |
|
899
|
|
|
|
|
|
|
|
|
900
|
|
|
|
|
|
|
if( $self->{'cgi'}->param("mailAttFile$a") ) { |
|
901
|
|
|
|
|
|
|
$self->{'persistent'}->{"pMailAttFile$a"} = $self->fileUpload("mailAttFile$a"); |
|
902
|
|
|
|
|
|
|
$self->_out( qq~ |
|
903
|
|
|
|
|
|
|
{'persistent'}->{"pMailAttFile$a"}> |
|
904
|
|
|
|
|
|
|
~); |
|
905
|
|
|
|
|
|
|
} |
|
906
|
|
|
|
|
|
|
} |
|
907
|
|
|
|
|
|
|
} |
|
908
|
|
|
|
|
|
|
|
|
909
|
|
|
|
|
|
|
|
|
910
|
|
|
|
|
|
|
sub sendListFileDelete { |
|
911
|
|
|
|
|
|
|
my($self) = @_; |
|
912
|
|
|
|
|
|
|
|
|
913
|
|
|
|
|
|
|
if( $self->{'cgi'}->param("delMailFromFileHtml") ) { |
|
914
|
|
|
|
|
|
|
my $file = $self->{'cgi'}->param("delMailFromFileHtml"); |
|
915
|
|
|
|
|
|
|
$self->_out( qx "rm $self->{'uploadPath'}/$file 2>&1" ); |
|
916
|
|
|
|
|
|
|
} |
|
917
|
|
|
|
|
|
|
|
|
918
|
|
|
|
|
|
|
if( $self->{'cgi'}->param("delMailFromFileText") ) { |
|
919
|
|
|
|
|
|
|
my $file = $self->{'cgi'}->param("delMailFromFileText"); |
|
920
|
|
|
|
|
|
|
$self->_out( qx "rm $self->{'uploadPath'}/$file 2>&1" ); |
|
921
|
|
|
|
|
|
|
} |
|
922
|
|
|
|
|
|
|
|
|
923
|
|
|
|
|
|
|
|
|
924
|
|
|
|
|
|
|
for( my $a = 1; $a < 11; $a++ ) { |
|
925
|
|
|
|
|
|
|
if( $self->{'cgi'}->param("delMailEmbFile$a") ) { |
|
926
|
|
|
|
|
|
|
my $file = $self->{'cgi'}->param("delMailEmbFile$a"); |
|
927
|
|
|
|
|
|
|
$self->_out( qx "rm $self->{'uploadPath'}/$file 2>&1" ); |
|
928
|
|
|
|
|
|
|
} |
|
929
|
|
|
|
|
|
|
} |
|
930
|
|
|
|
|
|
|
|
|
931
|
|
|
|
|
|
|
for( my $a = 1; $a < 5; $a++ ) { |
|
932
|
|
|
|
|
|
|
if( $self->{'cgi'}->param("delMailAttFile$a") ) { |
|
933
|
|
|
|
|
|
|
my $file = $self->{'cgi'}->param("delMailAttFile$a"); |
|
934
|
|
|
|
|
|
|
$self->_out( qx "rm $self->{'uploadPath'}/$file 2>&1" ); |
|
935
|
|
|
|
|
|
|
} |
|
936
|
|
|
|
|
|
|
} |
|
937
|
|
|
|
|
|
|
|
|
938
|
|
|
|
|
|
|
} |
|
939
|
|
|
|
|
|
|
|
|
940
|
|
|
|
|
|
|
|
|
941
|
|
|
|
|
|
|
sub sendListPreview { |
|
942
|
|
|
|
|
|
|
my($self) = @_; |
|
943
|
|
|
|
|
|
|
|
|
944
|
|
|
|
|
|
|
if(! $self->{'persistent'}->{"pMailSubject"} ) { |
|
945
|
|
|
|
|
|
|
$self->sendList; |
|
946
|
|
|
|
|
|
|
$self->_info( "Alert no mail subject!" ); |
|
947
|
|
|
|
|
|
|
return; |
|
948
|
|
|
|
|
|
|
} |
|
949
|
|
|
|
|
|
|
|
|
950
|
|
|
|
|
|
|
|
|
951
|
|
|
|
|
|
|
|
|
952
|
|
|
|
|
|
|
$self->forumBegin( ); |
|
953
|
|
|
|
|
|
|
$self->sendListFileupload; |
|
954
|
|
|
|
|
|
|
$self->sendListBuild; |
|
955
|
|
|
|
|
|
|
|
|
956
|
|
|
|
|
|
|
$self->_out( qq~ |
|
957
|
|
|
|
|
|
|
|
|
1104
|
|
|
|
|
|
|
~); |
|
1105
|
|
|
|
|
|
|
} |
|
1106
|
|
|
|
|
|
|
|
|
1107
|
|
|
|
|
|
|
|
|
1108
|
|
|
|
|
|
|
sub sendListBuild { |
|
1109
|
|
|
|
|
|
|
my($self) = @_; |
|
1110
|
|
|
|
|
|
|
|
|
1111
|
|
|
|
|
|
|
# Set Sender type |
|
1112
|
|
|
|
|
|
|
$self->{'nl'}->sender( |
|
1113
|
|
|
|
|
|
|
type => $self->{'persistent'}->{"pMailType"} |
|
1114
|
|
|
|
|
|
|
); |
|
1115
|
|
|
|
|
|
|
|
|
1116
|
|
|
|
|
|
|
|
|
1117
|
|
|
|
|
|
|
# Load Footer / Header |
|
1118
|
|
|
|
|
|
|
if( $self->{'persistent'}->{"pOpenSchema"} ) { |
|
1119
|
|
|
|
|
|
|
$self->{'nl'}->template( |
|
1120
|
|
|
|
|
|
|
use => { |
|
1121
|
|
|
|
|
|
|
schema => $self->{'persistent'}->{"pOpenSchema"} |
|
1122
|
|
|
|
|
|
|
} |
|
1123
|
|
|
|
|
|
|
); |
|
1124
|
|
|
|
|
|
|
} else { |
|
1125
|
|
|
|
|
|
|
|
|
1126
|
|
|
|
|
|
|
if( $self->{'persistent'}->{"plOpenFile"}->[0] ) { |
|
1127
|
|
|
|
|
|
|
foreach my $tf ( @{ $self->{'persistent'}->{"plOpenFile"} } ) { |
|
1128
|
|
|
|
|
|
|
my @tmp = split(/-is-/,$tf); |
|
1129
|
|
|
|
|
|
|
|
|
1130
|
|
|
|
|
|
|
$self->{'nl'}->template( |
|
1131
|
|
|
|
|
|
|
use => { |
|
1132
|
|
|
|
|
|
|
is => $tmp[1], |
|
1133
|
|
|
|
|
|
|
filename => $tmp[0] |
|
1134
|
|
|
|
|
|
|
} |
|
1135
|
|
|
|
|
|
|
); |
|
1136
|
|
|
|
|
|
|
} |
|
1137
|
|
|
|
|
|
|
} |
|
1138
|
|
|
|
|
|
|
} |
|
1139
|
|
|
|
|
|
|
|
|
1140
|
|
|
|
|
|
|
# Load Subject |
|
1141
|
|
|
|
|
|
|
if( $self->{'persistent'}->{"pMailSubject"} ) { |
|
1142
|
|
|
|
|
|
|
$self->{'nl'}->body( subject => $self->{'persistent'}->{"pMailSubject"} ); |
|
1143
|
|
|
|
|
|
|
} |
|
1144
|
|
|
|
|
|
|
|
|
1145
|
|
|
|
|
|
|
|
|
1146
|
|
|
|
|
|
|
# Load Body Html |
|
1147
|
|
|
|
|
|
|
my @embHtml = (); |
|
1148
|
|
|
|
|
|
|
for( my $a = 1; $a < 11; $a++ ) { |
|
1149
|
|
|
|
|
|
|
if( $self->{'persistent'}->{"pMailEmbFile$a"} ) { |
|
1150
|
|
|
|
|
|
|
push( @embHtml, $self->{'uploadPath'}.'/'.$self->{'persistent'}->{"pMailEmbFile$a"} ); |
|
1151
|
|
|
|
|
|
|
} |
|
1152
|
|
|
|
|
|
|
} |
|
1153
|
|
|
|
|
|
|
|
|
1154
|
|
|
|
|
|
|
if( exists $self->{'persistent'}->{'pMailFromFileHtml'} ) { |
|
1155
|
|
|
|
|
|
|
if( $self->{'persistent'}->{'pMailFromFileHtml'} ) { |
|
1156
|
|
|
|
|
|
|
$self->{'nl'}->body( |
|
1157
|
|
|
|
|
|
|
file => { |
|
1158
|
|
|
|
|
|
|
path => $self->{'uploadPath'}.'/'.$self->{'persistent'}->{'pMailFromFileHtml'}, |
|
1159
|
|
|
|
|
|
|
type => 'html', |
|
1160
|
|
|
|
|
|
|
embedded => \@embHtml, |
|
1161
|
|
|
|
|
|
|
} |
|
1162
|
|
|
|
|
|
|
); |
|
1163
|
|
|
|
|
|
|
} else { |
|
1164
|
|
|
|
|
|
|
$self->{'nl'}->body( |
|
1165
|
|
|
|
|
|
|
data => { |
|
1166
|
|
|
|
|
|
|
value => $self->{'persistent'}->{'pMailBodyHtml'}, |
|
1167
|
|
|
|
|
|
|
type => 'html', |
|
1168
|
|
|
|
|
|
|
embedded => \@embHtml, |
|
1169
|
|
|
|
|
|
|
} |
|
1170
|
|
|
|
|
|
|
); |
|
1171
|
|
|
|
|
|
|
} |
|
1172
|
|
|
|
|
|
|
} else { |
|
1173
|
|
|
|
|
|
|
$self->{'nl'}->body( |
|
1174
|
|
|
|
|
|
|
data => { |
|
1175
|
|
|
|
|
|
|
value => $self->{'persistent'}->{'pMailBodyHtml'}, |
|
1176
|
|
|
|
|
|
|
type => 'html', |
|
1177
|
|
|
|
|
|
|
embedded => \@embHtml, |
|
1178
|
|
|
|
|
|
|
} |
|
1179
|
|
|
|
|
|
|
); |
|
1180
|
|
|
|
|
|
|
} |
|
1181
|
|
|
|
|
|
|
|
|
1182
|
|
|
|
|
|
|
|
|
1183
|
|
|
|
|
|
|
# Load Body Text |
|
1184
|
|
|
|
|
|
|
if( exists $self->{'persistent'}->{'pMailFromFileText'} ) { |
|
1185
|
|
|
|
|
|
|
if( $self->{'persistent'}->{'pMailFromFileText'} ) { |
|
1186
|
|
|
|
|
|
|
$self->{'nl'}->body( |
|
1187
|
|
|
|
|
|
|
file => { |
|
1188
|
|
|
|
|
|
|
path => $self->{'uploadPath'}.'/'.$self->{'persistent'}->{'pMailFromFileText'}, |
|
1189
|
|
|
|
|
|
|
type => 'text', |
|
1190
|
|
|
|
|
|
|
} |
|
1191
|
|
|
|
|
|
|
); |
|
1192
|
|
|
|
|
|
|
} else { |
|
1193
|
|
|
|
|
|
|
$self->{'nl'}->body( |
|
1194
|
|
|
|
|
|
|
data => { |
|
1195
|
|
|
|
|
|
|
value => $self->{'persistent'}->{'pMailBodyText'}, |
|
1196
|
|
|
|
|
|
|
type => 'text', |
|
1197
|
|
|
|
|
|
|
} |
|
1198
|
|
|
|
|
|
|
); |
|
1199
|
|
|
|
|
|
|
} |
|
1200
|
|
|
|
|
|
|
} else { |
|
1201
|
|
|
|
|
|
|
$self->{'nl'}->body( |
|
1202
|
|
|
|
|
|
|
data => { |
|
1203
|
|
|
|
|
|
|
value => $self->{'persistent'}->{'pMailBodyText'}, |
|
1204
|
|
|
|
|
|
|
type => 'text', |
|
1205
|
|
|
|
|
|
|
} |
|
1206
|
|
|
|
|
|
|
); |
|
1207
|
|
|
|
|
|
|
} |
|
1208
|
|
|
|
|
|
|
|
|
1209
|
|
|
|
|
|
|
|
|
1210
|
|
|
|
|
|
|
# add attachments |
|
1211
|
|
|
|
|
|
|
my $msg = $self->{'nl'}->sender; |
|
1212
|
|
|
|
|
|
|
if( $msg ) { |
|
1213
|
|
|
|
|
|
|
my $ft = File::Type->new(); |
|
1214
|
|
|
|
|
|
|
|
|
1215
|
|
|
|
|
|
|
for( my $a = 1; $a < 5; $a++ ) { |
|
1216
|
|
|
|
|
|
|
if( $self->{'persistent'}->{"pMailAttFile$a"} ) { |
|
1217
|
|
|
|
|
|
|
|
|
1218
|
|
|
|
|
|
|
# 'file' and 'file.html' not allowed |
|
1219
|
|
|
|
|
|
|
if( $self->{'persistent'}->{"pMailAttFile$a"} =~ /file/ || |
|
1220
|
|
|
|
|
|
|
$self->{'persistent'}->{"pMailAttFile$a"} =~ /file\.html/ |
|
1221
|
|
|
|
|
|
|
) { |
|
1222
|
|
|
|
|
|
|
next; |
|
1223
|
|
|
|
|
|
|
$self->_info( "'file' and 'file.html' not allowed as attachment filenames\n" ); |
|
1224
|
|
|
|
|
|
|
} |
|
1225
|
|
|
|
|
|
|
|
|
1226
|
|
|
|
|
|
|
$msg->attach( |
|
1227
|
|
|
|
|
|
|
Type => $ft->checktype_filename( $self->{'uploadPath'}.'/'.$self->{'persistent'}->{"pMailAttFile$a"} ), |
|
1228
|
|
|
|
|
|
|
Path => $self->{'uploadPath'}.'/'.$self->{'persistent'}->{"pMailAttFile$a"} |
|
1229
|
|
|
|
|
|
|
); |
|
1230
|
|
|
|
|
|
|
warn "Path => ".$self->{'uploadPath'}.'/'.$self->{'persistent'}->{"pMailAttFile$a"}; |
|
1231
|
|
|
|
|
|
|
} |
|
1232
|
|
|
|
|
|
|
} |
|
1233
|
|
|
|
|
|
|
} |
|
1234
|
|
|
|
|
|
|
|
|
1235
|
|
|
|
|
|
|
if( $self->{'nl'}->error ) { |
|
1236
|
|
|
|
|
|
|
$self->_info( $self->{'nl'}->error ); |
|
1237
|
|
|
|
|
|
|
} |
|
1238
|
|
|
|
|
|
|
} |
|
1239
|
|
|
|
|
|
|
|
|
1240
|
|
|
|
|
|
|
|
|
1241
|
|
|
|
|
|
|
|
|
1242
|
|
|
|
|
|
|
|
|
1243
|
|
|
|
|
|
|
sub sendListMail { |
|
1244
|
|
|
|
|
|
|
my($self) = @_; |
|
1245
|
|
|
|
|
|
|
|
|
1246
|
|
|
|
|
|
|
|
|
1247
|
|
|
|
|
|
|
$self->sendListBuild; |
|
1248
|
|
|
|
|
|
|
|
|
1249
|
|
|
|
|
|
|
# add attachments |
|
1250
|
|
|
|
|
|
|
# my $msg = $self->{'nl'}->sender; |
|
1251
|
|
|
|
|
|
|
# if( $msg ) { |
|
1252
|
|
|
|
|
|
|
# for( my $a = 1; $a < 5; $a++ ) { |
|
1253
|
|
|
|
|
|
|
# if( $self->{'persistent'}->{"pMailAttFile$a"} ) { |
|
1254
|
|
|
|
|
|
|
# |
|
1255
|
|
|
|
|
|
|
# # 'file' and 'file.html' not allowed |
|
1256
|
|
|
|
|
|
|
# if( $self->{'persistent'}->{"pMailAttFile$a"} =~ /file/ || |
|
1257
|
|
|
|
|
|
|
# $self->{'persistent'}->{"pMailAttFile$a"} =~ /file\.html/ |
|
1258
|
|
|
|
|
|
|
# ) { |
|
1259
|
|
|
|
|
|
|
# next; |
|
1260
|
|
|
|
|
|
|
# $self->_info( "'file' and 'file.html' not allowed as attachment filenames\n" ); |
|
1261
|
|
|
|
|
|
|
# } |
|
1262
|
|
|
|
|
|
|
# |
|
1263
|
|
|
|
|
|
|
# $msg->attach( |
|
1264
|
|
|
|
|
|
|
# Path => $self->{'uploadPath'}.'/'.$self->{'persistent'}->{"pMailAttFile$a"} |
|
1265
|
|
|
|
|
|
|
# ); |
|
1266
|
|
|
|
|
|
|
# warn "Path => ".$self->{'uploadPath'}.'/'.$self->{'persistent'}->{"pMailAttFile$a"}; |
|
1267
|
|
|
|
|
|
|
# } |
|
1268
|
|
|
|
|
|
|
# } |
|
1269
|
|
|
|
|
|
|
# } |
|
1270
|
|
|
|
|
|
|
|
|
1271
|
|
|
|
|
|
|
|
|
1272
|
|
|
|
|
|
|
# open mail list |
|
1273
|
|
|
|
|
|
|
$self->{'nl'}->list( |
|
1274
|
|
|
|
|
|
|
list => { name => $self->{'persistent'}->{"pOpenList"} } |
|
1275
|
|
|
|
|
|
|
); |
|
1276
|
|
|
|
|
|
|
|
|
1277
|
|
|
|
|
|
|
|
|
1278
|
|
|
|
|
|
|
if( $self->{'nl'}->error ) { |
|
1279
|
|
|
|
|
|
|
$self->_info( $self->{'nl'}->error ); |
|
1280
|
|
|
|
|
|
|
} |
|
1281
|
|
|
|
|
|
|
|
|
1282
|
|
|
|
|
|
|
# send !!! |
|
1283
|
|
|
|
|
|
|
print qq~ ~; |
|
1284
|
|
|
|
|
|
|
$self->{'nl'}->send(1); |
|
1285
|
|
|
|
|
|
|
print qq~ ~; |
|
1286
|
|
|
|
|
|
|
|
|
1287
|
|
|
|
|
|
|
|
|
1288
|
|
|
|
|
|
|
if( $self->{'nl'}->error ) { |
|
1289
|
|
|
|
|
|
|
$self->_info( $self->{'nl'}->error ); |
|
1290
|
|
|
|
|
|
|
} |
|
1291
|
|
|
|
|
|
|
|
|
1292
|
|
|
|
|
|
|
# copy to archiv |
|
1293
|
|
|
|
|
|
|
$self->{'nl'}->archiv( save => 1 ); |
|
1294
|
|
|
|
|
|
|
|
|
1295
|
|
|
|
|
|
|
if( $self->{'nl'}->error ) { |
|
1296
|
|
|
|
|
|
|
$self->_info( $self->{'nl'}->error ); |
|
1297
|
|
|
|
|
|
|
} |
|
1298
|
|
|
|
|
|
|
|
|
1299
|
|
|
|
|
|
|
# cleanup upload files |
|
1300
|
|
|
|
|
|
|
$self->sendListClean(); |
|
1301
|
|
|
|
|
|
|
|
|
1302
|
|
|
|
|
|
|
} |
|
1303
|
|
|
|
|
|
|
|
|
1304
|
|
|
|
|
|
|
|
|
1305
|
|
|
|
|
|
|
sub sendListClean { |
|
1306
|
|
|
|
|
|
|
my($self) = @_; |
|
1307
|
|
|
|
|
|
|
|
|
1308
|
|
|
|
|
|
|
rmtree $self->{'uploadPath'}; |
|
1309
|
|
|
|
|
|
|
} |
|
1310
|
|
|
|
|
|
|
|
|
1311
|
|
|
|
|
|
|
|
|
1312
|
|
|
|
|
|
|
|
|
1313
|
|
|
|
|
|
|
=head1 NAME |
|
1314
|
|
|
|
|
|
|
|
|
1315
|
|
|
|
|
|
|
Newsletter::Html::Templ - Html parts! |
|
1316
|
|
|
|
|
|
|
|
|
1317
|
|
|
|
|
|
|
=head1 VERSION |
|
1318
|
|
|
|
|
|
|
|
|
1319
|
|
|
|
|
|
|
Version 0.01 |
|
1320
|
|
|
|
|
|
|
|
|
1321
|
|
|
|
|
|
|
=cut |
|
1322
|
|
|
|
|
|
|
|
|
1323
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
|
1324
|
|
|
|
|
|
|
|
|
1325
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
1326
|
|
|
|
|
|
|
|
|
1327
|
|
|
|
|
|
|
The html parts for the newsletter module |
|
1328
|
|
|
|
|
|
|
|
|
1329
|
|
|
|
|
|
|
Perhaps a little code snippet. |
|
1330
|
|
|
|
|
|
|
|
|
1331
|
|
|
|
|
|
|
use Newsletter::Html::Templ; |
|
1332
|
|
|
|
|
|
|
|
|
1333
|
|
|
|
|
|
|
my $foo = Newsletter::Html::Templ->new(); |
|
1334
|
|
|
|
|
|
|
... |
|
1335
|
|
|
|
|
|
|
|
|
1336
|
|
|
|
|
|
|
=head1 EXPORT |
|
1337
|
|
|
|
|
|
|
|
|
1338
|
|
|
|
|
|
|
A list of functions that can be exported. You can delete this section |
|
1339
|
|
|
|
|
|
|
if you don't export anything, such as for a purely object-oriented module. |
|
1340
|
|
|
|
|
|
|
|
|
1341
|
|
|
|
|
|
|
=head1 FUNCTIONS |
|
1342
|
|
|
|
|
|
|
|
|
1343
|
|
|
|
|
|
|
=head1 AUTHOR |
|
1344
|
|
|
|
|
|
|
|
|
1345
|
|
|
|
|
|
|
Dominik Hochreiter, C<< >> |
|
1346
|
|
|
|
|
|
|
|
|
1347
|
|
|
|
|
|
|
=head1 BUGS |
|
1348
|
|
|
|
|
|
|
|
|
1349
|
|
|
|
|
|
|
Please report any bugs or feature requests to |
|
1350
|
|
|
|
|
|
|
C, or through the web interface at |
|
1351
|
|
|
|
|
|
|
L. |
|
1352
|
|
|
|
|
|
|
I will be notified, and then you'll automatically be notified of progress on |
|
1353
|
|
|
|
|
|
|
your bug as I make changes. |
|
1354
|
|
|
|
|
|
|
|
|
1355
|
|
|
|
|
|
|
=head1 SUPPORT |
|
1356
|
|
|
|
|
|
|
|
|
1357
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
|
1358
|
|
|
|
|
|
|
|
|
1359
|
|
|
|
|
|
|
perldoc Newsletter |
|
1360
|
|
|
|
|
|
|
|
|
1361
|
|
|
|
|
|
|
You can also look for information at: |
|
1362
|
|
|
|
|
|
|
|
|
1363
|
|
|
|
|
|
|
=over 4 |
|
1364
|
|
|
|
|
|
|
|
|
1365
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
|
1366
|
|
|
|
|
|
|
|
|
1367
|
|
|
|
|
|
|
L |
|
1368
|
|
|
|
|
|
|
|
|
1369
|
|
|
|
|
|
|
=item * CPAN Ratings |
|
1370
|
|
|
|
|
|
|
|
|
1371
|
|
|
|
|
|
|
L |
|
1372
|
|
|
|
|
|
|
|
|
1373
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker |
|
1374
|
|
|
|
|
|
|
|
|
1375
|
|
|
|
|
|
|
L |
|
1376
|
|
|
|
|
|
|
|
|
1377
|
|
|
|
|
|
|
=item * Search CPAN |
|
1378
|
|
|
|
|
|
|
|
|
1379
|
|
|
|
|
|
|
L |
|
1380
|
|
|
|
|
|
|
|
|
1381
|
|
|
|
|
|
|
=back |
|
1382
|
|
|
|
|
|
|
|
|
1383
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
|
1384
|
|
|
|
|
|
|
|
|
1385
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
|
1386
|
|
|
|
|
|
|
|
|
1387
|
|
|
|
|
|
|
Copyright 2006 Dominik Hochreiter, all rights reserved. |
|
1388
|
|
|
|
|
|
|
|
|
1389
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
|
1390
|
|
|
|
|
|
|
under the same terms as Perl itself. |
|
1391
|
|
|
|
|
|
|
|
|
1392
|
|
|
|
|
|
|
=cut |
|
1393
|
|
|
|
|
|
|
|
|
1394
|
|
|
|
|
|
|
1; # End of Newsletter::Html::Templ |