• Resolved benbluef

    (@benbluef)


    When I click the link:
    wp-w3all WordPress users to phpbb
    /wp-admin/tools.php?page=wp-w3all-users-to-phpbb

    it says:

    Sorry, you are not allowed to access this page.

    How do I transfer WordPress users to phpBB ?

    Thanks

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author axew3

    (@axewww)

    That’s strange! As admin that can manage options, you should be allowed to access!

    Plugin Author axew3

    (@axewww)

    Do you have instead access to others check and transfer pages?

    • This reply was modified 2 years, 9 months ago by axew3.
    Thread Starter benbluef

    (@benbluef)

    I can access the main options page:
    /wp-admin/options-general.php?page=wp-w3all-options

    but not any any of the tools.php pages

    Thread Starter benbluef

    (@benbluef)

    The management_pages being are not being added.

    I can get to the page if I comment out the check for W3PHPBBCONFIG here:
    \wp-content\plugins\wp-w3all-phpbb-integration\class.wp.w3all-admin.php
    # line 24

    Although the page is empty apart from:

    Wp w3all miss phpBB db configuration. Set phpBB connection values by opening:

    Settings -> WP w3all

    Plugin Author axew3

    (@axewww)

    very strange let look … a moment

    Plugin Author axew3

    (@axewww)

    so, the file that check for user permission, then allow or not the access to this page is:
    /wp-content/plugins/wp-w3all-phpbb-integration/class.wp.w3all-admin.php
    on each function you can see the code that check for user permissions, for the WP to phpBB users transfer it is this:

    public static function wp_w3all_users_to_phpbb() {
    
       if ( !current_user_can( 'manage_options' ) )  {
         wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
       }
    
        $file = WPW3ALL_PLUGIN_DIR . 'admin/wp_w3all_users_to_phpbb.php';
         include( $file );
     }

    so you could do this:
    //wp_die( __( 'You do not have sufficient permissions to access this page.' ) );

    but then you expose the WP, so maybe after finished, put again all as it was.
    Very strange. Never reported as problem. Asking to myself how it can be possible…

    • This reply was modified 2 years, 9 months ago by axew3.
    Plugin Author axew3

    (@axewww)

    p.s the same instruction, is on top of the file:
    /wp-content/plugins/wp-w3all-phpbb-integration/admin/wp_w3all_users_to_phpbb.php
    so if you after the above get
    Forbidden
    on top of this file you have:

       if ( !current_user_can( 'manage_options' ) ) {
          die('<h3>Forbidden</h3>');
        }

    so you’ll do

       if ( !current_user_can( 'manage_options' ) ) {
         // die('<h3>Forbidden</h3>');
        }

    this you could omit to re-add, while the previous, after finished, may return it to what it was (or it is a security risk)

    • This reply was modified 2 years, 9 months ago by axew3.
    Thread Starter benbluef

    (@benbluef)

    It’s not the capability check that is the problem, because the displayed error message does not match – the error is the generic “Sorry, you are not allowed to access this page.”

    W3PHPBBCONFIG is not defined, so the admin pages never get added.

    There is a line (#211) commented out in wp-w3all-phpbb-integration\wp_w3all.php
    // add_action( 'init', array( 'WP_w3all_phpbb', 'w3all_get_phpbb_config_res'), 2);

    Is that meant to be commented out? It looks like that is where W3PHPBBCONFIG is defined.

    • This reply was modified 2 years, 9 months ago by benbluef.
    Plugin Author axew3

    (@axewww)

    But if W3PHPBBCONFIG has not been defined, your connection values mean that are not well configured?

    Absolutely you can comment out, and try and let me know please.

    • This reply was modified 2 years, 9 months ago by axew3.
    Thread Starter benbluef

    (@benbluef)

    Uncommenting that line didn’t make any difference.

    I got the other admin pages working by calling the function to set the W3PHPBBCONFIG constant within the function wp_w3all_menu() in this file:
    wp-w3all-phpbb-integration\class.wp.w3all-admin.php

    I added this line there:
    WP_w3all_phpbb::w3all_get_phpbb_config_res();

    Can you check and release a proper solution please?

    Thanks

    Plugin Author axew3

    (@axewww)

    So… into file

    /wp-content/plugins/wp-w3all-phpbb-integration/class.wp.w3all-phpbb.php

    there is this code function (+- on top):

    private static function w3all_get_phpbb_config(){
    
      if(defined("W3PHPBBCONFIG")){ return; }
    
       global $w3all_phpbb_connection,$w3all_config,$w3cookie_domain;
    
       if( empty($w3all_phpbb_connection) ){
        return array();
       }
    
      ob_start();
       $a = $w3all_phpbb_connection->get_results("SELECT * 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','script_path','session_length','version') ORDER BY config_name ASC");
      ob_get_contents();
      ob_end_clean();
    
        if(empty($a)){ return array(); }
    
          // Order is alphabetical
          $res = array( 'allow_autologin' => $a[0]->config_value,
                        'avatar_gallery_path' => $a[1]->config_value,
                        'avatar_path' => $a[2]->config_value,
                        'avatar_salt' => $a[3]->config_value,
                        'cookie_domain' => $a[4]->config_value,
                        'cookie_name' => $a[5]->config_value,
                        'default_dateformat' => $a[6]->config_value,
                        'default_lang' => $a[7]->config_value,
                        'load_online_time' => $a[8]->config_value,
                        'max_autologin_time' => $a[9]->config_value,
                        'newest_user_id' => $a[10]->config_value,
                        'newest_username' => $a[11]->config_value,
                        'num_posts' => $a[12]->config_value,
                        'num_topics' => $a[13]->config_value,
                        'num_users' => $a[14]->config_value,
                        'rand_seed' => $a[15]->config_value,
                        'rand_seed_last_update' => $a[16]->config_value,
                        'script_path' => $a[17]->config_value,
                        'session_length' => $a[18]->config_value,
                        'version'  => $a[19]->config_value
                      );
    
     if( $res["cookie_domain"] != $w3cookie_domain ){
      $up = $res["cookie_domain"];
      update_option( 'w3all_phpbb_cookie', $up );
     }
    
      define("W3PHPBBCONFIG", $res);
    
      return $res;
    
    }

    you could cut the head of the bull changing it into:

    private static function w3all_db_connect(){
     global $w3all_phpbb_connection;
    
     if(defined('W3PHPBBDBCONN')){
      $w3all_config_db = W3PHPBBDBCONN; // switch to W3PHPBBDBCONN-only, on vers 2.6.0
     } else { global $w3all_config_db; } // to be removed on vers 2.6.0
    
     if(empty($w3all_config_db) OR defined('W3ALLCONNWRONGPARAMS')){ return; }
    
     $w3all_config_db["dbhost"] = empty($w3all_config_db["dbport"]) ? $w3all_config_db["dbhost"] : $w3all_config_db["dbhost"] . ':' . $w3all_config_db["dbport"];
     $w3all_phpbb_connection = new wpdb($w3all_config_db["dbuser"], $w3all_config_db["dbpasswd"], $w3all_config_db["dbname"], $w3all_config_db["dbhost"]);
    
      if(!empty($w3all_phpbb_connection->error)){
          define('W3ALLCONNWRONGPARAMS',true); // to cut any other db loop request, if db connection values or table prefix are wrong
        if (!defined('WPW3ALL_NOT_ULINKED')){
          define('WPW3ALL_NOT_ULINKED', true);
        }
    
      if(!empty($w3all_phpbb_connection->error->errors)){
        foreach($w3all_phpbb_connection->error->errors as $k => $v){
         foreach($v as $vv){
          $dberror = $vv;
         }
        }
       }
    
         if($_GET['page'] == 'wp-w3all-options' OR current_user_can('manage_options')){
           echo __('<div class="" style="font-size:0.9em;margin:30px;width:40%;background-color:#F1F1F1;border:3px solid red;position:fixed;top:120;right:0;text-align:center;z-index:99999999;padding:20px;max-height:140px;overflow:scroll"><h3 style="margin:0 10px 10px 10px"><span style="color:#FF0000;">WARNING</span></h3><strong>phpBB database connection error.</strong><br /><span style="color:#FF0000">Integration Running as USERS NOT LINKED</span> until this message display.<br />Double check phpBB db connection values <span style="color:#FF0000">into the integration plugin admin page and <b>NOT the wp-config.php</span> (as may suggested on the message below).'.$dberror.'</div><br />', 'wp-w3all-phpbb-integration');
          }
        return;
       }
    
      self::w3all_get_phpbb_config();
    
      return $w3all_phpbb_connection;
    }

    note the
    self::w3all_get_phpbb_config();
    added just after the connection established where

    self::w3all_get_phpbb_config();
      return $w3all_phpbb_connection;

    If this is the problem, this for sure resolve any about. Let know!

    P.s nice solution… this will be default on next coming soon 2.5.9.
    The call like this to get phpBB config values, will be sure that will be executed right in time ever (even it is strange to me it is not in your case).
    And will be no necessity to call it anywhere else. The code will be updated about this to run the flow more appropriately.

    • This reply was modified 2 years, 9 months ago by axew3.
    • This reply was modified 2 years, 9 months ago by axew3.
    • This reply was modified 2 years, 9 months ago by axew3.
    • This reply was modified 2 years, 9 months ago by axew3.
    Plugin Author axew3

    (@axewww)

    p.s sorry, the file about the change above mentioned is:
    /wp-content/plugins/wp-w3all-phpbb-integration/class.wp.w3all-phpbb.php

    sorry i forgotten to say

    2.5.9 logs say about this:
    https://www.axew3.com/w3/forums/viewtopic.php?p=5587#p5587

    • This reply was modified 2 years, 9 months ago by axew3.
    Thread Starter benbluef

    (@benbluef)

    Sounds good, thanks for the fast response!

    Thread Starter benbluef

    (@benbluef)

    2.5.9 is still broken

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Cannot transfer users’ is closed to new replies.