1. vitalyb
  2. Support
  3. Monday, August 15 2016, 09:10 AM
Hi there.
I am using easyprofile for a while and really happy this it.
Now, following some updates on the site, i need to find creative way to communicate with some external web services for field validation. Example:
On registration i am asking user to enter 2 fields, s/n and customer id. I need to do a validation with Web Services that we build via rest, json or soap that the entered data are correct to allow registration, otherwise notify error depend on wrong field (1,2).
How can i implement this?

Thanks you for best service in Joomla components :-)

br,
Vitaly
Attachments (1)
admin Accepted Answer
Admin
Hi,
sorry but Easy Profile do not do this, but it extends Joomla user management (not replace), so you can create a user plugin to check user information before store. Keep in mind that something like this requires many PHP and Joomla Dev knowledge.

for example you can write a user plugin with code like this:


public function onUserBeforeSave($user, $isnew, $data)
{

$codeSN = $data['code_sn'];
$customerID = $data['customer_id'];

/* CODE TO CHECK - START */
.......
/* If ok store true in $result var otherwise store false */
.......
/* CODE TO CHECK - END */

if($result==false)
{
$app=JFactory::getApplication();
$app->enqueueMessage('HERE YOUR ERROR MESSAGE','error');
}

return $result;
}



NOTE: this code is not tested and not supported, this is only for example purpose.

some docs about Joomla events at https://docs.joomla.org/Plugin/Events/User
  1. more than a month ago
  2. Support
  3. # 1
vitalyb Accepted Answer
Pro
I see.
will this plugin validate and notify the field while user registering with Easyprofile? or only after "register" button is entered?
  1. more than a month ago
  2. Support
  3. # 2
admin Accepted Answer
Admin
This is only server side check, so after user click on register button.
  1. more than a month ago
  2. Support
  3. # 3
vitalyb Accepted Answer
Pro
If returned info was false, will user get the registration complete?
also, are you doing custom dev projects? - this one :-)
  1. more than a month ago
  2. Support
  3. # 4
admin Accepted Answer
Admin
if $return is false the registration will not be complete and user return in registration page with message error.

are you doing custom dev projects?
No sorry.
  1. more than a month ago
  2. Support
  3. # 5
vitalyb Accepted Answer
Pro
Oh I see.
Well just to confirm, for my issue, i need to create custom plugin using joomla Authentication, perform the send and confirm functions , witch will allow registration or deny with error message and redirect to registration page. True?
Another question, are the flow similar for "Update" on user profile (easyprofile component)? Will it use the same plugin or i need to write another one?>
  1. more than a month ago
  2. Support
  3. # 6
admin Accepted Answer
Admin
plugin using joomla Authentication, perform the send and confirm functions , witch will allow registration or deny with error message and redirect to registration page. True?


No, you need to create User Plugin (not authentication plugin).

Another question, are the flow similar for "Update" on user profile (easyprofile component)? Will it use the same plugin or i need to write another one?
same plugins, Easy Profile extends Joomla user management (not replace), so registration and edit profile pages are the same of Joomla (custom fields are added by plugins and tabs by simple javascript). The workflow is the same of Joomla. In addition we will add some other triggers (http://docs.easy-profile.com/index.php/article/triggers).
  1. more than a month ago
  2. Support
  3. # 7
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.