]> git.pld-linux.org Git - packages/dspam.git/blame - dspam-webui.patch
- fixed analysis. Thx sparky.
[packages/dspam.git] / dspam-webui.patch
CommitLineData
4c81e5f1
ER
1--- dspam-3.6.5/webui/cgi-bin/Makefile.am 2006-05-07 16:07:10.368456730 +0300
2+++ dspam-3.6.5/webui/cgi-bin/Makefile.am 2006-05-07 16:23:40.160557961 +0300
3@@ -1,17 +1,21 @@
4 # $Id$
5 #
6
7-bin_SCRIPTS = configure_pl
8-CLEANFILES = configure.pl
9-
10-EXTRA_DIST = \
11+bindir = $(pkgdatadir)/cgi
12+bin_SCRIPTS = \
13 dspam.cgi \
14 graph.cgi \
15+ admin.cgi \
16+ admingraph.cgi
17+CLEANFILES = configure.pl
18+
19+webappdir = /etc/webapps/$(PACKAGE_NAME)
20+webapp_DATA = configure.pl \
21 default.prefs \
22+ admins
23+
24+EXTRA_DIST = \
25 rgb.txt \
26- admin.cgi \
27- admingraph.cgi \
28- admins \
29 configure.pl.in
30
31 SUBDIRS = templates
32@@ -22,5 +26,5 @@
33 -e 's,@bindir\@,$(bindir),g'
34
35-configure_pl: configure.pl.in Makefile
36+configure.pl: configure.pl.in Makefile
37 ${sed_substitute_variables} < $(srcdir)/configure.pl.in > configure.pl
38
39--- dspam-3.6.5/webui/cgi-bin/templates/Makefile.am 2006-02-13 18:16:57.000000000 +0200
40+++ dspam-3.6.5.config/webui/cgi-bin/templates/Makefile.am 2006-05-07 15:24:39.881592142 +0300
41@@ -1,6 +1,7 @@
42 # $Id$
43
44-EXTRA_DIST = \
45+templatesdir = $(pkgdatadir)/cgi/templates
46+templates_DATA = \
47 nav_alerts.html \
48 nav_error.html \
49 nav_performance.html \
50--- dspam-3.6.5/webui/htdocs/Makefile.am 2005-07-02 06:59:52.000000000 +0300
51+++ dspam-3.6.5.config/webui/htdocs/Makefile.am 2006-05-07 15:25:19.162469057 +0300
52@@ -2,7 +2,8 @@
53 # webui/htdocs/Makefile.am
54 #
55
56-EXTRA_DIST = \
57+htdocsdir = $(pkgdatadir)/htdocs
58+htdocs_DATA = \
59 base.css \
60 dspam-logo-small.gif
61
62--- dspam-3.6.5/webui/cgi-bin/graph.cgi 2006-05-07 16:30:10.239273555 +0300
63+++ dspam-3.6.5/webui/cgi-bin/graph.cgi 2006-05-07 16:33:54.974294724 +0300
64@@ -25,11 +25,11 @@
65 use vars qw { %CONFIG %FORM @spam_day @nonspam_day @period @data };
66
67 # Read configuration parameters common to all CGI scripts
68-require "configure.pl";
69+require "/etc/webapps/dspam/configure.pl";
70
71 %FORM = &ReadParse();
72
73-GD::Graph::colour::read_rgb("rgb.txt");
74+GD::Graph::colour::read_rgb("/usr/X11R6/lib/X11/rgb.txt");
75
76 do {
77 my($spam, $nonspam, $period) = split(/\_/, $FORM{'data'});
78--- dspam-3.6.5/webui/cgi-bin/admingraph.cgi 2006-05-07 16:30:14.049358683 +0300
79+++ dspam-3.6.5/webui/cgi-bin/admingraph.cgi 2006-05-07 16:33:57.714355944 +0300
80@@ -24,11 +24,11 @@
81 use vars qw { %CONFIG %FORM @spam @nonspam @period @data @inoc @sm @fp @wh };
82
83 # Read configuration parameters common to all CGI scripts
84-require "configure.pl";
85+require "/etc/webapps/dspam/configure.pl";
86
87 %FORM = &ReadParse();
88
89-GD::Graph::colour::read_rgb("rgb.txt");
90+GD::Graph::colour::read_rgb("/usr/X11R6/lib/X11/rgb.txt");
91
92 do {
93 my($spam, $nonspam, $sm, $fp, $inoc, $wh, $period) = split(/\_/, $FORM{'data'});
c5227916 94--- dspam-3.8.0/webui/cgi-bin/dspam.cgi.orig 2006-06-01 21:14:14.000000000 +0200
95+++ dspam-3.8.0/webui/cgi-bin/dspam.cgi 2009-12-08 00:41:41.991051714 +0100
4c81e5f1
ER
96@@ -25,7 +25,7 @@
97 require "ctime.pl";
98
99 # Read configuration parameters common to all CGI scripts
100-require "configure.pl";
101+require "/etc/webapps/dspam/configure.pl";
102
103 if($CONFIG{"DATE_FORMAT"}) {
104 use POSIX qw(strftime);
105@@ -67,7 +67,7 @@
106
107 $CONFIG{'ADMIN'} = 0;
108 if ($ENV{'REMOTE_USER'} ne "") {
109- open(FILE, "<./admins");
110+ open(FILE, "</etc/webapps/dspam/admins");
111 while(<FILE>) {
112 chomp;
113 if ($_ eq $ENV{'REMOTE_USER'}) {
c5227916 114@@ -532,9 +532,8 @@
115 my $uc_period=uc($period);
116 my $hk="DATA_$uc_period";
117- my %lst=();
118+ my %lst=(spam => [], nonspam => [], title => []);
119 foreach my $hr (sort {$a->{idx}<=>$b->{idx}} (values %{$Stats{$period}})) {
120 foreach my $type (qw( spam nonspam title )) {
121- (exists $lst{$type}) || ($lst{$type}=[]);
122 push(@{$lst{$type}},$hr->{$type});
123 my $totk="";
124 if ($type eq "spam") { $totk="S"; }
125@@ -625,7 +627,7 @@
2a169ea9
ER
126
127
128 } else {
129- open(FILE, ">$FILE") || do { &error("Unable to write preferences: $!"); };
130+ open(FILE, ">$FILE") || do { &error("Unable to write preferences: $FILE: $!"); };
131 print FILE <<_END;
132 trainingMode=$FORM{'trainingMode'}
133 spamAction=$FORM{'spamAction'}
c5227916 134@@ -1579,10 +1581,10 @@
4c81e5f1
ER
135
136 if (keys(%PREFS) eq "0" || $CONFIG{'PREFERENCES_EXTENSION'} != 1) {
137
138- if (! -e "./default.prefs") {
139+ if (! -e "/etc/webapps/dspam/default.prefs") {
140 &error("Unable to load default preferences");
141 }
142- open(FILE, "<./default.prefs");
143+ open(FILE, "</etc/webapps/dspam/default.prefs");
144 while(<FILE>) {
145 chomp;
146 my($directive, $value) = split(/\=/);
147--- dspam-3.6.5/webui/cgi-bin/admin.cgi 2006-05-07 16:34:00.934427888 +0300
148+++ dspam-3.6.5/webui/cgi-bin/admin.cgi 2006-05-07 16:37:17.648823791 +0300
149@@ -24,7 +24,7 @@
150 require "ctime.pl";
151
152 # Read configuration parameters common to all CGI scripts
153-require "configure.pl";
154+require "/etc/webapps/dspam/configure.pl";
155
156 #
157 # The current CGI script
158@@ -37,7 +37,7 @@
159 #
160 do {
161 my($admin) = 0;
162- open(FILE, "<./admins");
163+ open(FILE, "</etc/webapps/dspam/admins");
164 while(<FILE>) {
165 chomp;
166 if ($_ eq $ENV{'REMOTE_USER'}) {
167@@ -125,14 +125,14 @@
168 $USER = $FORM{'username'};
169
170 if ($FORM{'username'} eq "") {
171- $FILE = "./default.prefs";
172+ $FILE = "/etc/webapps/dspam/default.prefs";
173 if ($CONFIG{'PREFERENCES_EXTENSION'} != 1 && ! -l "$CONFIG{'DSPAM_HOME'}/default.prefs") {
174 $DATA{'ERROR'} = "<em>WARNING:</em> " .
175 "These default preferences will not be loaded by DSPAM, but only by ".
176 " the CGI interface when a user initially sets up their preferences. ".
177 "To have DSPAM override its configuration with these default ".
178 "preferences, symlink $CONFIG{'DSPAM_HOME'}/default.prefs to the ".
179- "default.prefs file in the CGI directory.<BR><BR>";
180+ "default.prefs file in the /etc/webapps/dspam directory.<BR><BR>";
181 }
182 } else {
183 $FILE = GetPath($FORM{'username'}) . ".prefs";
184@@ -213,7 +213,7 @@
185 }
186
187 if (! -e $FILE) {
188- %PREFS = GetPrefs($USER, "./default.prefs");
189+ %PREFS = GetPrefs($USER, "/etc/webapps/dspam/default.prefs");
190 } else {
191 %PREFS = GetPrefs($USER, $FILE);
192 }
193@@ -704,7 +704,7 @@
194 close(PIPE);
195 } else {
196 if (! -e $FILE) {
197- $FILE = "./default.prefs";
198+ $FILE = "/etc/webapps/dspam/default.prefs";
199 }
200
201 if (! -e $FILE) {
2a169ea9
ER
202--- dspam-3.6.5/webui/cgi-bin/configure.pl.in 2006-05-07 17:06:58.468634350 +0300
203+++ dspam-3.6.5/webui/cgi-bin/configure.pl.in 2006-05-07 17:16:07.510906392 +0300
204@@ -33,7 +33,7 @@
205 $CONFIG{'ALL_PROCS'} = "ps auxw"; # use ps -deaf for Solaris
206 $CONFIG{'MAIL_QUEUE'} = "mailq | grep '^[0-9,A-F]' | wc -l";
207
208-$CONFIG{'WEB_ROOT'} = ""; # URL location of included htdocs/ files
209+$CONFIG{'WEB_ROOT'} = "/dspam/htdocs"; # URL location of included htdocs/ files
210
211 # Default DSPAM display
212 #$CONFIG{'DATE_FORMAT'} = "%d.%m.%Y %H:%M"; # Date format in strftime style
213@@ -53,14 +53,14 @@
214 $ENV{'PATH'} = "$ENV{'PATH'}:$CONFIG{'DSPAM_BIN'}";
215
216 # Autodetect filesystem layout and preference options
217-$CONFIG{'AUTODETECT'} = 1;
218+#$CONFIG{'AUTODETECT'} = 1;
219
220 # Or, if you're running dspam.cgi as untrusted, it won't be able to auto-detect
221 # so you will need to specify some features manually:
222-#$CONFIG{'AUTODETECT'} = 0;
223-#$CONFIG{'LARGE_SCALE'} = 0;
224-#$CONFIG{'DOMAIN_SCALE'} = 0;
225-#$CONFIG{'PREFERENCES_EXTENSION'} = 0;
226+$CONFIG{'AUTODETECT'} = 1;
227+$CONFIG{'LARGE_SCALE'} = 1;
228+$CONFIG{'DOMAIN_SCALE'} = 0;
229+$CONFIG{'PREFERENCES_EXTENSION'} = 1;
230
231 $CONFIG{'DSPAM_CGI'} = "dspam.cgi";
232
This page took 0.075877 seconds and 4 git commands to generate.