× Joomla Facebook Connect support forum

Topic-icon CB login email & layout

Active Subscriptions:

None
14 years 10 months ago #12208 by miggybe
Hi,
Great component, happy with the installation. I have been hacking the code already for adding the CB pre text, the horizontal lay out and for compact presentation (labels inside txtbox). These features are important for websites with limited space for the login fields (not all users want to connect with facebook), and standard in the CB options.

But my main problem is... I have the CB option "login with email or username" active, but this does not work with the JFBconnect login.
Is there a way to get this working? At first I tried to continue the use of the CB login form, but that made a mess of my lay out.

Thanx for your feedback!

Miguel Major
The topic has been locked.
Active Subscriptions:

None
14 years 10 months ago #12283 by miggybe
Replied by miggybe on topic CB login email & layout
Any chance to get a reply on the CB login with email issue?
The topic has been locked.
Support Specialist
14 years 10 months ago #12299 by alzander
Replied by alzander on topic CB login email & layout
Miguel,
I'm very, very sorry for the delayed response. Somehow I missed this post, and while it does happen, it's never fun when it happens to 'you'.

As you've noticed, we don't support the email as username option out of the box. It's the first time we've had that request, actually, but I was able to implement some code that let me login using my email address with the JFBCLogin module. To do this, if you haven't already, we recommend creating a template override for the JFBCLogin module. To do so, copy /modules/mod_jfbclogin/tmpl/default.php to /templates/<YOUR_TEMPLATE>/html/mod_jfbclogin. That will prevent your changes from being erased when upgrading.. but you should double check to make sure you integrate any new features from updates in the Login module into your template override.

Once created, edit the default.php file. Around line 55, you'll see:
<input type="hidden" name="option" value="com_user" />
            <input type="hidden" name="task" value="login" />
You'll need to replace that with the following:
<?php
            include_once( JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php' );
            global $_CB_framework;
            echo '<input type="hidden" name="option" value="com_comprofiler" />'."\n";
            echo '<input type="hidden" name="task" value="login" />'."\n";
            echo '<input type="hidden" name="op2" value="login" />'."\n";
            echo '<input type="hidden" name="lang" value="' . $_CB_framework->getCfg( 'lang' ) . '" />' . "\n";
            echo '<input type="hidden" name="force_session" value="1" />'."\n";		// makes sure to create joomla 1.0.11+12 session/bugfix
            echo cbGetSpoofInputTag( 'login' );
?>

The above code simply changes our login module to swap from trying to login using the normal Joomla flow to use CB's flow. It's a little more complex to do it that way, so let us know if you run into any issues. Hopefully, you won't.

I've added a case to our tracker to investigate adding this to the JFBCLogin module in the future, but it will need a bit of testing to make sure that it doesn't cause any unforeseen problems.

Finally, I know you already abandoned the idea, but to add the "Login With Facebook" button to the CB Login module, you simply need to find where you want to add it, and type {JFBCLogin}. JFBConnect will detect that and replace it with the pretty blue button. That may work out better for you, but obviously, you know what's best for your site :)

Hope this helps, and again, very sorry for the delay,
Alex
The topic has been locked.
Active Subscriptions:

None
14 years 9 months ago #12396 by miggybe
Replied by miggybe on topic CB login email & layout
Hi Alzander,
Thanx for your reply.
Since I want to launch this weekend I found an easy way to do it cleanly via your second option.
As soon as I have some time I will test the other solution on my development environment and keep you posted.
Nice weekend!
The topic has been locked.
Support Specialist
14 years 9 months ago #12409 by alzander
Replied by alzander on topic CB login email & layout
Have a great weekend yourself, and let us know if there's anything else you need from us. Good luck on your launch!

Alex
The topic has been locked.