Page 1 of 1

Login issues

Posted: Tue Dec 06, 2022 12:51 pm
by benw
Hi,

On the live, site the cross login has stopped working.

On the staging site, some accounts work and some don't.

There is one account that is an admin in WordPress and a normal user in phpBB. With that account, logging in from the forum does log me into WordPress (and allow me to access /wp-admin/). But if trying to login to /wp-login.php, it doesn't log into anything.

Any ideas what might cause this?
Thanks

Re: Login issues

Posted: Tue Dec 06, 2022 10:26 pm
by axew3
And no errors? What it happen that you are redirected and nothing happen?
It can be that in some way the phpBB cookie is not correctly set or the hook that should setup the phpBB session do not fire.
Strange...

anyway could you open wp_w3all.php file

there is this line of code:

Code: Select all

  add_action( 'wp_login', 'wp_w3all_phpbb_login', 10, 2);
can you cut it and move it exactly just after this (it is just few lines below):

Code: Select all

 if ( defined('W3PHPBBDBCONN') && !isset($w3deactivate_wp_w3all_plugin) )
 {
just after paste the above line. Save. Try, What it happen?

Re: Login issues

Posted: Fri Dec 09, 2022 3:13 pm
by benw
Somehow the settings for the phpBB database in the WordPress plugin had gone missing (nothing in wp_options table).

After setting those again I think the cross-login is working now.

Incidentally, I found a PHP error in vesion 2.6.6 of the plugin...

Code: Select all

PHP Warning:  Trying to access array offset on value of type null in /efs/mywebsite/wordpress/wp-content/plugins/wp-w3all-phpbb-integration/class.wp.w3all-phpbb.php on line 135
Warning: Trying to access array offset on value of type null in /efs/mywebsite/wordpress/wp-content/plugins/wp-w3all-phpbb-integration/class.wp.w3all-phpbb.php on line 135
WordPress database error Table 'mywebsite.config' doesn't exist
You may need to add an extra

Code: Select all

if (empty($w3all_config)) { return array(); }
Thanks!

Re: Login issues

Posted: Sat Dec 10, 2022 8:02 am
by axew3
Ok!
Look, it seem strange that i did not:

Code: Select all

if(empty( $w3all_config["table_prefix"] )){ return array() };
the easier to check if all is ok about connection array values.
instead to go on, before the connection test :?: ...
Let check it why, we go to fix it on 2.6.7! Thank you!

Re: Login issues

Posted: Sat Dec 10, 2022 1:08 pm
by axew3
on 2.6.7

Code: Select all

   if( empty($w3all_phpbb_connection) ){
    return array();
   }

  ob_start();
   $a = $w3all_phpbb_connection->get_results("SELECT config_value FROM ". $w3all_config["table_prefix"] ."config WHERE config_name IN('allow_autologin','avatar_gallery_path','avatar_path','avatar_salt','cookie_domain','cookie_name','default_dateformat','default_lang','load_online_time','max_autologin_time','newest_user_id','newest_username','num_posts','num_topics','num_users','rand_seed','rand_seed_last_update','record_online_users','script_path','session_length','version') ORDER BY config_name ASC");
  ob_get_contents();
  ob_end_clean();
become:

Code: Select all

   if( empty($w3all_phpbb_connection) OR empty($w3all_config["table_prefix"])){
    return array();
   }
 
   $a = $w3all_phpbb_connection->get_results("SELECT config_value FROM ". $w3all_config["table_prefix"] ."config WHERE config_name IN('allow_autologin','avatar_gallery_path','avatar_path','avatar_salt','cookie_domain','cookie_name','default_dateformat','default_lang','load_online_time','max_autologin_time','newest_user_id','newest_username','num_posts','num_topics','num_users','rand_seed','rand_seed_last_update','record_online_users','script_path','session_length','version') ORDER BY config_name ASC");
 
the ob_start(); code refer to a test i did to try to resolve the fact that if the connection values are wrong and the wp is set on debug mode, it fall into error that is not resolvable (until you do not set debug mode into false on wp-config.php or disable the plugin).
It by the way, do not resolve the problem. If on debug mode, and the connection value is wrong the mysql connection error make it fall wp into a fatal php error. I assume so that only ob_start(); would may be removed since not useful, and the remaining, do not interfere at all into the result,in any case.

Re: Login issues

Posted: Sat Dec 17, 2022 9:19 am
by axew3
2.6.7 has been released to fix the login issue. Update to 2.6.7