Merge lp:~leeturner/quam-plures/xmlrpc_off into lp:quam-plures
- xmlrpc_off
- Merge into trunk
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 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
EdB | Approve | ||
Review via email: mp+116129@code.launchpad.net |
Commit message
Description of the change
http://
Allows you to enable or disable each of the xml-rpc API individually.
To post a comment you must log in.
- 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.
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 | 86 | */ | 86 | */ |
6 | 87 | 87 | ||
7 | 88 | $Settings->delete_array( array( | 88 | $Settings->delete_array( array( |
8 | 89 | 'general_xmlrpc_b2', | ||
9 | 90 | 'general_xmlrpc_blogger', | ||
10 | 91 | 'general_xmlrpc_metaweblog', | ||
11 | 92 | 'general_xmlrpc_mt', | ||
12 | 89 | 'outbound_notifications_mode', | 93 | 'outbound_notifications_mode', |
13 | 90 | 'eblog_enabled', | 94 | 'eblog_enabled', |
14 | 91 | 'eblog_method', | 95 | 'eblog_method', |
15 | @@ -134,6 +138,19 @@ | |||
16 | 134 | } | 138 | } |
17 | 135 | else | 139 | else |
18 | 136 | { | 140 | { |
19 | 141 | // Remote publishing | ||
20 | 142 | param( 'general_xmlrpc_b2', 'boolean', 0 ); | ||
21 | 143 | $Settings->set( 'general_xmlrpc_b2', $general_xmlrpc_b2 ); | ||
22 | 144 | |||
23 | 145 | param( 'general_xmlrpc_blogger', 'boolean', 0 ); | ||
24 | 146 | $Settings->set( 'general_xmlrpc_blogger', $general_xmlrpc_blogger ); | ||
25 | 147 | |||
26 | 148 | param( 'general_xmlrpc_metaweblog', 'boolean', 0 ); | ||
27 | 149 | $Settings->set( 'general_xmlrpc_metaweblog', $general_xmlrpc_metaweblog ); | ||
28 | 150 | |||
29 | 151 | param( 'general_xmlrpc_mt', 'boolean', 0 ); | ||
30 | 152 | $Settings->set( 'general_xmlrpc_mt', $general_xmlrpc_mt ); | ||
31 | 153 | |||
32 | 137 | // After each new post... | 154 | // After each new post... |
33 | 138 | param( 'outbound_notifications_mode', 'string', true ); | 155 | param( 'outbound_notifications_mode', 'string', true ); |
34 | 139 | $Settings->set( 'outbound_notifications_mode', get_param('outbound_notifications_mode') ); | 156 | $Settings->set( 'outbound_notifications_mode', get_param('outbound_notifications_mode') ); |
35 | 140 | 157 | ||
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 | 199 | 199 | ||
41 | 200 | // -------------------------------------------- | 200 | // -------------------------------------------- |
42 | 201 | 201 | ||
43 | 202 | $Form->begin_fieldset( get_manual_link('remote_publishing').T_('Remote publishing') ); | ||
44 | 203 | $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 | 204 | $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 | 205 | $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 | 206 | $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 | 207 | $Form->end_fieldset(); | ||
49 | 208 | |||
50 | 209 | // -------------------------------------------- | ||
51 | 210 | |||
52 | 202 | $Form->begin_fieldset( get_manual_link( 'security-options' ).T_('Security options') ); | 211 | $Form->begin_fieldset( get_manual_link( 'security-options' ).T_('Security options') ); |
53 | 203 | $Form->text_input( 'user_minpwdlen', (int)$Settings->get( 'user_minpwdlen' ), 2, T_('Minimum password length'), T_('characters.'), array( 'maxlength'=>2, 'required'=>true ) ); | 212 | $Form->text_input( 'user_minpwdlen', (int)$Settings->get( 'user_minpwdlen' ), 2, T_('Minimum password length'), T_('characters.'), array( 'maxlength'=>2, 'required'=>true ) ); |
54 | 204 | $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.')) ); | 213 | $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 | 205 | 214 | ||
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 | 13 | */ | 13 | */ |
61 | 14 | if( !defined('QP_MAIN_INIT') ) die( 'Please, do not access this page directly.' ); | 14 | if( !defined('QP_MAIN_INIT') ) die( 'Please, do not access this page directly.' ); |
62 | 15 | 15 | ||
63 | 16 | if( ! $Settings->get('general_xmlrpc_b2') ) | ||
64 | 17 | { // We cannot use XML-RPC: send an error response ( "17 Internal server error" ). | ||
65 | 18 | $errMessage = 'The B2 XML-RPC service is disabled on this system.'; | ||
66 | 19 | $errResponse = new xmlrpcresp( 0, 17, $errMessage ); | ||
67 | 20 | die( $errResponse->serialize() ); | ||
68 | 21 | } | ||
69 | 16 | 22 | ||
70 | 17 | $b2newpost_doc='Adds a post, blogger-api like, +title +category +postdate'; | 23 | $b2newpost_doc='Adds a post, blogger-api like, +title +category +postdate'; |
71 | 18 | $b2newpost_sig = array(array($xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcBoolean, $xmlrpcString, $xmlrpcString, $xmlrpcString)); | 24 | $b2newpost_sig = array(array($xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcBoolean, $xmlrpcString, $xmlrpcString, $xmlrpcString)); |
72 | 19 | 25 | ||
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 | 15 | */ | 15 | */ |
78 | 16 | if( !defined('QP_MAIN_INIT') ) die( 'Please, do not access this page directly.' ); | 16 | if( !defined('QP_MAIN_INIT') ) die( 'Please, do not access this page directly.' ); |
79 | 17 | 17 | ||
80 | 18 | if( ! $Settings->get('general_xmlrpc_blogger') ) | ||
81 | 19 | { // We cannot use XML-RPC: send an error response ( "17 Internal server error" ). | ||
82 | 20 | $errMessage = 'The Blogger XML-RPC service is disabled on this system.'; | ||
83 | 21 | $errResponse = new xmlrpcresp( 0, 17, $errMessage ); | ||
84 | 22 | die( $errResponse->serialize() ); | ||
85 | 23 | } | ||
86 | 18 | 24 | ||
87 | 19 | $bloggernewpost_doc = 'Adds a post, blogger-api like'; | 25 | $bloggernewpost_doc = 'Adds a post, blogger-api like'; |
88 | 20 | $bloggernewpost_sig = array(array($xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcBoolean)); | 26 | $bloggernewpost_sig = array(array($xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcBoolean)); |
89 | 21 | 27 | ||
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 | 16 | */ | 16 | */ |
95 | 17 | if( !defined('QP_MAIN_INIT') ) die( 'Please, do not access this page directly.' ); | 17 | if( !defined('QP_MAIN_INIT') ) die( 'Please, do not access this page directly.' ); |
96 | 18 | 18 | ||
97 | 19 | if( ! $Settings->get('general_xmlrpc_metaweblog') ) | ||
98 | 20 | { // We cannot use XML-RPC: send an error response ( "17 Internal server error" ). | ||
99 | 21 | $errMessage = 'The Metaweblog XML-RPC service is disabled on this system.'; | ||
100 | 22 | $errResponse = new xmlrpcresp( 0, 17, $errMessage ); | ||
101 | 23 | die( $errResponse->serialize() ); | ||
102 | 24 | } | ||
103 | 19 | 25 | ||
104 | 20 | /** | 26 | /** |
105 | 21 | * Decode the dateCreated | 27 | * Decode the dateCreated |
106 | 22 | 28 | ||
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 | 17 | */ | 17 | */ |
112 | 18 | if( !defined('QP_MAIN_INIT') ) die( 'Please, do not access this page directly.' ); | 18 | if( !defined('QP_MAIN_INIT') ) die( 'Please, do not access this page directly.' ); |
113 | 19 | 19 | ||
115 | 20 | 20 | if( ! $Settings->get('general_xmlrpc_mt') ) | |
116 | 21 | { // We cannot use XML-RPC: send an error response ( "17 Internal server error" ). | ||
117 | 22 | $errMessage = 'The Movable Type XML-RPC service is disabled on this system.'; | ||
118 | 23 | $errResponse = new xmlrpcresp( 0, 17, $errMessage ); | ||
119 | 24 | die( $errResponse->serialize() ); | ||
120 | 25 | } | ||
121 | 21 | 26 | ||
122 | 22 | $mt_setPostCategories_sig = array(array($xmlrpcBoolean, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcArray)); | 27 | $mt_setPostCategories_sig = array(array($xmlrpcBoolean, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcArray)); |
123 | 23 | $mt_setPostCategories_doc = 'Sets the categories for a post.'; | 28 | $mt_setPostCategories_doc = 'Sets the categories for a post.'; |
124 | 24 | 29 | ||
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 | 37 | <engineLink><?php echo $app_homepage; ?></engineLink> | 37 | <engineLink><?php echo $app_homepage; ?></engineLink> |
130 | 38 | <homePageLink><?php echo $app_baseurl; ?></homePageLink> | 38 | <homePageLink><?php echo $app_baseurl; ?></homePageLink> |
131 | 39 | <apis> | 39 | <apis> |
133 | 40 | <api name="MetaWeblog" preferred="true" apiLink="<?php echo $srvc_url; ?>xmlrpc.php"<?php | 40 | <?php if( $Settings->get('general_xmlrpc_metaweblog') ) |
134 | 41 | {?> | ||
135 | 42 | <api name="MetaWeblog" preferred="true" apiLink="<?php echo $srvc_url; ?>xmlrpc.php"<?php | ||
136 | 41 | if( !empty($blog) ) { echo ' blogID="'.$blog.'"'; } | 43 | if( !empty($blog) ) { echo ' blogID="'.$blog.'"'; } |
137 | 42 | ?>> | 44 | ?>> |
138 | 43 | <settings> | 45 | <settings> |
139 | 44 | <docs>http://manual.b2evolution.net/MetaWeblog_API</docs> | 46 | <docs>http://manual.b2evolution.net/MetaWeblog_API</docs> |
140 | 45 | </settings> | 47 | </settings> |
141 | 46 | </api> | 48 | </api> |
143 | 47 | <api name="MovableType" preferred="false" apiLink="<?php echo $srvc_url; ?>xmlrpc.php"<?php | 49 | <?}?> |
144 | 50 | <?php if( $Settings->get('general_xmlrpc_mt') ) | ||
145 | 51 | {?> | ||
146 | 52 | <api name="MovableType" preferred="false" apiLink="<?php echo $srvc_url; ?>xmlrpc.php"<?php | ||
147 | 48 | if( !empty($blog) ) { echo ' blogID="'.$blog.'"'; } | 53 | if( !empty($blog) ) { echo ' blogID="'.$blog.'"'; } |
148 | 49 | ?>> | 54 | ?>> |
149 | 50 | <settings> | 55 | <settings> |
150 | 51 | <docs>http://manual.b2evolution.net/MovableType_API</docs> | 56 | <docs>http://manual.b2evolution.net/MovableType_API</docs> |
151 | 52 | </settings> | 57 | </settings> |
152 | 53 | </api> | 58 | </api> |
153 | 59 | <?}?> | ||
154 | 60 | <?php if( $Settings->get('general_xmlrpc_blogger') ) | ||
155 | 61 | {?> | ||
156 | 54 | <api name="Blogger" preferred="false" apiLink="<?php echo $srvc_url; ?>xmlrpc.php"<?php | 62 | <api name="Blogger" preferred="false" apiLink="<?php echo $srvc_url; ?>xmlrpc.php"<?php |
157 | 55 | if( !empty($blog) ) { echo ' blogID="'.$blog.'"'; } | 63 | if( !empty($blog) ) { echo ' blogID="'.$blog.'"'; } |
158 | 56 | ?>> | 64 | ?>> |
159 | @@ -58,6 +66,9 @@ | |||
160 | 58 | <docs>http://manual.b2evolution.net/Blogger_API</docs> | 66 | <docs>http://manual.b2evolution.net/Blogger_API</docs> |
161 | 59 | </settings> | 67 | </settings> |
162 | 60 | </api> | 68 | </api> |
163 | 69 | <?}?> | ||
164 | 70 | <?php if( $Settings->get('general_xmlrpc_b2') ) | ||
165 | 71 | {?> | ||
166 | 61 | <api name="b2" preferred="false" apiLink="<?php echo $srvc_url; ?>xmlrpc.php"<?php | 72 | <api name="b2" preferred="false" apiLink="<?php echo $srvc_url; ?>xmlrpc.php"<?php |
167 | 62 | if( !empty($blog) ) { echo ' blogID="'.$blog.'"'; } | 73 | if( !empty($blog) ) { echo ' blogID="'.$blog.'"'; } |
168 | 63 | ?>> | 74 | ?>> |
169 | @@ -65,6 +76,7 @@ | |||
170 | 65 | <docs>http://manual.b2evolution.net/B2_API</docs> | 76 | <docs>http://manual.b2evolution.net/B2_API</docs> |
171 | 66 | </settings> | 77 | </settings> |
172 | 67 | </api> | 78 | </api> |
173 | 79 | <?}?> | ||
174 | 68 | </apis> | 80 | </apis> |
175 | 69 | </service> | 81 | </service> |
176 | 70 | </rsd> | 82 | </rsd> |
177 | 71 | 83 | ||
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 | 41 | die( $errResponse->serialize() ); | 41 | die( $errResponse->serialize() ); |
183 | 42 | } | 42 | } |
184 | 43 | 43 | ||
185 | 44 | |||
186 | 45 | // We can't display standard error messages. We must return XMLRPC responses. | 44 | // We can't display standard error messages. We must return XMLRPC responses. |
187 | 46 | $DB->halt_on_error = false; | 45 | $DB->halt_on_error = false; |
188 | 47 | $DB->show_errors = false; | 46 | $DB->show_errors = false; |
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.