Ticket #10789: xmlrpc.php.plugins.diff
File xmlrpc.php.plugins.diff, 3.6 KB (added by , 15 years ago) |
---|
-
wp-admin/includes/plugin.php
81 81 'TextDomain' => 'Text Domain', 82 82 'DomainPath' => 'Domain Path', 83 83 'Network' => 'Network', 84 'Active' => False, 84 85 // Site Wide Only is deprecated in favor of Network. 85 86 '_sitewide' => 'Site Wide Only', 86 87 ); … … 97 98 98 99 //For backward compatibility by default Title is the same as Name. 99 100 $plugin_data['Title'] = $plugin_data['Name']; 101 102 $plugin_data['Active'] = is_plugin_active(plugin_basename( $plugin_file ) ); 100 103 101 104 if ( $markup || $translate ) 102 105 $plugin_data = _get_plugin_data_markup_translate( $plugin_file, $plugin_data, $markup, $translate ); -
xmlrpc.php
154 154 'wp.editComment' => 'this:wp_editComment', 155 155 'wp.newComment' => 'this:wp_newComment', 156 156 'wp.getCommentStatusList' => 'this:wp_getCommentStatusList', 157 158 // Extensions for Plugin management 159 'wp.getPluginList' => 'this:wp_getPluginList', 160 'wp.activatePlugin' => 'this:wp_activatePlugin', 161 'wp.deactivatePlugin' => 'this:wp_deactivatePlugin', 157 162 163 158 164 // Blogger API 159 165 'blogger.getUsersBlogs' => 'this:blogger_getUsersBlogs', 160 166 'blogger.getUserInfo' => 'this:blogger_getUserInfo', … … 1333 1339 1334 1340 return get_comment_statuses( ); 1335 1341 } 1342 1343 /** 1344 * Retrieve list of plugins 1345 * 1346 * @since 3.0.0 1347 * 1348 * @param array $args Method parameters. 1349 * @return array 1350 */ 1351 function wp_getPluginList($args) { 1352 $this->escape( $args ); 1336 1353 1354 $blog_id = (int) $args[0]; 1355 $username = $args[1]; 1356 $password = $args[2]; 1357 1358 if ( !$user = $this->login($username, $password) ) 1359 return $this->error; 1360 1361 if ( ! current_user_can('activate_plugins') ) 1362 return new IXR_Error( 403, __( 'You are not allowed access to details about plugins.' ) ); 1363 1364 do_action('xmlrpc_call', 'wp.getPluginList'); 1365 return get_plugins( ); 1366 } 1367 1337 1368 /** 1369 * Activate a plugin 1370 * 1371 * @since 3.0.0 1372 * 1373 * @param array $args Method parameters. 1374 * @return boolean 1375 */ 1376 function wp_activatePlugin($args) { 1377 $this->escape( $args ); 1378 1379 $blog_id = (int) $args[0]; // Not used for now 1380 $username = $args[1]; 1381 $password = $args[2]; 1382 $plugin = $args[3]; 1383 1384 if ( !$user = $this->login($username, $password) ) 1385 return $this->error; 1386 1387 if ( ! current_user_can('activate_plugins') ) 1388 return new IXR_Error( 403, __( 'You are not allowed access to details about plugins.' ) ); 1389 1390 do_action('xmlrpc_call', 'wp.activatePlugin'); 1391 1392 if (gettype(activate_plugin( $plugin, $redirect = '')) == 'WP_Error') { 1393 return false; 1394 } else { 1395 return true; 1396 } 1397 } 1398 1399 /** 1400 * Deactivate a plugin 1401 * 1402 * @since 3.0.0 1403 * 1404 * @param array $args Method parameters. 1405 * @return boolean 1406 */ 1407 function wp_deactivatePlugin($args) { 1408 $this->escape( $args ); 1409 1410 $blog_id = (int) $args[0]; // Not used for now 1411 $username = $args[1]; 1412 $password = $args[2]; 1413 $plugin = $args[3]; 1414 1415 if ( !$user = $this->login($username, $password) ) 1416 return $this->error; 1417 1418 if ( ! current_user_can('activate_plugins') ) 1419 return new IXR_Error( 403, __( 'You are not allowed access to details about plugins.' ) ); 1420 1421 do_action('xmlrpc_call', 'wp.deactivatePlugin'); 1422 1423 $plugin = array($plugin); 1424 deactivate_plugins( $plugin, true ); 1425 return true; 1426 } 1427 1428 1429 /** 1338 1430 * Retrieve comment count. 1339 1431 * 1340 1432 * @since 2.5.0