Skip to content

Commit

Permalink
Issue techjoomla#19 feat: Add support for sign-in / sign-up using JFB…
Browse files Browse the repository at this point in the history
…Connect
  • Loading branch information
manojLondhe committed May 16, 2019
1 parent ce0937b commit 2a4e538
Show file tree
Hide file tree
Showing 5 changed files with 447 additions and 20 deletions.
13 changes: 13 additions & 0 deletions src/language/en-GB/en-GB.plg_api_users.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
; @package API
; @subpackage plg_api_users
;
; @author Techjoomla <[email protected]>
; @copyright Copyright (C) 2009 - 2019 Techjoomla, Tekdi Technologies Pvt. Ltd. All rights reserved.
; @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
; Note All ini files need to be saved as UTF-8

PLG_API_USERS="API - Users"
PLG_API_USERS_DESCRIPTION="This plugin exposes users to the Joomla! API. Supports creation, listing and login for users."
PLG_API_USERS_BAD_REQUEST_MESSAGE="Bad request"
Expand All @@ -15,3 +23,8 @@ PLG_API_USERS_UNSUPPORTED_METHOD_POST="unsupported method,please use get method"
PLG_API_USERS_USERS="users/"
PLG_API_USERS_IN_DELETE="in delete"
PLG_API_USERS_IN_POST="in post"

; Since v2.1.0
PLG_API_USERS_JFBCONNECT_NOT_INSTALLED="JFBConnect not installed or not enabled"
PLG_API_USERS_JFBCONNECT_MISSING_PROVIDER="Provider not sent"
PLG_API_USERS_JFBCONNECT_MISSING_ACCESS_TOKEN="Access token not sent"
24 changes: 14 additions & 10 deletions src/users.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
<?php
/**
* @package API plugins
* @copyright Copyright (C) 2009 2014 Techjoomla, Tekdi Technologies Pvt. Ltd. All rights reserved.
* @license GNU GPLv2 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
* @link http://www.techjoomla.com
*/
* @package API
* @subpackage plg_api_users
*
* @author Techjoomla <[email protected]>
* @copyright Copyright (C) 2009 - 2019 Techjoomla, Tekdi Technologies Pvt. Ltd. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
*/

defined('_JEXEC') or die( 'Restricted access' );
// No direct access.
defined('_JEXEC') or die('Restricted access');

jimport('joomla.plugin.plugin');

Expand All @@ -17,15 +20,16 @@ public function __construct(&$subject, $config = array())
parent::__construct($subject, $config = array());

ApiResource::addIncludePath(dirname(__FILE__).'/users');
/*load language file for plugin frontend*/
$lang = JFactory::getLanguage();

// Load language file for plugin frontend
$lang = JFactory::getLanguage();
$lang->load('plg_api_users', JPATH_ADMINISTRATOR,'',true);

// Set the login resource to be public
$this->setResourceAccess('login', 'public','get');
$this->setResourceAccess('users', 'public', 'post');
$this->setResourceAccess('config', 'public', 'get');
$this->setResourceAccess('user', 'public', 'post');
$this->setResourceAccess('jfbconnect', 'public', 'post');
}
}
Loading

0 comments on commit 2a4e538

Please sign in to comment.