1. stefphann
  2. Support
  3. Monday, November 17 2014, 06:25 PM
Hello,

Your extension is really great but i have an issue.
I use it in email login type. I need users log in with their email and it works.
But i use the kunena forum too and i need so they choose a username for the forum which is the joomla username.

My question is : how can i create a custom text field save in username field and type (in create and edit modes) ?
admin Accepted Answer
Admin
Hi,
you can create simple plugin to do this, follow these steps:
- Download, install and enable (from plugin manager) our skeleton plugin (you can download this at the end of page https://www.easy-profile.com/docs/44-triggers.html)
- Edit file /plugins/jsn/skeleton/skeleton.php
- Delete example functions: triggerFieldAvatarUpdate, triggerProfileUpdate
- Add this function
triggerFieldAvatarUpdate($user,&$data,$changed,$isNew){
$db=JFactory::getDbo();
$query='UPDATE #__users SET username='.$db->quote($data['custom_field_alias']).' WHERE id='.$user->id;
$db->setQuery($query);
$db->execute();
}


This query put into 'username' field into database the value of field 'custom_field_alias'

NOTE: this code is not tested and not supported and requires minimun PHP and Joomla knowledge.
  1. more than a month ago
  2. Support
  3. # 1
stefphann Accepted Answer
Hello,

I put in skeleton, the function triggerFieldAvatarUpdate($user,&$data,$changed,$isNew) {
XXX
}
and it didn't work

in fact it works now with the triggerProfileUpdate function
  1. more than a month ago
  2. Support
  3. # 2
admin Accepted Answer
Admin
Hi,
sorry, my error :p
  1. more than a month ago
  2. Support
  3. # 3
stefphann Accepted Answer
Content Protected
  1. more than a month ago
  2. Support
  3. # 4
stefphann Accepted Answer
Hello,

Could u help me with this issue i'm completely stuck :

is there a way to verify if the pseudonyme (username) already exists in the database ?
if yes and not the same userid -> error message and it doesn't save or create the profile
If not -> save or create the profile

thx
  1. more than a month ago
  2. Support
  3. # 5
admin Accepted Answer
Admin
Hi,
sorry this is not possible, Easy Profile extends Joomla user profile, so our triggers are launched after Joomla users plugins.

Example: when user register profile, the system register account and after our events are trigger.

We recommend you to use "Username & Email" to do this.
  1. more than a month ago
  2. Support
  3. # 6
stefphann Accepted Answer
Content Protected
  1. more than a month ago
  2. Support
  3. # 7
admin Accepted Answer
Admin
Joomla generate a mail into /components/com_users/models/registration.php
so you can replace $data['username'] with $data['email'] in lines 416,428,453,465,485.

You can replace this only in 1 row, but this depends from your configuration
line 416 - this is email when you have set in configuration "Admin" into "New user account activation" and "Yes" on "Send Password"
line 428 - this is email when you have set in configuration "Admin" into "New user account activation" and "No" on "Send Password"
line 453 - this is email when you have set in configuration "Self" into "New user account activation" and "Yes" on "Send Password"
line 465 - this is email when you have set in configuration "Self" into "New user account activation" and "No" on "Send Password"
line 485 - this is email when you have set in configuration "None" into "New user account activation" and "Yes" on "Send Password"

So for Joomla default registration, you can change only line 453
  1. more than a month ago
  2. Support
  3. # 8
stefphann Accepted Answer
Really thank you for your reply
  1. more than a month ago
  2. Support
  3. # 9
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.
Sorry, the discussion is currently locked. You will not be able to post a reply at the moment.