Page 1 of 1

External apps linked/installed how to (like Buddy Boss or some else) fix until 2.6.6 release

Posted: Sat Sep 17, 2022 10:06 am
by axew3
LOGIN/OUT FIX IN APP

to make it work all as expected, until this fix will not be added on next 2.6.6 version:

file:
/wp-w3all-phpbb-integration/class.wp.w3all-phpbb.php

just BEFORE these lines of code:

Code: Select all

        $_COOKIE[$u] = (isset($_COOKIE[$u])) ? intval($_COOKIE[$u]) : 1;
        $_COOKIE[$sid] = (isset($_COOKIE[$sid])) ? $_COOKIE[$sid] : '';
        $_COOKIE[$k] = (isset($_COOKIE[$k])) ? $_COOKIE[$k] : '';
add the follow:

Code: Select all

        // $nocookie_inOR_app : detect app execution
        // seem that the $_COOKIE[$u] is not detected when in app: so we use the behavior to avoid to fire the logout/in of the user just below
        // ... or the login flow in (for example) bboss app will fail
        $nocookie_inOR_app = (isset($_COOKIE[$u]) && $_COOKIE[$u] > 2) ? intval($_COOKIE[$u]) : 0;
then REPLACE or comment this line of code (it is few lines below the above):

Code: Select all

     if( $current_user->ID == 1 OR intval($_COOKIE[$u]) == 2 ){ return; } // exclude WP admin UID1 and phpBB admin UID2
REPLACE WITH:

Code: Select all

     if( $current_user->ID == 1 OR intval($_COOKIE[$u]) == 2 OR $nocookie_inOR_app == 0 ){ return; } // exclude WP admin UID1 and phpBB admin UID2 and if IN APP
That is. The main integration code will NOT run when in APP contest, and all will be fine.
Substantially, since there is no phpBB cookie detected, there is no reason at this time, to follow on execute the code of the verify_credentials function that will cause subsequent issues.

p.s while installing the buddy boss plugin as test for a site, i detected tons of problems with it, and not due to the integration plugin conflict. It was lacking a db table, not created during the install (who know why?) and it has been necessary to recreate it using lot of imagination, because there is no documentation about.
It is really a bug pain in the as*, also as standalone! BTW finally it work

[EDITED]