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 authored and coolbung committed Jun 28, 2019
1 parent 6af5ca1 commit 8ffd8b3
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 444 deletions.
5 changes: 0 additions & 5 deletions src/language/en-GB/en-GB.plg_api_users.ini
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,3 @@ 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"
20 changes: 15 additions & 5 deletions src/users.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,33 @@

jimport('joomla.plugin.plugin');

class plgAPIUsers extends ApiPlugin
/**
* Users plgAPI class
*
* @since 1.0.0
*/
class PlgAPIUsers extends ApiPlugin
{
/**
* Constructor
*
* @param string &$subject subject
* @param string $config config
*/
public function __construct(&$subject, $config = array())
{
parent::__construct($subject, $config = array());

ApiResource::addIncludePath(dirname(__FILE__).'/users');
ApiResource::addIncludePath(dirname(__FILE__) . '/users');

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

// Set the login resource to be public
$this->setResourceAccess('login', 'public','get');
$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 8ffd8b3

Please sign in to comment.