Skip to main content
Topic: Wordpress Bridge (Read 110 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Wordpress Bridge

Wordpress Bridge 1.0



Bridge logins between WordPress and ElkArte.

Introduction:

This will synchronize logins between WordPress and ElkArte. This applies to all accounts on both the forum and the blog.

  • Setup this mod at Administration Center » Wordpress Bridge.
  • Logins are synchronized with your WordPress site once users log into the forum.
    • The included WP plugin will redirect users to the forum if they try to register or login to the blog site.
      • The single file elk-wp-auth.php goes into WP's plugins directory
      • It should be activated within the ElkArte site.
  • The bridge will automatically create new users to try to keep everything in sync.

Note that there is a conflict because both ElkArte and WordPress try to load the same password library into the same namespace. This can easily be remedied by adding a small code snippet.

In ./wp-includes/class-phpass.php, find
Code: [Select]
class PasswordHash {
and replace it with the following
Code: [Select]
if (class_exists('PasswordHash')) return;
class PasswordHash {

I recommend doing this before installing the bridge, to avoid said conflict if you forget this later. It simply checks if the class is already loaded, and skips loading if it's already in memory.

Requires PHP 5.4 or newer to run

Ask about any questions and please donate if you can.

https://github.com/live627/Wordpress-Elk/releases

Re: Wordpress Bridge

Reply #1
Very nice :D
“The problem is not the problem. The problem is your attitude about the problem. Do you understand?” – Jack Sparrow

Re: Wordpress Bridge

Reply #2
I have attempted to test this (with my novice skillset) as its been something I've very exited to be able to implement in a live setting.  However, with multiple attempts I receive the following error 100% of the time when trying to log out of WP after activating the plugin.

If anyone has been able to get this to work your advice would be greatly appreciated.

Error:
Fatal error: Uncaught exception 'Exception' with message 'safe_unserialize: unknown/malformed type: [' in /home/msbsimco/public_html/forum/sources/ext/serialize.php:165 Stack trace: #0 /home/msbsimco/public_html/forum/sources/ext/serialize.php(281): ElkArte\ext\upgradephp\_safe_unserialize('[1,\\"ccec1b163c...') #1 /home/msbsimco/public_html/forum/sources/subs/Util.class.php(590): ElkArte\ext\upgradephp\safe_unserialize('[1,\\"ccec1b163c...', Array) #2 /home/msbsimco/public_html/forum/sources/Load.php(3186): Util::unserialize('[1,\\"ccec1b163c...') #3 /home/msbsimco/public_html/forum/sources/Load.php(185): serializeToJson('[1,\\"ccec1b163c...', Object(Closure)) #4 /home/msbsimco/public_html/forum/SSI.php(174): loadUserSettings() #5 /home/msbsimco/public_html/wp-content/plugins/elk-wp-auth.php(23): require('/home/msbsimco/...') #6 [internal function]: {closure}('') #7 /home/msbsimco/public_html/wp-includes/class-wp-hook.php(298): call_user_func_array(Object(Closure), Array) #8 /home/msbsimco/public_html/wp-includes/class-w in /home/msbsimco/public_html/forum/sources/ext/serialize.php on line 165

Re: Wordpress Bridge

Reply #3
That error is seen only when logging out WP, the forum, or both? Elk 1.0? I can't reproduce any error...

@Spuds any thoughts? I see some weird code paths from Elk in that bug report and I need help.

Re: Wordpress Bridge

Reply #4
It appears to be tossing the exception during the processing of ElkArtes default cookie ...  right before a setLoginCookie.  I wonder if the the cookie is somehow corrupt as unserialize (the special version used for < php 7) is saying its invalid.
“The problem is not the problem. The problem is your attitude about the problem. Do you understand?” – Jack Sparrow

Re: Wordpress Bridge

Reply #5
The error is when logging out of WP. ElkArte 1.0.10, but I am unable to try logging in for obvious reason.

The Elkarte login/logout does not seem to be impacted.