Merge lp:~leeturner/quam-plures/xmlrpc_off into lp:quam-plures

Proposed by Lee Turner
Status: Merged
Merged at revision: 7646
Proposed branch: lp:~leeturner/quam-plures/xmlrpc_off
Merge into: lp:quam-plures
Diff against target: 188 lines (+64/-4)
8 files modified
qp_inc/settings/settings.ctrl.php (+17/-0)
qp_inc/settings/views/_general.form.php (+9/-0)
qp_inc/xmlrpc/apis/_b2.api.php (+6/-0)
qp_inc/xmlrpc/apis/_blogger.api.php (+6/-0)
qp_inc/xmlrpc/apis/_metaweblog.api.php (+6/-0)
qp_inc/xmlrpc/apis/_mt.api.php (+6/-1)
qp_srvc/rsd.php (+14/-2)
qp_srvc/xmlrpc.php (+0/-1)
To merge this branch: bzr merge lp:~leeturner/quam-plures/xmlrpc_off
Reviewer Review Type Date Requested Status
EdB Approve
Review via email: mp+116129@code.launchpad.net

Description of the change

http://forums.quamplures.net/viewtopic.php?f=11&t=1167

Allows you to enable or disable each of the xml-rpc API individually.

To post a comment you must log in.
Revision history for this message
EdB (edb) wrote :

Move the new section down below "Notifications", PLEASE!

That page was alphabetized after figuring out there really doesn't seem to be a 'best order' is the reason. Can't see why we would go away from that ... unless a 'best order' really does show up one day.

lp:~leeturner/quam-plures/xmlrpc_off updated
7643. By Lee Turner <email address hidden>

moved the remote publishing settings to the correct place in the settings screen

Revision history for this message
Lee Turner (leeturner) wrote :

Never realised it was alphabetical until you mentioned it. Obvious now I look :-)

Now moved to the correct place.

Revision history for this message
EdB (edb) wrote :

:)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qp_inc/settings/settings.ctrl.php'
2--- qp_inc/settings/settings.ctrl.php 2011-01-09 17:19:59 +0000
3+++ qp_inc/settings/settings.ctrl.php 2012-07-23 07:49:20 +0000
4@@ -86,6 +86,10 @@
5 */
6
7 $Settings->delete_array( array(
8+ 'general_xmlrpc_b2',
9+ 'general_xmlrpc_blogger',
10+ 'general_xmlrpc_metaweblog',
11+ 'general_xmlrpc_mt',
12 'outbound_notifications_mode',
13 'eblog_enabled',
14 'eblog_method',
15@@ -134,6 +138,19 @@
16 }
17 else
18 {
19+ // Remote publishing
20+ param( 'general_xmlrpc_b2', 'boolean', 0 );
21+ $Settings->set( 'general_xmlrpc_b2', $general_xmlrpc_b2 );
22+
23+ param( 'general_xmlrpc_blogger', 'boolean', 0 );
24+ $Settings->set( 'general_xmlrpc_blogger', $general_xmlrpc_blogger );
25+
26+ param( 'general_xmlrpc_metaweblog', 'boolean', 0 );
27+ $Settings->set( 'general_xmlrpc_metaweblog', $general_xmlrpc_metaweblog );
28+
29+ param( 'general_xmlrpc_mt', 'boolean', 0 );
30+ $Settings->set( 'general_xmlrpc_mt', $general_xmlrpc_mt );
31+
32 // After each new post...
33 param( 'outbound_notifications_mode', 'string', true );
34 $Settings->set( 'outbound_notifications_mode', get_param('outbound_notifications_mode') );
35
36=== modified file 'qp_inc/settings/views/_general.form.php'
37--- qp_inc/settings/views/_general.form.php 2011-03-31 22:48:44 +0000
38+++ qp_inc/settings/views/_general.form.php 2012-07-23 07:49:20 +0000
39@@ -199,6 +199,15 @@
40
41 // --------------------------------------------
42
43+$Form->begin_fieldset( get_manual_link('remote_publishing').T_('Remote publishing') );
44+ $Form->checkbox_input( 'general_xmlrpc_b2', $Settings->get('general_xmlrpc_b2'), T_('Enable B2'), array( 'note' => T_('Enable the B2 XML-RPC publishing protocol.') ) );
45+ $Form->checkbox_input( 'general_xmlrpc_blogger', $Settings->get('general_xmlrpc_blogger'), T_('Enable Blogger'), array( 'note' => T_('Enable the Blogger XML-RPC publishing protocol.') ) );
46+ $Form->checkbox_input( 'general_xmlrpc_metaweblog', $Settings->get('general_xmlrpc_metaweblog'), T_('Enable MetaWeblog'), array( 'note' => T_('Enable the MetaWeblog XML-RPC publishing protocol.') ) );
47+ $Form->checkbox_input( 'general_xmlrpc_mt', $Settings->get('general_xmlrpc_mt'), T_('Enable Movable Type'), array( 'note' => T_('Enable the Movable Type XML-RPC publishing protocol.') ) );
48+$Form->end_fieldset();
49+
50+// --------------------------------------------
51+
52 $Form->begin_fieldset( get_manual_link( 'security-options' ).T_('Security options') );
53 $Form->text_input( 'user_minpwdlen', (int)$Settings->get( 'user_minpwdlen' ), 2, T_('Minimum password length'), T_('characters.'), array( 'maxlength'=>2, 'required'=>true ) );
54 $Form->checkbox_input( 'js_passwd_hashing', (bool)$Settings->get( 'js_passwd_hashing' ), T_('Login password hashing'), array( 'note'=>T_('Check to enable the login form to hash the password with Javascript before transmitting it. This provides extra security on non-SSL connections.')) );
55
56=== modified file 'qp_inc/xmlrpc/apis/_b2.api.php'
57--- qp_inc/xmlrpc/apis/_b2.api.php 2010-12-31 12:12:03 +0000
58+++ qp_inc/xmlrpc/apis/_b2.api.php 2012-07-23 07:49:20 +0000
59@@ -13,6 +13,12 @@
60 */
61 if( !defined('QP_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
62
63+if( ! $Settings->get('general_xmlrpc_b2') )
64+{ // We cannot use XML-RPC: send an error response ( "17 Internal server error" ).
65+ $errMessage = 'The B2 XML-RPC service is disabled on this system.';
66+ $errResponse = new xmlrpcresp( 0, 17, $errMessage );
67+ die( $errResponse->serialize() );
68+}
69
70 $b2newpost_doc='Adds a post, blogger-api like, +title +category +postdate';
71 $b2newpost_sig = array(array($xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcBoolean, $xmlrpcString, $xmlrpcString, $xmlrpcString));
72
73=== modified file 'qp_inc/xmlrpc/apis/_blogger.api.php'
74--- qp_inc/xmlrpc/apis/_blogger.api.php 2010-12-31 12:12:03 +0000
75+++ qp_inc/xmlrpc/apis/_blogger.api.php 2012-07-23 07:49:20 +0000
76@@ -15,6 +15,12 @@
77 */
78 if( !defined('QP_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
79
80+if( ! $Settings->get('general_xmlrpc_blogger') )
81+{ // We cannot use XML-RPC: send an error response ( "17 Internal server error" ).
82+ $errMessage = 'The Blogger XML-RPC service is disabled on this system.';
83+ $errResponse = new xmlrpcresp( 0, 17, $errMessage );
84+ die( $errResponse->serialize() );
85+}
86
87 $bloggernewpost_doc = 'Adds a post, blogger-api like';
88 $bloggernewpost_sig = array(array($xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcBoolean));
89
90=== modified file 'qp_inc/xmlrpc/apis/_metaweblog.api.php'
91--- qp_inc/xmlrpc/apis/_metaweblog.api.php 2010-12-31 12:12:03 +0000
92+++ qp_inc/xmlrpc/apis/_metaweblog.api.php 2012-07-23 07:49:20 +0000
93@@ -16,6 +16,12 @@
94 */
95 if( !defined('QP_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
96
97+if( ! $Settings->get('general_xmlrpc_metaweblog') )
98+{ // We cannot use XML-RPC: send an error response ( "17 Internal server error" ).
99+ $errMessage = 'The Metaweblog XML-RPC service is disabled on this system.';
100+ $errResponse = new xmlrpcresp( 0, 17, $errMessage );
101+ die( $errResponse->serialize() );
102+}
103
104 /**
105 * Decode the dateCreated
106
107=== modified file 'qp_inc/xmlrpc/apis/_mt.api.php'
108--- qp_inc/xmlrpc/apis/_mt.api.php 2010-12-31 12:12:03 +0000
109+++ qp_inc/xmlrpc/apis/_mt.api.php 2012-07-23 07:49:20 +0000
110@@ -17,7 +17,12 @@
111 */
112 if( !defined('QP_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
113
114-
115+if( ! $Settings->get('general_xmlrpc_mt') )
116+{ // We cannot use XML-RPC: send an error response ( "17 Internal server error" ).
117+ $errMessage = 'The Movable Type XML-RPC service is disabled on this system.';
118+ $errResponse = new xmlrpcresp( 0, 17, $errMessage );
119+ die( $errResponse->serialize() );
120+}
121
122 $mt_setPostCategories_sig = array(array($xmlrpcBoolean, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcArray));
123 $mt_setPostCategories_doc = 'Sets the categories for a post.';
124
125=== modified file 'qp_srvc/rsd.php'
126--- qp_srvc/rsd.php 2010-12-31 12:12:03 +0000
127+++ qp_srvc/rsd.php 2012-07-23 07:49:20 +0000
128@@ -37,20 +37,28 @@
129 <engineLink><?php echo $app_homepage; ?></engineLink>
130 <homePageLink><?php echo $app_baseurl; ?></homePageLink>
131 <apis>
132- <api name="MetaWeblog" preferred="true" apiLink="<?php echo $srvc_url; ?>xmlrpc.php"<?php
133+ <?php if( $Settings->get('general_xmlrpc_metaweblog') )
134+ {?>
135+ <api name="MetaWeblog" preferred="true" apiLink="<?php echo $srvc_url; ?>xmlrpc.php"<?php
136 if( !empty($blog) ) { echo ' blogID="'.$blog.'"'; }
137 ?>>
138 <settings>
139 <docs>http://manual.b2evolution.net/MetaWeblog_API</docs>
140 </settings>
141 </api>
142- <api name="MovableType" preferred="false" apiLink="<?php echo $srvc_url; ?>xmlrpc.php"<?php
143+ <?}?>
144+ <?php if( $Settings->get('general_xmlrpc_mt') )
145+ {?>
146+ <api name="MovableType" preferred="false" apiLink="<?php echo $srvc_url; ?>xmlrpc.php"<?php
147 if( !empty($blog) ) { echo ' blogID="'.$blog.'"'; }
148 ?>>
149 <settings>
150 <docs>http://manual.b2evolution.net/MovableType_API</docs>
151 </settings>
152 </api>
153+ <?}?>
154+ <?php if( $Settings->get('general_xmlrpc_blogger') )
155+ {?>
156 <api name="Blogger" preferred="false" apiLink="<?php echo $srvc_url; ?>xmlrpc.php"<?php
157 if( !empty($blog) ) { echo ' blogID="'.$blog.'"'; }
158 ?>>
159@@ -58,6 +66,9 @@
160 <docs>http://manual.b2evolution.net/Blogger_API</docs>
161 </settings>
162 </api>
163+ <?}?>
164+ <?php if( $Settings->get('general_xmlrpc_b2') )
165+ {?>
166 <api name="b2" preferred="false" apiLink="<?php echo $srvc_url; ?>xmlrpc.php"<?php
167 if( !empty($blog) ) { echo ' blogID="'.$blog.'"'; }
168 ?>>
169@@ -65,6 +76,7 @@
170 <docs>http://manual.b2evolution.net/B2_API</docs>
171 </settings>
172 </api>
173+ <?}?>
174 </apis>
175 </service>
176 </rsd>
177
178=== modified file 'qp_srvc/xmlrpc.php'
179--- qp_srvc/xmlrpc.php 2010-12-31 12:12:03 +0000
180+++ qp_srvc/xmlrpc.php 2012-07-23 07:49:20 +0000
181@@ -41,7 +41,6 @@
182 die( $errResponse->serialize() );
183 }
184
185-
186 // We can't display standard error messages. We must return XMLRPC responses.
187 $DB->halt_on_error = false;
188 $DB->show_errors = false;

Subscribers

People subscribed via source and target branches