File: antirefspam.rb

package info (click to toggle)
tdiary-contrib 5.0.2-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 2,576 kB
  • ctags: 1,957
  • sloc: ruby: 16,900; lisp: 514; xml: 451; php: 61; sql: 40; sh: 35; makefile: 33
file content (59 lines) | stat: -rw-r--r-- 2,743 bytes parent folder | download | duplicates (6)
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
52
53
54
55
56
57
58
59
#
# antirefspam.rb
#
# Copyright (c) 2004-2005 T.Shimomura <redbug@netlife.gr.jp>
# You can redistribute it and/or modify it under GPL2.
# Please use version 1.0.0 (not 1.0.0G) if GPL doesn't want to be forced on me.
#

add_conf_proc( 'antirefspam', 'Anti Referer Spam',  'security') do
	if @mode == 'saveconf'
		@conf['antirefspam.disable'] = @cgi.params['antirefspam.disable'][0]
		@conf['antirefspam.trustedurl'] = @cgi.params['antirefspam.trustedurl'][0]
		@conf['antirefspam.checkreftable'] = @cgi.params['antirefspam.checkreftable'][0]
		@conf['antirefspam.myurl'] = @cgi.params['antirefspam.myurl'][0]
		@conf['antirefspam.proxy_server'] = @cgi.params['antirefspam.proxy_server'][0]
		@conf['antirefspam.proxy_port'] = @cgi.params['antirefspam.proxy_port'][0]
		@conf['antirefspam.comment_kanaonly'] = @cgi.params['antirefspam.comment_kanaonly'][0]
		@conf['antirefspam.comment_maxsize'] = @cgi.params['antirefspam.comment_maxsize'][0]
		@conf['antirefspam.comment_ngwords'] = @cgi.params['antirefspam.comment_ngwords'][0]
	end

	<<-HTML
	#{@antispamref_html_antispamref}
	<p>
	<label for="antirefspam.disable"><input id="antirefspam.disable" type="checkbox" name="antirefspam.disable" value="true"#{" checked" if @conf['antirefspam.disable'].to_s == "true"}>#{@antispamref_html_disable}</label>
	</p>

	#{@antispamref_html_myurl}
	<p><input name="antirefspam.myurl" value="#{h @conf['antirefspam.myurl']}" size="70"></p>

	#{@antispamref_html_proxy}
	<p>
	server : <input name="antirefspam.proxy_server" value="#{h @conf['antirefspam.proxy_server']}" size="40">
	port : <input name="antirefspam.proxy_port" value="#{h @conf['antirefspam.proxy_port']}" size="5">
	</p>

	#{@antispamref_html_trustedurl}
	<textarea name="antirefspam.trustedurl" cols="70" rows="15">#{h @conf['antirefspam.trustedurl']}</textarea>

	<p>
	<label for="antirefspam.checkreftable"><input id="antirefspam.checkreftable" type="checkbox" name="antirefspam.checkreftable" value="true"#{" checked" if @conf['antirefspam.checkreftable'].to_s == "true"}>#{@antispamref_html_checkreftable}</label>
	</p>

	#{@antispamref_html_comment}
	<p>
	<label for="antirefspam.comment_kanaonly"><input id="antirefspam.comment_kanaonly" type="checkbox" name="antirefspam.comment_kanaonly" value="true"#{" checked" if @conf['antirefspam.comment_kanaonly'].to_s == "true"}>#{@antispamref_html_comment_kanaonly}</label>
	</p>
	<p>
	#{@antispamref_html_comment_maxsize} <input name="antirefspam.comment_maxsize" value="#{h @conf['antirefspam.comment_maxsize']}" size="8">
	</p>
	<p>
	#{@antispamref_html_comment_ngwords}
	<textarea name="antirefspam.comment_ngwords" cols="70" rows="15">#{h @conf['antirefspam.comment_ngwords']}</textarea>
	</p>

	#{@antispamref_html_faq}
	HTML
end