Skip to content

Commit 6ceda71

Browse files
author
Amol Thite
committed
feat: 2.0 Decouple the CRUD operation
1 parent c52452d commit 6ceda71

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

src/users.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,6 @@ public function __construct(&$subject, $config = array())
2626
$this->setResourceAccess('login', 'public','get');
2727
$this->setResourceAccess('users', 'public', 'post');
2828
$this->setResourceAccess('config', 'public', 'get');
29+
$this->setResourceAccess('user', 'public', 'post');
2930
}
3031
}

src/users/user.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,12 @@ public function post()
3030
{
3131
$app = JFactory::getApplication();
3232
$userIdentifier = $app->input->get('id', 0, 'String');
33-
$formData = array();
34-
$formData['username'] = $app->input->get('username', 0, 'String');
35-
$formData['name'] = $app->input->get('name', 0, 'String');
36-
$formData['email'] = $app->input->get('email', 0, 'String');
37-
$formData['enabled'] = $app->input->get('enabled', 0, 'int');
38-
$formData['activation'] = $app->input->get('activation', 0, 'int');
39-
$formData['password'] = $app->input->get('password', 0, 'String');
40-
$formData['groups'] = $app->input->get('groups', 0, 'Array');
41-
33+
$formData = $app->input->getArray();
4234
$params = JComponentHelper::getParams("com_users");
4335
$response = new stdClass;
4436

4537
$xidentifier = $app->input->server->get('HTTP_IDENTIFIER');
46-
$fidentifier = $app->input->server->get('HTTP_FOURCECREATE');
38+
$fidentifier = $app->input->server->get('HTTP_FORCECREATE');
4739

4840
if ($formData['username'] == '' || $formData['name'] == '' || $formData['email'] == '')
4941
{

0 commit comments

Comments
 (0)