This file is indexed.

/usr/share/tdiary/misc/plugin/xmlrpc.rb is in tdiary-plugin 3.1.3-3.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# xmlrpc.rb
#
# XML-RPC API
#
# Copyright (c) 2004 MoonWolf <moonwolf@moonwolf.com>
# Distributed under the GPL
#

add_header_proc do
  %Q!\t<link rel="EditURI" type="application/rsd+xml" title="RSD" href="#{h @conf.base_url}rsd.xml" />\n!
end

add_conf_proc('XMLRPC', 'XML-RPC API') do
	saveconf_xmlrpc
	xmlrpc_init

	<<-HTML
	<h3 class="subtitle">#{label_xmlrpc_url}</h3>
	<p><input type="text" name="xmlrpc.url" value="#{h @conf['xmlrpc.url']}" size="100"></p>
	<h3 class="subtitle">#{label_xmlrpc_blogid}</h3>
	<p><input type="text" name="xmlrpc.blogid" value="#{h @conf['xmlrpc.blogid']}" size="20"></p>
	<h3 class="subtitle">#{label_xmlrpc_username}</h3>
	<p><input type="text" name="xmlrpc.username" value="#{h @conf['xmlrpc.username']}" size="20"></p>
	<h3 class="subtitle">#{label_xmlrpc_password}</h3>
	<p><input type="password" name="xmlrpc.password" value="#{h @conf['xmlrpc.password']}" size="20"></p>
	<h3 class="subtitle">#{label_xmlrpc_lastname}</h3>
	<p><input type="text" name="xmlrpc.lastname" value="#{h @conf['xmlrpc.lastname']}" size="20"></p>
	<h3 class="subtitle">#{label_xmlrpc_firstname}</h3>
	<p><input type="text" name="xmlrpc.firstname" value="#{h @conf['xmlrpc.firstname']}" size="20"></p>
	<h3 class="subtitle">#{label_xmlrpc_userid}</h3>
	<p><input type="text" name="xmlrpc.userid" value="#{h @conf['xmlrpc.userid']}" size="20"></p>
	HTML
end

#
# for conf_proc
#
def xmlrpc_init
  @conf['xmlrpc.url']       ||= @conf.base_url + 'xmlrpc.rb'
  @conf['xmlrpc.blogid']    ||= 'devlog'
  @conf['xmlrpc.username']  ||= 'default'
  @conf['xmlrpc.password']  ||= ''
  @conf['xmlrpc.lastname']  ||= ''
  @conf['xmlrpc.firstname'] ||= 'default'
  @conf['xmlrpc.userid']    ||= 'default'
end

def saveconf_xmlrpc
  if @mode == 'saveconf' then
    @conf['xmlrpc.url']       = @cgi.params['xmlrpc.url'][0] || 'xmlrpc.rb'
    @conf['xmlrpc.blogid']    = @cgi.params['xmlrpc.blogid'][0] || 'default'
    @conf['xmlrpc.username']  = @cgi.params['xmlrpc.username'][0] || 'default'
    @conf['xmlrpc.password']  = @cgi.params['xmlrpc.password'][0] || ''
    @conf['xmlrpc.lastname']  = @cgi.params['xmlrpc.lastname'][0] || ''
    @conf['xmlrpc.firstname'] = @cgi.params['xmlrpc.firstname'][0] || 'default'
    @conf['xmlrpc.userid']    = @cgi.params['xmlrpc.userid'][0] || 'default'
    open('rsd.xml','w') {|f|
      f.write <<-EOS
      <rsd version="1.0">
        <service>
          <engineName>tDiary</engineName>
          <engineLink>http://www.tdiary.org/</engineLink>
          <homePageLink>#{h @conf.base_url}</homePageLink>
          <apis>
          <api name="MetaWeblog" preferred="true" apiLink="#{h @conf['xmlrpc.url']}" blogID="#{h @conf['xmlrpc.blogid']}"/>
          <api name="Blogger" preferred="false" apiLink="#{h @conf['xmlrpc.url']}" blogID="#{h @conf['xmlrpc.blogid']}"/>
          </apis>
        </service>
      </rsd>
      EOS
    }
  end
end

# Local Variables:
# mode: ruby
# indent-tabs-mode: t
# tab-width: 3
# ruby-indent-level: 3
# End: