156a157,161 > > // Extensions for Plugin management > 'wp.getPluginList' => 'this:wp_getPluginList', > 'wp.activatePlugin' => 'this:wp_activatePlugin', > 'wp.deactivatePlugin' => 'this:wp_deactivatePlugin', 1335a1341,1361 > > /** > * Retrieve list of plugins > * > * @since 3.0.0 > * > * @param array $args Method parameters. > * @return array > */ > function wp_getPluginList($args) { > $this->escape( $args ); > > $blog_id = (int) $args[0]; > $username = $args[1]; > $password = $args[2]; > > if ( !$user = $this->login($username, $password) ) > return $this->error; > > if ( ! current_user_can('activate_plugins') ) > return new IXR_Error( 403, __( 'You are not allowed access to details about plugins.' ) ); 1336a1363,1426 > do_action('xmlrpc_call', 'wp.getPluginList'); > return get_plugins( ); > } > > /** > * Activate a plugin > * > * @since 3.0.0 > * > * @param array $args Method parameters. > * @return boolean > */ > function wp_activatePlugin($args) { > $this->escape( $args ); > > $blog_id = (int) $args[0]; // Not used for now > $username = $args[1]; > $password = $args[2]; > $plugin = $args[3]; > > if ( !$user = $this->login($username, $password) ) > return $this->error; > > if ( ! current_user_can('activate_plugins') ) > return new IXR_Error( 403, __( 'You are not allowed access to details about plugins.' ) ); > > do_action('xmlrpc_call', 'wp.activatePlugin'); > > if (gettype(activate_plugin( $plugin, $redirect = '')) == 'WP_Error') { > return false; > } else { > return true; > } > } > > /** > * Deactivate a plugin > * > * @since 3.0.0 > * > * @param array $args Method parameters. > * @return boolean > */ > function wp_deactivatePlugin($args) { > $this->escape( $args ); > > $blog_id = (int) $args[0]; // Not used for now > $username = $args[1]; > $password = $args[2]; > $plugin = $args[3]; > > if ( !$user = $this->login($username, $password) ) > return $this->error; > > if ( ! current_user_can('activate_plugins') ) > return new IXR_Error( 403, __( 'You are not allowed access to details about plugins.' ) ); > > do_action('xmlrpc_call', 'wp.deactivatePlugin'); > > $plugin = array($plugin); > deactivate_plugins( $plugin, true ); > return true; > } >