Mercurial > defr > drupal > core
comparison includes/xmlrpcs.inc @ 7:fff6d4c8c043 6.3
Drupal 6.3
| author | Franck Deroche <webmaster@defr.org> |
|---|---|
| date | Tue, 23 Dec 2008 14:30:28 +0100 |
| parents | c1f4ac30525a |
| children |
comparison
equal
deleted
inserted
replaced
| 6:2cfdc3c92142 | 7:fff6d4c8c043 |
|---|---|
| 1 <?php | 1 <?php |
| 2 // $Id: xmlrpcs.inc,v 1.24 2007/12/31 08:54:36 dries Exp $ | 2 // $Id: xmlrpcs.inc,v 1.24.2.1 2008/04/28 10:04:52 dries Exp $ |
| 3 | 3 |
| 4 /** | 4 /** |
| 5 * The main entry point for XML-RPC requests. | 5 * The main entry point for XML-RPC requests. |
| 6 * | 6 * |
| 7 * @param $callbacks | 7 * @param $callbacks |
| 147 if ($args && !is_array($args)) { | 147 if ($args && !is_array($args)) { |
| 148 $args = array($args); | 148 $args = array($args); |
| 149 } | 149 } |
| 150 // Has this method been mapped to a Drupal function by us or by modules? | 150 // Has this method been mapped to a Drupal function by us or by modules? |
| 151 if (!isset($xmlrpc_server->callbacks[$methodname])) { | 151 if (!isset($xmlrpc_server->callbacks[$methodname])) { |
| 152 return xmlrpc_error(-32601, t('Server error. Requested method %methodname not specified.', array("%methodname" => $xmlrpc_server->message->methodname))); | 152 return xmlrpc_error(-32601, t('Server error. Requested method @methodname not specified.', array("@methodname" => $xmlrpc_server->message->methodname))); |
| 153 } | 153 } |
| 154 $method = $xmlrpc_server->callbacks[$methodname]; | 154 $method = $xmlrpc_server->callbacks[$methodname]; |
| 155 $signature = $xmlrpc_server->signatures[$methodname]; | 155 $signature = $xmlrpc_server->signatures[$methodname]; |
| 156 | 156 |
| 157 // If the method has a signature, validate the request against the signature | 157 // If the method has a signature, validate the request against the signature |
| 201 } | 201 } |
| 202 } | 202 } |
| 203 } | 203 } |
| 204 | 204 |
| 205 if (!function_exists($method)) { | 205 if (!function_exists($method)) { |
| 206 return xmlrpc_error(-32601, t('Server error. Requested function %method does not exist.', array("%method" => $method))); | 206 return xmlrpc_error(-32601, t('Server error. Requested function @method does not exist.', array("@method" => $method))); |
| 207 } | 207 } |
| 208 // Call the mapped function | 208 // Call the mapped function |
| 209 return call_user_func_array($method, $args); | 209 return call_user_func_array($method, $args); |
| 210 } | 210 } |
| 211 | 211 |
| 286 * and returns a string. | 286 * and returns a string. |
| 287 */ | 287 */ |
| 288 function xmlrpc_server_method_signature($methodname) { | 288 function xmlrpc_server_method_signature($methodname) { |
| 289 $xmlrpc_server = xmlrpc_server_get(); | 289 $xmlrpc_server = xmlrpc_server_get(); |
| 290 if (!isset($xmlrpc_server->callbacks[$methodname])) { | 290 if (!isset($xmlrpc_server->callbacks[$methodname])) { |
| 291 return xmlrpc_error(-32601, t('Server error. Requested method %methodname not specified.', array("%methodname" => $methodname))); | 291 return xmlrpc_error(-32601, t('Server error. Requested method @methodname not specified.', array("@methodname" => $methodname))); |
| 292 } | 292 } |
| 293 if (!is_array($xmlrpc_server->signatures[$methodname])) { | 293 if (!is_array($xmlrpc_server->signatures[$methodname])) { |
| 294 return xmlrpc_error(-32601, t('Server error. Requested method %methodname signature not specified.', array("%methodname" => $methodname))); | 294 return xmlrpc_error(-32601, t('Server error. Requested method @methodname signature not specified.', array("@methodname" => $methodname))); |
| 295 } | 295 } |
| 296 // We array of types | 296 // We array of types |
| 297 $return = array(); | 297 $return = array(); |
| 298 foreach ($xmlrpc_server->signatures[$methodname] as $type) { | 298 foreach ($xmlrpc_server->signatures[$methodname] as $type) { |
| 299 $return[] = $type; | 299 $return[] = $type; |
