-
Notifications
You must be signed in to change notification settings - Fork 1
/
output2file
51 lines (37 loc) · 975 Bytes
/
output2file
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Blosxom Plugin: output2file
# Author(s): Kyo Nagashima <[email protected]>
# Version: 2004-08-19
# Blosxom Home/Docs/Licensing: http://www.blosxom.com/
package output2file;
use strict;
# --- Configurable variables -----------
my $password = '********';
my $outputdir = '/absolute/path/to/blosxom/datadir';
# --- Plug-in package variables --------
# --------------------------------------
use CGI qw(:standard);
use FileHandle;
my $fh = new FileHandle;
sub start {
if (param('output2file') eq $password) {
return 1;
}
return 0;
}
sub last {
my $file = $outputdir . $ENV{PATH_INFO};
my $res;
if (-f $file and $fh->open("> $file")) {
print $fh $blosxom::output;
$fh->close();
$res = "Success: '$file' is successfully output.\n";
} else {
$res = "Failure: '$file' is unsuccessfully output.\n";
}
$blosxom::header = {
-type => "text/plain; charset=$blosxom::blog_charset",
};
$blosxom::output = $res;
}
1;
# vim:ft=perl