Topic-icon Error 404 When incorrect domain in loginregister.php

Active Subscriptions:

None
www.sourcecoast.com/forums/jfbconnect/jf...is-the-answer#p60030

Hi All,

In the above quoted support item you suggested that by adding the small snippet of code to the "loginregister.php" file a check could be performed to endure that only a single domain could be registered through Google+.

Since updating to 7.1.1 this no longer redirects back to the index page but rather throws a 404 error with the following error;

View not found [name, type, prefix]: jfbconnect, html, jfbconnectView

Is there a quick and easy fix you can think of to make this work again as expected. If the user registers using the correct domain all works well, its just when the domain is other than that specified in the snippet you supplied.

Thanks for any advice and very best regards.
David
The topic has been locked.
Support Specialist
7 years 3 months ago #60494 by mel
The code snippet needs to be edited. The last line of code removes the JRoute::_ call around the index.php

Anyways, here's the code that should do what you're looking for. Please edit the /components/com_jfbconnect/models/loginregister.php. Around line 219, you should see:
$newEmail = $profile->get('email');
        $fullname = $profile->get('full_name');
Right after that, add the following:
if (strpos($newEmail, '@domainname.com') === false)
         JFactory::getApplication()->redirect('index.php'); /* Updated line of code */

I just tested this on my test site and it worked for whether the domain matched or not. However, let us know if you run into any problems with the change.

I've made an issue in the tracker to add an option for a future release.

-Melissa
The topic has been locked.