100% single login page with WordPress

Started by NewCo, February 03, 2015, 01:44:55 AM

Previous topic - Next topic

NewCo

Hi guys,

is it possible with SMF version 2.0

All I need just a Singli LogIn via WordPress, and when user go to http://site.ru/smf-forum [nofollow] it'll be alreade loggen in.

Thx

margarett

It has recently been discussed. There's a new 2-way bridge that you can try yourself.
Do note, it's *not* an SMF official bridge
https://github.com/xchwarze/WP2SMFBridge
https://github.com/xchwarze/SMF2WPBridge
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

NewCo

it works amazing thx!

And is it posible if user NOT loged in anywhere, and tryin to reach out the login of SMF page, they'll be autocaticaly redirect to WordPress login URL (without any tricks to login through the SMF directly)?

margarett

Yes, but that requires some coding in SMF (to redirect the login page to WP's login).
If that's the case, you just need the WP2SMF bridge, since all registration and login handling will be performed in WP.
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

NewCo

Quote from: margarett on February 03, 2015, 08:10:16 AM
Yes, but that requires some coding in SMF (to redirect the login page to WP's login).
If that's the case, you just need the WP2SMF bridge, since all registration and login handling will be performed in WP.

Yesh does anybody uncover topic about redirections?

And I see one issue, when user registred in WordPress - email andress didn't send to to SMF forum interface (and user cannot receive email notifications from the forum)... any idea?

margarett

Hmmmm if it isn't, it should. Email is a key field in SMF, you can't really have a user in SMF without email...
Maybe you can discuss that with the author in Github? We can't help you with that.

About redirect login, you need to:
* Disable quick login (so that the login on top of every page isn't shown): ACP --> Features and Options --> Layout --> Show a quick login on every page (uncheck)
* Edit Sources/LoginOut.php, find:
// Ask them for their login information.
function Login()
{
global $txt, $context, $scripturl;

Add after:


redirectexit('http://www.path-to-wp-login-page');

And of course, adjust that path-to..... with the complete URL of your WP's login page

On a final note, you should probably also disable registrations in SMF so that they are totally handled by WP and perform the same redirect trick in Sources/Register.php

Do note: you should only do all of this *after* the email is available in SMF!
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

NewCo

working great but WHEN I push on Login or Register button... When I typing http://domain.ru/forum [nofollow] it's still open an Enter Username\Password details.


Is it possible to detect if user NOT logged in redirect him to WP login page (and after login there SMF2WP do the deal) thx)

NewCo

looks like I figured this out in INDEX.php

found

Quoteelseif (empty($modSettings['allow_guestAccess']) && $user_info['is_guest'] && (!isset($_REQUEST['action']) || !in_array($_REQUEST['action'], array('coppa', 'login', 'login2', 'register', 'register2', 'reminder', 'activate', 'help', 'smstats', 'mailq', 'verificationcode', 'openidreturn'))))

and replace with

Quoteelseif (empty($modSettings['allow_guestAccess']) && $user_info['is_guest'] && (!isset($_REQUEST['action']) || !in_array($_REQUEST['action'], array('coppa', 'login', 'login2', 'register', 'register2', 'reminder', 'activate', 'help', 'smstats', 'mailq', 'verificationcode', 'openidreturn'))))
   {
      redirectexit('http://domain.com/login-page'); [nofollow]
      require_once($sourcedir . '/Subs-Auth.php');
      return 'KickGuest';
   }

NewCo

BTW the "WP2SMFBridge" still didn't CREATE an email at SMF ...

but in WordPres I see it

Kindred

take that up with the bridge author?     report it as a bug on the github site...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

margarett

Exactly. As I told you before:
Quote from: margarett on February 03, 2015, 09:00:58 AM
Hmmmm if it isn't, it should. Email is a key field in SMF, you can't really have a user in SMF without email...
Maybe you can discuss that with the author in Github? We can't help you with that.

(...)

Do note: you should only do all of this *after* the email is available in SMF!
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Kindred

lol... yup, that.... ^^^


Sorry, Bruno, I knew I had seen it mentioned, but couldn't find your comments for quote when viewing on my phone. :)
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

NewCo

hmm didn't receive any answer from the authour yet, about the issue of why "email" do not popup into the SMF after WP registration...


I know the plugin Amember pro, does anybody use it like WordPress + SMF forum? is it workd properly.

+++++++++++

I have another idea how to make Paid Subscription workable with different payment options. But WP2SMF plugin should working good.

What I did:


include('../wp-load.php');

if(current_user_can('subcriber')) {
wp_redirect( wp_login_url() );}
else {
exit;
}

+++BUT IT'S NOT working properly yet+++

When the user IS "Subscriber" all is wokring CORRECTLY and script REDIRECTING this role to "wp_login_url()"...

But when the role another one like a PaidSubcriber, it didn't loading the Forum

Why do you think this happened? Any ideas\help?.... programmers cannot figureout this stuff ;(

Kindred

well, because it is doing exactly what you told it to do...

I the user is subcriber, then redirect...   otherwise EXIT...  and that exits the display of the forum index.


you should never just randomly add code to the forum files.. 
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

NewCo

Quote from: Kindred on February 08, 2015, 05:38:41 PM
well, because it is doing exactly what you told it to do...

I the user is subcriber, then redirect...   otherwise EXIT...  and that exits the display of the forum index.


you should never just randomly add code to the forum files..

1. Am I doing something wrong?
2. I adder echo "some text"; before SMF code... and it's showing me the "some text" when i'm NOT a Subscriber but why the code is not loading?

handy1

Quote from: margarett on February 03, 2015, 05:43:41 AM
It has recently been discussed. There's a new 2-way bridge that you can try yourself.
Do note, it's *not* an SMF official bridge
https://github.com/xchwarze/WP2SMFBridge
https://github.com/xchwarze/SMF2WPBridge

Have you installed the smf2wp bridge?
And no idea how to get contact the developer in github:/

If someone could help us, just answer or send pm for me.

margarett

You need to sign up in GH then create a "Issue" in the project.
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

handy1

Quote from: margarett on February 10, 2015, 07:46:18 AM
You need to sign up in GH then create a "Issue" in the project.

Thanks!

Can you help me and install it for me if I will donate your next weekend drinks ;)

NewCo

I got the answer about EMAIL issue
+++
change on bridge.php the line 235:
'email_address' => "'" . addslashes($user_email) . "'",
to
'email_address' => "'" . addslashes($email_address) . "'",

or upgrade to last commit
+++

But what about WordPres redirect's? Does anybody have an ideas?

handy1

I installed package manually.
Now it requires wp folder path. WP is installed on root so what I write? Had tried / and home/xxxx/public_html/

Hard to make it works :-\

Advertisement: