PluginProbe
JSON API Auth / 0.1
JSON API Auth v0.1
3.1.2 3.1.1 2.0.0 2.1.0 2.2.0 2.3.0 2.4.0 2.5.0 2.6.0 2.7.0 2.7.1 2.8.0 2.9.0 2.9.1 3.0.0 3.1.0 trunk 0.1 1.0 1.1 1.2 1.3 1.4 1.5 1.5.1 All 33 releases
json-api-auth / json-api-auth.php

json-api-auth.php in JSON API Auth 0.1, at json-api-auth.php

38 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /*
4 Plugin Name: JSON API Auth
5 Plugin URI: http://downloads.wordpress.org/plugin/json-api-auth.zip
6 Description: Extends the JSON API for user authentiocation utilizing the Wordpress cookie validation and generation.
7 Version: 0.1
8 Author: mattberg, Ali Qureshi
9 Author URI: http://www.parorrey.com
10 License: GPLv3
11 */
12
13 include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
14 define('JSON_API_AUTH_HOME', dirname(__FILE__));
15
16 if (!is_plugin_active('json-api/json-api.php')) {
17 add_action('admin_notices', 'pim_auth_draw_notice_json_api');
18 return;
19 }
20
21 add_filter('json_api_controllers', 'pimAuthJsonApiController');
22 add_filter('json_api_auth_controller_path', 'setAuthControllerPath');
23 load_plugin_textdomain('json-api-auth', false, basename(dirname(__FILE__)) . '/languages');
24
25 function pim_auth_draw_notice_json_api() {
26 echo '<div id="message" class="error fade"><p style="line-height: 150%">';
27 _e('<strong>JSON API Auth</strong></a> requires the JSON API plugin to be activated. Please <a href="wordpress.org/plugins/json-api/‎">install / activate JSON API</a> first.', 'json-api-user');
28 echo '</p></div>';
29 }
30
31 function pimAuthJsonApiController($aControllers) {
32 $aControllers[] = 'Auth';
33 return $aControllers;
34 }
35
36 function setAuthControllerPath($sDefaultPath) {
37 return dirname(__FILE__) . '/controllers/Auth.php';
38 }