Topic-icon Question about authentication through VK.com

Active Subscriptions:

None
9 years 8 months ago - 9 years 8 months ago #46378 by andrew_j
How with authentication through VK.com I can remove field "Username:" and field "Confirm email Address:"?
File Attachment:
Last edit: 9 years 8 months ago by andrew_j.
The topic has been locked.
Support Specialist
9 years 8 months ago #46380 by alzander
The username field can be removed by setting the "Username Field on Registration" to "Generate and Hide" in the JFBConnect configuration area.

There's not a setting to remove the Confirm Email field. That's not a request we've had before, but I can investigate what you'd need to do to remove that if you'd like.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
9 years 8 months ago #46413 by andrew_j
If in "Auto Username Prefix" stands setting "email",then the field "Username" is displayed.

I need to:
- field "Username" and "Confirm Email" did not display using authorization through VK.
- when user entering the website, he introduces his email instead the login
The topic has been locked.
Support Specialist
9 years 8 months ago #46421 by alzander
Sorry for the delay. I had to do some investigation. With VK, you can't get the user's email address. If you have the 'prefix' setting as 'email', then there's nothing to prefill the username with. To fix this, you'll need to make some code changes to force the email address to be the username and hide the confirm field.

To do so, please edit the /components/com_jfbconnect/views/loginregister/view.html.php file. Around line 172, you'll see:
parent::display($tpl);
Directly above that line, add the following, which will hide the fields you don't want to display:
$this->form->setFieldAttribute('email2', 'type', 'hidden');
        $this->form->setFieldAttribute('email2', 'class', '');

        $this->form->setFieldAttribute('username', 'type', 'hidden');
        $this->form->setFieldAttribute('username', 'class', '');

Then, in the /components/com_jfbconnect/models/loginregister.php file, around line 44, you'll see:
$requestData = JRequest::getVar('jform', array(), 'post', 'array');
Directly under that, add:
if (!$requestData['email2'])
            $requestData['email2'] = $requestData['email1'];
        if (!$requestData['username'])
            $requestData['username'] = $requestData['email1'];
That should hopefully do what you're looking for.

If you run into any issues, or have any questions, just let me know!

Thanks,
Alex
The topic has been locked.