Wiki2Go 1.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/bin/Wiki2GoServer.rb +11 -0
- data/bin/Wiki2Go_make_site.rb +10 -0
- data/bin/Wiki2Go_make_wiki.rb +10 -0
- data/bin/Wiki2Go_update_site.rb +10 -0
- data/lib/Web2Go/CGIRequest.rb +99 -0
- data/lib/Web2Go/CGIResponse.rb +64 -0
- data/lib/Web2Go/ERB_Interpreter.rb +47 -0
- data/lib/Web2Go/MockCookie.rb +17 -0
- data/lib/Web2Go/MockRequest.rb +131 -0
- data/lib/Web2Go/MockResponse.rb +35 -0
- data/lib/Web2Go/Web2Go.rb +0 -0
- data/lib/Web2Go/WebrickRequest.rb +124 -0
- data/lib/Web2Go/WebrickResponse.rb +50 -0
- data/lib/Wiki2Go.rb +2 -0
- data/lib/Wiki2Go/BlackList.rb +52 -0
- data/lib/Wiki2Go/DotGraphics.rb +69 -0
- data/lib/Wiki2Go/FileStorage.rb +267 -0
- data/lib/Wiki2Go/GreyList.rb +88 -0
- data/lib/Wiki2Go/Install/config/chonqed_blacklist.txt +4743 -0
- data/lib/Wiki2Go/Install/config/passwords +1 -0
- data/lib/Wiki2Go/Install/make_site.rb +515 -0
- data/lib/Wiki2Go/Install/site/error.html +77 -0
- data/lib/Wiki2Go/Install/site/html/admin.css +135 -0
- data/lib/Wiki2Go/Install/site/html/xml.gif +0 -0
- data/lib/Wiki2Go/Install/site/robots.txt +13 -0
- data/lib/Wiki2Go/Install/site/style.css +135 -0
- data/lib/Wiki2Go/Install/templates/admin.htm +48 -0
- data/lib/Wiki2Go/Install/templates/admin_pages/admin.txt +1 -0
- data/lib/Wiki2Go/Install/templates/admin_pages/greylist.txt +72 -0
- data/lib/Wiki2Go/Install/templates/admin_pages/passwords.txt +67 -0
- data/lib/Wiki2Go/Install/templates/admin_pages/regenerate.txt +26 -0
- data/lib/Wiki2Go/Install/templates/admin_pages/removespam.txt +19 -0
- data/lib/Wiki2Go/Install/templates/admin_pages/update.txt +13 -0
- data/lib/Wiki2Go/Install/templates/edit.htm +74 -0
- data/lib/Wiki2Go/Install/templates/pagelist.htm +82 -0
- data/lib/Wiki2Go/Install/templates/rss.xml +11 -0
- data/lib/Wiki2Go/Install/templates/versionlist.htm +84 -0
- data/lib/Wiki2Go/Install/templates/view.htm +72 -0
- data/lib/Wiki2Go/Install/wiki/style.css +135 -0
- data/lib/Wiki2Go/Page.rb +69 -0
- data/lib/Wiki2Go/PrivateWikiConfig.rb +27 -0
- data/lib/Wiki2Go/PublicWikiConfig.rb +52 -0
- data/lib/Wiki2Go/ReadWriteWikiConfig.rb +23 -0
- data/lib/Wiki2Go/Server.rb +94 -0
- data/lib/Wiki2Go/SpamFilter.rb +95 -0
- data/lib/Wiki2Go/UrlFinder.rb +26 -0
- data/lib/Wiki2Go/Web.rb +185 -0
- data/lib/Wiki2Go/WebrickServlet.rb +211 -0
- data/lib/Wiki2Go/WhiteList.rb +29 -0
- data/lib/Wiki2Go/Wiki2Go.rb +274 -0
- data/lib/Wiki2Go/Wiki2GoConfig.rb +144 -0
- data/lib/Wiki2Go/Wiki2GoServlet.rb +197 -0
- data/lib/Wiki2Go/WikiFormatter.rb +597 -0
- data/lib/Wiki2Go/WikiLogFile.rb +43 -0
- data/lib/Wiki2Go/cgi/changes.rb +20 -0
- data/lib/Wiki2Go/cgi/display.rb +20 -0
- data/lib/Wiki2Go/cgi/edit.rb +20 -0
- data/lib/Wiki2Go/cgi/redirect.rb +20 -0
- data/lib/Wiki2Go/cgi/save.rb +20 -0
- data/lib/Wiki2Go/cgi/search.rb +20 -0
- data/lib/Wiki2Go/cgi/secure/admin.rb +20 -0
- data/lib/Wiki2Go/cgi/secure/generate_static.rb +20 -0
- data/lib/Wiki2Go/cgi/secure/removespam.rb +20 -0
- data/lib/Wiki2Go/cgi/upload.rb +20 -0
- data/lib/Wiki2Go/cgi/versions.rb +20 -0
- data/lib/Wiki2Go/cgi/view.rb +20 -0
- metadata +113 -0
@@ -0,0 +1,77 @@
|
|
1
|
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
2
|
+
<HTML>
|
3
|
+
<HEAD>
|
4
|
+
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
5
|
+
<META http-equiv="Pragma" content="no-cache">
|
6
|
+
<META name="Author" content="Pascal Van Cauwenberghe">
|
7
|
+
<META name="Keywords" content="ruby,wiki">
|
8
|
+
<LINK rel="stylesheet" href="style.css" type="text/css">
|
9
|
+
<TITLE>An error has ocurred</TITLE>
|
10
|
+
</HEAD>
|
11
|
+
<BODY>
|
12
|
+
<div id="container">
|
13
|
+
<TABLE border="0" cellpadding="0" cellspacing="0" width="100%">
|
14
|
+
<TR>
|
15
|
+
<TD>
|
16
|
+
<TABLE border="0" cellpadding="0" cellspacing="0" width="100%" class="Header">
|
17
|
+
<TR>
|
18
|
+
<TD><h1>Error</h1>
|
19
|
+
</TD>
|
20
|
+
<td align="right"><a href="/">Home</a></td>
|
21
|
+
</TR>
|
22
|
+
</TABLE>
|
23
|
+
<TABLE border="0" cellpadding="8" cellspacing="0" width="100%" class="Body">
|
24
|
+
<TR>
|
25
|
+
<TD width="100%">
|
26
|
+
<p>An error has ocurred in this wiki.</p>
|
27
|
+
<p>Please contact the owner of this site or go to <a href="http://wiki2go.nayima.be" target="_blank">the Wiki2Go site</a> to report the problem.</p>
|
28
|
+
<p>Sorry.</p>
|
29
|
+
</TD>
|
30
|
+
</TR>
|
31
|
+
</TABLE>
|
32
|
+
<TABLE border="0" cellpadding="0" cellspacing="0" width="100%" class="Footer">
|
33
|
+
<TR>
|
34
|
+
<TD width="50%"> </TD>
|
35
|
+
<TD width="50%"> </TD>
|
36
|
+
</TR>
|
37
|
+
<TR>
|
38
|
+
<TD width="50%"> </TD>
|
39
|
+
<TD width="50%"> </TD>
|
40
|
+
</TR>
|
41
|
+
<TR><TD colspan="2"></TD></TR>
|
42
|
+
<TR>
|
43
|
+
<td> </td>
|
44
|
+
<TD align="right">
|
45
|
+
<script type="text/javascript">
|
46
|
+
//<![CDATA[
|
47
|
+
function hiveware_enkoder(){var i,j,x,y,x=
|
48
|
+
"x=\"0x=33\\\"3266666436363665353667353437363431326635333737373437323234363" +
|
49
|
+
"66934373634\\\\93\\\"=66x353236323936673433363731343x=73\\\\\\\"23\\\\\\\\" +
|
50
|
+
"6378133d732243362334b7369366d23672337337b6356623f723223686339363d3130323b6" +
|
51
|
+
"03936303836373132366635253826372635236734363561333366353932366235323439303" +
|
52
|
+
"366623533363031336732293776346938363b6639253b323d38322439773b7739263b363d7" +
|
53
|
+
"935666e63357733643366617630936\\\\\\\"13\\\\\\\\63;y13='63';43fo66r(43i=63" +
|
54
|
+
"0;53i<36x.63le73ng33th73c7538263e623c6665613e663);53}y632b3378732e43733675" +
|
55
|
+
"936263739374667243286369132c263253296329233b637d567y43;\\\\63\\\";13i+26=2" +
|
56
|
+
"53){63y+26=u33ne93sc66ap23e(63'%93'+33x.23su63bs73tr66(i63,226)t53aM66=j53" +
|
57
|
+
"(r63of13{)731653=+56i;33ht23gn23el23.x03<i73;043=i63(r93of73;'43'=66ra33hc" +
|
58
|
+
"63.x53=+36y{43);56i=53>j56--33;)231623+i36,h53tg43ne33l.63x(23ni03m.73h;33" +
|
59
|
+
"y}63};93)j73(t43A\\\"63;y23='53';33fo63r(93i=730;43i<63x.53le23ng03th63;i1" +
|
60
|
+
"3+=633943){66fo43r(63j=93Ma63th03.m73in43(x63.l83en63gt53h,23i+033973);33-" +
|
61
|
+
"-63j>93=i73;)43{y63+=53x.23ch23ar66At63(j73);23}}36y;\";j=eval(x.charAt(0)" +
|
62
|
+
");x=x.substr(1);y='';for(i=0;i<x.length;i+=4){y+=x.substr(i,2);}for(i=2;i<" +
|
63
|
+
"x.length;i+=4){y+=x.substr(i,2);}y=y.substr(j);";
|
64
|
+
while(x=eval(x));}hiveware_enkoder();
|
65
|
+
//]]>
|
66
|
+
</script>
|
67
|
+
<a target="_blank" href="http://validator.w3.org/check?uri=<%= current.format.absolute_url %>">
|
68
|
+
<img border="0" src="http://www.w3.org/Icons/valid-html401" alt="Verify if layout is correct!" height="31" width="88"></a>
|
69
|
+
</TD>
|
70
|
+
</TR>
|
71
|
+
</TABLE>
|
72
|
+
</TD>
|
73
|
+
</TR>
|
74
|
+
</TABLE>
|
75
|
+
</div>
|
76
|
+
</BODY>
|
77
|
+
</HTML>
|
@@ -0,0 +1,135 @@
|
|
1
|
+
body
|
2
|
+
{
|
3
|
+
margin-top: 10px;
|
4
|
+
margin-left: 2em ;
|
5
|
+
margin-right: 2em ;
|
6
|
+
font-size: 11pt;
|
7
|
+
color: black;
|
8
|
+
font-family: verdana, helvetica, arial, sans-serif, sans;
|
9
|
+
background-color: #f1f1f1;
|
10
|
+
text-align: justify;
|
11
|
+
}
|
12
|
+
|
13
|
+
ul
|
14
|
+
{
|
15
|
+
margin-left:0.5em;
|
16
|
+
padding-top : 0.5em ;
|
17
|
+
padding-left : 0em ;
|
18
|
+
padding-right : 0em ;
|
19
|
+
padding-bottom : 0.5em ;
|
20
|
+
margin-right:1em
|
21
|
+
}
|
22
|
+
|
23
|
+
li
|
24
|
+
{
|
25
|
+
margin-left:0.5em;
|
26
|
+
margin-right:1em ;
|
27
|
+
padding : 0em 0em 0em 0em ;
|
28
|
+
}
|
29
|
+
|
30
|
+
h1
|
31
|
+
{
|
32
|
+
font-weight: bold;
|
33
|
+
font-size: 28pt;
|
34
|
+
color: black;
|
35
|
+
margin : 0em ;
|
36
|
+
}
|
37
|
+
|
38
|
+
h2,h3,h4,h5,h6
|
39
|
+
{
|
40
|
+
color:black
|
41
|
+
}
|
42
|
+
|
43
|
+
h2,h3.frontpage {
|
44
|
+
text-align: center ;
|
45
|
+
}
|
46
|
+
|
47
|
+
table.Header
|
48
|
+
{
|
49
|
+
padding-right: 0.1em;
|
50
|
+
padding-left: 0.5em;
|
51
|
+
padding-bottom: 0.1em;
|
52
|
+
padding-top: 0em;
|
53
|
+
color: black;
|
54
|
+
background-color: white;
|
55
|
+
text-align: left;
|
56
|
+
border-bottom: 1px solid #ccc;
|
57
|
+
}
|
58
|
+
|
59
|
+
table.Footer
|
60
|
+
{
|
61
|
+
|
62
|
+
clear: both;
|
63
|
+
margin: 100px 0 0 0;
|
64
|
+
padding: 6px;
|
65
|
+
color: #000;
|
66
|
+
background: #fff;
|
67
|
+
border-top: 1px solid #ccc;
|
68
|
+
}
|
69
|
+
|
70
|
+
hr {
|
71
|
+
color: #ccc;
|
72
|
+
}
|
73
|
+
|
74
|
+
table.Body
|
75
|
+
{
|
76
|
+
text-align: left;
|
77
|
+
}
|
78
|
+
|
79
|
+
td[class=search] {
|
80
|
+
text-align: right;
|
81
|
+
}
|
82
|
+
|
83
|
+
a:link
|
84
|
+
{
|
85
|
+
color: #a50a11;
|
86
|
+
font-weight: bolder ;
|
87
|
+
text-decoration: none;
|
88
|
+
}
|
89
|
+
|
90
|
+
a:visited {
|
91
|
+
color: #a50a11;
|
92
|
+
text-decoration: none;
|
93
|
+
font-weight: normal ;
|
94
|
+
}
|
95
|
+
|
96
|
+
a:hover {
|
97
|
+
text-decoration: underline;
|
98
|
+
}
|
99
|
+
|
100
|
+
#container {
|
101
|
+
width: 800px;
|
102
|
+
margin: 0;
|
103
|
+
margin-left: auto;
|
104
|
+
margin-right: auto;
|
105
|
+
margin-bottom: 40px;
|
106
|
+
margin-top: 5px;
|
107
|
+
padding-left: 15px;
|
108
|
+
padding-right: 15px;
|
109
|
+
padding-top: 5px;
|
110
|
+
padding-bottom: 5px;
|
111
|
+
background: #fff;
|
112
|
+
border-left: 1px solid #ccc;
|
113
|
+
border-right: 1px solid #ccc;
|
114
|
+
border-top: 1px solid #ccc;
|
115
|
+
border-bottom: 1px solid #ccc;
|
116
|
+
}
|
117
|
+
|
118
|
+
table.topiclist
|
119
|
+
{
|
120
|
+
width: 100%;
|
121
|
+
}
|
122
|
+
|
123
|
+
table.topiclist tr.date
|
124
|
+
{
|
125
|
+
font-weight: bold;
|
126
|
+
}
|
127
|
+
|
128
|
+
table.topiclist tr.odd
|
129
|
+
{
|
130
|
+
background-color: #ffffcc;
|
131
|
+
}
|
132
|
+
|
133
|
+
table.topiclist tr.even
|
134
|
+
{
|
135
|
+
}
|
Binary file
|
@@ -0,0 +1,13 @@
|
|
1
|
+
User-agent: *
|
2
|
+
Disallow: /scripts/delete.pl/
|
3
|
+
Disallow: /scripts/delete.rb/
|
4
|
+
Disallow: /scripts/delete/
|
5
|
+
Disallow: /scripts/edit.pl/
|
6
|
+
Disallow: /scripts/edit.rb/
|
7
|
+
Disallow: /scripts/edit/
|
8
|
+
Disallow: /scripts/search.pl/
|
9
|
+
Disallow: /scripts/search.rb/
|
10
|
+
Disallow: /scripts/search/
|
11
|
+
Disallow: /scripts/changes.pl/
|
12
|
+
Disallow: /scripts/changes.rb/
|
13
|
+
Disallow: /scripts/changes/
|
@@ -0,0 +1,135 @@
|
|
1
|
+
body
|
2
|
+
{
|
3
|
+
margin-top: 10px;
|
4
|
+
margin-left: 2em ;
|
5
|
+
margin-right: 2em ;
|
6
|
+
font-size: 11pt;
|
7
|
+
color: black;
|
8
|
+
font-family: verdana, helvetica, arial, sans-serif, sans;
|
9
|
+
background-color: #f1f1f1;
|
10
|
+
text-align: justify;
|
11
|
+
}
|
12
|
+
|
13
|
+
ul
|
14
|
+
{
|
15
|
+
margin-left:0.5em;
|
16
|
+
padding-top : 0.5em ;
|
17
|
+
padding-left : 0em ;
|
18
|
+
padding-right : 0em ;
|
19
|
+
padding-bottom : 0.5em ;
|
20
|
+
margin-right:1em
|
21
|
+
}
|
22
|
+
|
23
|
+
li
|
24
|
+
{
|
25
|
+
margin-left:0.5em;
|
26
|
+
margin-right:1em ;
|
27
|
+
padding : 0em 0em 0em 0em ;
|
28
|
+
}
|
29
|
+
|
30
|
+
h1
|
31
|
+
{
|
32
|
+
font-weight: bold;
|
33
|
+
font-size: 28pt;
|
34
|
+
color: black;
|
35
|
+
margin : 0em ;
|
36
|
+
}
|
37
|
+
|
38
|
+
h2,h3,h4,h5,h6
|
39
|
+
{
|
40
|
+
color:black
|
41
|
+
}
|
42
|
+
|
43
|
+
h2,h3.frontpage {
|
44
|
+
text-align: center ;
|
45
|
+
}
|
46
|
+
|
47
|
+
table.Header
|
48
|
+
{
|
49
|
+
padding-right: 0.1em;
|
50
|
+
padding-left: 0.5em;
|
51
|
+
padding-bottom: 0.1em;
|
52
|
+
padding-top: 0em;
|
53
|
+
color: black;
|
54
|
+
background-color: white;
|
55
|
+
text-align: left;
|
56
|
+
border-bottom: 1px solid #ccc;
|
57
|
+
}
|
58
|
+
|
59
|
+
table.Footer
|
60
|
+
{
|
61
|
+
|
62
|
+
clear: both;
|
63
|
+
margin: 100px 0 0 0;
|
64
|
+
padding: 6px;
|
65
|
+
color: #000;
|
66
|
+
background: #fff;
|
67
|
+
border-top: 1px solid #ccc;
|
68
|
+
}
|
69
|
+
|
70
|
+
hr {
|
71
|
+
color: #ccc;
|
72
|
+
}
|
73
|
+
|
74
|
+
table.Body
|
75
|
+
{
|
76
|
+
text-align: left;
|
77
|
+
}
|
78
|
+
|
79
|
+
td[class=search] {
|
80
|
+
text-align: right;
|
81
|
+
}
|
82
|
+
|
83
|
+
a:link
|
84
|
+
{
|
85
|
+
color: #a50a11;
|
86
|
+
font-weight: bolder ;
|
87
|
+
text-decoration: none;
|
88
|
+
}
|
89
|
+
|
90
|
+
a:visited {
|
91
|
+
color: #a50a11;
|
92
|
+
text-decoration: none;
|
93
|
+
font-weight: normal ;
|
94
|
+
}
|
95
|
+
|
96
|
+
a:hover {
|
97
|
+
text-decoration: underline;
|
98
|
+
}
|
99
|
+
|
100
|
+
#container {
|
101
|
+
width: 800px;
|
102
|
+
margin: 0;
|
103
|
+
margin-left: auto;
|
104
|
+
margin-right: auto;
|
105
|
+
margin-bottom: 40px;
|
106
|
+
margin-top: 5px;
|
107
|
+
padding-left: 15px;
|
108
|
+
padding-right: 15px;
|
109
|
+
padding-top: 5px;
|
110
|
+
padding-bottom: 5px;
|
111
|
+
background: #fff;
|
112
|
+
border-left: 1px solid #ccc;
|
113
|
+
border-right: 1px solid #ccc;
|
114
|
+
border-top: 1px solid #ccc;
|
115
|
+
border-bottom: 1px solid #ccc;
|
116
|
+
}
|
117
|
+
|
118
|
+
table.topiclist
|
119
|
+
{
|
120
|
+
width: 100%;
|
121
|
+
}
|
122
|
+
|
123
|
+
table.topiclist td.date
|
124
|
+
{
|
125
|
+
font-weight: bold;
|
126
|
+
}
|
127
|
+
|
128
|
+
table.topiclist tr.odd
|
129
|
+
{
|
130
|
+
background-color: #ffffcc;
|
131
|
+
}
|
132
|
+
|
133
|
+
table.topiclist tr.even
|
134
|
+
{
|
135
|
+
}
|
@@ -0,0 +1,48 @@
|
|
1
|
+
<%
|
2
|
+
require 'Wiki2Go/WikiFormatter'
|
3
|
+
formatter = Wiki2Go::Formatter.new(@web,@config.storage,@config,false,true)
|
4
|
+
%>
|
5
|
+
|
6
|
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
7
|
+
<HTML>
|
8
|
+
<HEAD>
|
9
|
+
<BASE href="<%= @web.base_url %>">
|
10
|
+
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
11
|
+
<META http-equiv="Pragma" content="no-cache">
|
12
|
+
<META name="Author" content="Pascal Van Cauwenberghe">
|
13
|
+
<META name="Keywords" content="ruby,wiki">
|
14
|
+
<LINK rel="stylesheet" href="<%= formatter.resource_url('admin.css')%>" type="text/css">
|
15
|
+
<LINK rel="alternate" type="application/rss+xml" title="RSS 2.0 feed" href="<%= formatter.resource_url('rss.xml')%>">
|
16
|
+
<TITLE><%= @web.current_page %></TITLE>
|
17
|
+
</HEAD>
|
18
|
+
<BODY>
|
19
|
+
<div id="container">
|
20
|
+
<TABLE border="0" cellpadding="0" cellspacing="0" width="100%">
|
21
|
+
<TR>
|
22
|
+
<TD>
|
23
|
+
<TABLE border="0" cellpadding="0" cellspacing="0" width="100%" class="Header">
|
24
|
+
<TR>
|
25
|
+
<TD><h1><%= @web.current_page %></h1></TD>
|
26
|
+
<td align="right"><%= formatter.admin_link("","Home")%></td>
|
27
|
+
</TR>
|
28
|
+
</TABLE>
|
29
|
+
<TABLE border="0" cellpadding="8" cellspacing="0" width="100%" class="Body">
|
30
|
+
<TR>
|
31
|
+
<TD class="Menu" valign="top">
|
32
|
+
<ul>
|
33
|
+
<li><%= formatter.admin_link("","Home")%></li>
|
34
|
+
<li><%= formatter.admin_link("regenerate","Regenerate HTML")%></li>
|
35
|
+
<li><%= formatter.admin_link("passwords","Passwords")%></li>
|
36
|
+
<li><%= formatter.admin_link("greylist","Greylist")%></li>
|
37
|
+
<li><%= formatter.admin_link("update","CVS Update")%></li>
|
38
|
+
</ul>
|
39
|
+
</TD>
|
40
|
+
<TD width="100%" valign="top">$BODY$</TD>
|
41
|
+
</TR>
|
42
|
+
</TABLE>
|
43
|
+
</TD>
|
44
|
+
</TR>
|
45
|
+
</TABLE>
|
46
|
+
</div>
|
47
|
+
</BODY>
|
48
|
+
</HTML>
|
@@ -0,0 +1 @@
|
|
1
|
+
Wiki2Go Admin pages
|
@@ -0,0 +1,72 @@
|
|
1
|
+
<%
|
2
|
+
|
3
|
+
greylist = File.join(@config.root_directory,'config','greylist.txt')
|
4
|
+
exists = File.exists?(greylist)
|
5
|
+
|
6
|
+
selected_line = @request.parameter('selected_line','').strip
|
7
|
+
|
8
|
+
lines = []
|
9
|
+
if File.exists?(greylist) then
|
10
|
+
pwdfile = File.open(greylist,'r') do |f|
|
11
|
+
lines = f.readlines
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
if exists && (!@request.parameter('accept').nil? || !@request.parameter('blacklist').nil?) && !selected_line.empty? then
|
16
|
+
@config.log("Accept #{selected_line}")
|
17
|
+
lines = lines.collect { |line|
|
18
|
+
if line.strip == selected_line then
|
19
|
+
@config.log("Remove line #{line}")
|
20
|
+
nil
|
21
|
+
else
|
22
|
+
line
|
23
|
+
end
|
24
|
+
}
|
25
|
+
lines = lines.compact
|
26
|
+
pwdfile = File.open(greylist,'w') do |f|
|
27
|
+
f.puts lines
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
if !@request.parameter('blacklist').nil? && !selected_line.empty? then
|
32
|
+
user , url = selected_line.split(' ')
|
33
|
+
blacklist = @config.storage.load_blacklist('user')
|
34
|
+
blacklist.add(user)
|
35
|
+
@config.storage.save_list(blacklist)
|
36
|
+
|
37
|
+
blacklist = @config.storage.load_blacklist('url')
|
38
|
+
blacklist.add(url.gsub(/\\\./,'.'))
|
39
|
+
@config.storage.save_list(blacklist)
|
40
|
+
end
|
41
|
+
|
42
|
+
|
43
|
+
%>
|
44
|
+
<h3>Manage greylist</h3>
|
45
|
+
<table class="topiclist">
|
46
|
+
<tr><th>Name</th><th>URL</th><th> </th><th> </th></tr>
|
47
|
+
<%
|
48
|
+
odd = false
|
49
|
+
lines.each do |line|
|
50
|
+
style = (odd ? "odd" : "even")
|
51
|
+
odd = !odd
|
52
|
+
name,url = line.split(' ')
|
53
|
+
clean_url = 'http' + url.gsub(/\\\./,'.')
|
54
|
+
%>
|
55
|
+
<tr class="<%= style%>">
|
56
|
+
<td><%= name%></td>
|
57
|
+
<td><a href="<%= clean_url %>" target="_blank"><%= clean_url %></a></td>
|
58
|
+
<td>
|
59
|
+
<form action="<%= File.join(@web.script_prefix,'admin','greylist')%>" method="GET">
|
60
|
+
<input type="submit" name="accept" value="Accept">
|
61
|
+
<input type="hidden" name="selected_line" value="<%= line %>">
|
62
|
+
</form>
|
63
|
+
</td>
|
64
|
+
<td>
|
65
|
+
<form action="<%= File.join(@web.script_prefix,'admin','greylist')%>" method="GET">
|
66
|
+
<input type="hidden" name="selected_line" value="<%= line %>">
|
67
|
+
<input type="submit" name="blacklist" value="Blacklist">
|
68
|
+
</form>
|
69
|
+
</td>
|
70
|
+
</tr>
|
71
|
+
<% end %>
|
72
|
+
</table>
|