From b088c84dcc7e07c6c37856aa28aa633a1b7a65b6 Mon Sep 17 00:00:00 2001 From: vaishali Date: Thu, 9 May 2019 18:15:51 +0530 Subject: [PATCH] Issue #15 fix: removed folders from fork --- elements/integration.php | 111 ------------ language/en-GB/en-GB.plg_api_users.ini | 10 -- language/en-GB/en-GB.plg_api_users.sys.ini | 8 - users.php | 43 ----- users.xml | 35 ---- users/user.php | 197 --------------------- 6 files changed, 404 deletions(-) delete mode 100644 elements/integration.php delete mode 100644 language/en-GB/en-GB.plg_api_users.ini delete mode 100644 language/en-GB/en-GB.plg_api_users.sys.ini delete mode 100644 users.php delete mode 100644 users.xml delete mode 100644 users/user.php diff --git a/elements/integration.php b/elements/integration.php deleted file mode 100644 index cec2342..0000000 --- a/elements/integration.php +++ /dev/null @@ -1,111 +0,0 @@ - - * @package Com_Tjlms - * @copyright Copyright (C) 2005 - 2014. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE.txt - * Shika is free software. This version may have been modified pursuant - * to the GNU General Public License, and as distributed it includes or - * is derivative of works licensed under the GNU General Public License or - * other free or open source software licenses. - */ - -// No direct access -defined('_JEXEC') or die; - -jimport('joomla.html.pane'); -jimport('joomla.application.component.helper'); -jimport('joomla.filesystem.folder'); -jimport('joomla.form.formfield'); - -/** - * Class for custom Integration element - * - * @since 1.0.0 - */ -class JFormFieldIntegration extends JFormField -{ - /** - * Function to genarate html of custom element - * - * @return HTML - * - * @since 1.0.0 - */ - public function getInput() - { - return $this->fetchElement($this->name, $this->value, $this->element, $this->options['controls']); - } - - /** - * Function to genarate html of custom element - * - * @param STRING $name Name of the element - * @param STRING $value Default value of the element - * @param STRING $node asa - * @param STRING $control_name asda - * - * @return HTML - * - * @since 1.0.0 - */ - public function fetchElement($name, $value, $node, $control_name) - { - $communitymainfile = JPATH_SITE . '/components/com_community/libraries/core.php'; - $esfolder = JPATH_SITE . '/components/com_easysocial'; - - $jsString = ""; - echo $jsString; - - $options[] = JHTML::_('select.option', 'joomla', JText::_('PLG_USER_API_JOOMLA')); - /* $options[] = JHTML::_('select.option', 'jomsocial', JText::_('PLG_USER_API_JOMSOCIAL')); */ - $options[] = JHTML::_('select.option', 'easysocial', JText::_('PLG_USER_API_EASYSOCIAL')); - - $fieldName = $name; - - return JHtml::_('select.genericlist', - $options, $fieldName, - 'class="inputbox tjlmsintegration btn-group" onchange="checkIfExtInstalled(this.name, this.value)" ', - 'value', 'text', $value, $control_name . $name - ); - } -} diff --git a/language/en-GB/en-GB.plg_api_users.ini b/language/en-GB/en-GB.plg_api_users.ini deleted file mode 100644 index 4be7780..0000000 --- a/language/en-GB/en-GB.plg_api_users.ini +++ /dev/null @@ -1,10 +0,0 @@ -; -PLG_API_USERS="API - USERS" -PLG_API_USERS_DESCRIPTION="This plugin exposes Joomla! user CRUD API. suppose create, update, delete, get user and get users" -PLG_USER_API_SOCIAL_INTEGRATION_LABEL="Select Social Integration" -PLG_USER_API_SOCIAL_INTEGRATION_DESC="Selected Social component's user custom fields will be created after Joomla user creation or updating" - -:Social Integration -PLG_USER_API_JOOMLA="Joomla" -PLG_USER_API_JOMSOCIAL="JomSocial" -PLG_USER_API_EASYSOCIAL="EasySocial" \ No newline at end of file diff --git a/language/en-GB/en-GB.plg_api_users.sys.ini b/language/en-GB/en-GB.plg_api_users.sys.ini deleted file mode 100644 index 670ea2c..0000000 --- a/language/en-GB/en-GB.plg_api_users.sys.ini +++ /dev/null @@ -1,8 +0,0 @@ -; Joomla! Project -; Copyright (C) 2005 - 2017 Open Source Matters. All rights reserved. -; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php -; Note : All ini files need to be saved as UTF-8 - -PLG_API_USERS="API - USERS" -PLG_API_USERS_DESCRIPTION="This plugin exposes Joomla! user CRUD API. suppose create, update, delete, get user and get users" - diff --git a/users.php b/users.php deleted file mode 100644 index d4136db..0000000 --- a/users.php +++ /dev/null @@ -1,43 +0,0 @@ -load('plg_api_users', JPATH_ADMINISTRATOR, '', true); - $this->setResourceAccess('login', 'public','get'); - $this->setResourceAccess('user', 'public', 'post'); - $this->setResourceAccess('config', 'public', 'get'); - } -} diff --git a/users.xml b/users.xml deleted file mode 100644 index 8f09041..0000000 --- a/users.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - PLG_API_USERS - 1.8.7 - 10/11/2014 - Techjoomla - extensions@techjoomla.com - www.techjoomla.com - Techjoomla. All rights reserved. - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL - PLG_API_USERS_DESCRIPTION - - users.php - users - elements - - - en-GB/en-GB.plg_api_users.ini - en-GB/en-GB.plg_api_users.sys.ini - - - -
- - -
-
-
-
diff --git a/users/user.php b/users/user.php deleted file mode 100644 index f8c7af3..0000000 --- a/users/user.php +++ /dev/null @@ -1,197 +0,0 @@ -result = new stdClass; - - $identifier = $app->input->server->get('HTTP_X_IDENTIFIER'); - - $data = array(); - - if (!$identifier || $identifier == 'id') - { - $data['id'] = $app->input->getInt('id', 0, 'INT'); - } - else - { - if (!in_array($identifier, array('id', 'email', 'username'))) - { - ApiError::raiseError("400", JText::_('PLG_API_USERS_INCORRECT_IDENTIFIER'), 'APIValidationException'); - - return $returnData; - } - - $temp = $app->input->getString('id'); - - if ($identifier == 'username') - { - $data['id'] = JUserHelper::getUserId($temp); - } - elseif ($identifier == 'email') - { - $data['id'] = $this->getUserId($temp); - } - } - - $groups = array(2); - - $user = new JUser($data['id']); - - if ($user->id) - { - $groups = $app->input->get('groups', array(), 'ARRAY'); - - if (empty($groups)) - { - $groups = $user->groups; - } - } - /*else - { - ApiError::raiseError("400", JText::_('PLG_API_USERS_USER_DOES_NOT_EXISTS'), 'APIValidationException'); - - return $returnData; - }*/ - - - $data['username'] = $app->input->getString('username', $user->get('username')); - $data['name'] = $app->input->getString('name', $user->get('name')); - $data['password'] = $app->input->getString('password', ''); - $data['email'] = $app->input->getString('email', $user->get('email')); - $data['groups'] = $app->input->get('groups', $groups, 'ARRAY'); - $data['block'] = $app->input->getInt('block', $user->get('block')); - $data['fields'] = $app->input->get('fields', '', 'ARRAY'); - - $newUser = false; - - if ($data['id'] == '' && ($data['name'] == '' || $data['email'] == '')) - { - ApiError::raiseError("400", JText::_('PLG_API_USERS_REQUIRED_DATA_EMPTY_MESSAGE'), 'APIValidationException'); - - return $returnData; - } - - - if (!$data['username']) - { - $data['username'] = $data['email']; - } - - // Check new or old user - if (!$user->id) - { - $newUser = true; - } - //echo $newUser; - //print_r($user); - if ($user->bind($data)) - { - // If $newUser is true it will update the user else create new user - //print_r($user);die; - - if ($user->save()) - { - if ($data['fields']) - { - $libraryObject = $this->getSocialLibraryObject(); - $libraryObject->addUserFields($data['fields'], $user->id); - } - - unset($data['password']); - unset($data['password2']); - - $data['id'] = $user->id; - $returnData->result = $data; - $this->plugin->setResponse($returnData); - - return $returnData; - } - } - - ApiError::raiseError("400", $user->getError()); - - return $returnData; - } - - /** - * Returns userid if a user exists - * - * @param string $email The email to search on. - * - * @return integer The user id or 0 if not found. - * - * @since 11.1 - */ - private function getUserId($email) - { - // Initialise some variables - $db = \JFactory::getDbo(); - $query = $db->getQuery(true) - ->select($db->quoteName('id')) - ->from($db->quoteName('#__users')) - ->where($db->quoteName('email') . ' = ' . $db->quote($email)); - $db->setQuery($query, 0, 1); - - return $db->loadResult(); - } - /** - * Get social library object depending on the integration set. - * - * @return Soical library object - * - * @since 1.0.0 - */ - public function getSocialLibraryObject() - { - $plugin = JPluginHelper::getPlugin('api', 'users'); - $params = new JRegistry($plugin->params); - $socialIntegration = $params->get('social_integration', 'joomla'); - - if ($socialIntegration == 'joomla') - { - jimport('techjoomla.jsocial.joomla'); - $SocialLibraryObject = new JSocialJoomla; - } - elseif ($socialIntegration == 'jomsocial') - { - jimport('techjoomla.jsocial.jomsocial'); - $SocialLibraryObject = new JSocialJomSocial; - } - elseif ($socialIntegration == 'easysocial') - { - jimport('techjoomla.jsocial.easysocial'); - $SocialLibraryObject = new JSocialEasySocial; - } - - return $SocialLibraryObject; - } -}