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 :-\

margarett

I also struggled with that setting when I tested it, let me check what I set up in my test board...
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

WordPress in root
Forum in the root/forum

type in WordPress: /forum/

doctordog

I have a problem: Plug-in doesn't work.
I hav installed fresh copy of WordPress 4.1
created directory /forum/ inside WP-site
installed SimpleMachines 2.0.9

After I Tried to create new user in WordPress through admin panel, but new user is appering only in WP database .... and there is no such user in SimpleMachine DB.

Can anybody help me?


hxxp:github.com/xchwarze/WP2SMFBridge [nonactive]

http://download.simplemachines.org/index.php?thanks;filename=smf_2-0-9_install.zip


Kindred

doctordog,

You will have to take it up with the author on the GitHub site. We have no input into or control over his bridge
Сл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

The main issue was how to make role redirections works? anybody?

Jeroi

To where I install the SMF2WORDPRESS plugin. Nether on github ot here is installation instructions...

margarett

AFAIK there are 2 plugins, one for each integration "direction". If you want total integration, you install both plugins, one in WP and other 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

njtweb

On the wp side, you enter /board

on the SMF side you leave it as .../ if wp is installed in root.

Existing users will 'NOT' work both ways, all users have to register new to work on both sides.

.Lúthien

Thanks to whoever created this plugin! It saved me from a headache trying something similar with phpbb, where 6 out of 7 existing plugins were outdated and the 7th was broken at the moment. So I tried to fix it, only to find that it was a lot more complex than I needed. For one thing, it redirected from WP to the forum after logging in, rendering the WP-ADMIN backend unreachable. Although I might have caused that myself accidentally, trying to get it to work :-X

QuoteExisting users will 'NOT' work both ways, all users have to register new to work on both sides.

I'm glad that you made that explicit! I was a bit sloppy in reading the README, and had understood that it did that automatically, and was on the point of trying to find out what the problem was.
Actually, it's great that it doesn't because we've got a fairly stable user base and it's easy to keep that in sync. And the simpler, the less failures!

dingaling

Could someone help me with the installation? I'm new with SMF and don't know all the tricks. I tried to download the zip and install that with the package manager but it won't accept the package.

QuoteAn Error Has Occurred!
Package upload failed due to the following error:
"Although the package was downloaded to the server it appears to be empty. Please check the Packages directory, and the "temp" sub-directory are both writable. If you continue to experience this problem you should try extracting the package on your PC and uploading the extracted files into a subdirectory in your Packages directory and try again. For example, if the package was called shout.tar.gz you should:
1) Download the package to your local PC and extract it into files.
2) Using an FTP client create a new directory in your "Packages" folder, in this example you may call it "shout".
3) Upload all the files from the extracted package to this directory.
4) Go back to the package manager browse page and the package will be automatically found by SMF."

Not sure how I should proceed here... Maybe try to install it manually under Packages somehow?

djhanne

How do I redirect the login box that shows up when a user session has timed out to wordpress login?

Advertisement: