Skip to:
Content
Pages
Categories
Search
Top
Bottom

(sigh) integration cookie problem for all users except admin


  • Greg
    Participant

    @rebootnow

    I have BP 1.0.2 and BBP 1.0.1 installed and integrated.

    Everything is fine as admin, but other users can’t post. It seems to work (no error messages) but no post appears. I checked the db and it isn’t there either.

    So I followed the trail and found that the problem is happening in “validate_auth_cookie()” in “class.wp-auth.php” (via “bb-auth()” in “bb-posts.php”).

    Specifically, the call to “get_user()” around line 77 is returning false, exiting at line 288 in “class.wp-users.php” .

    Does this ring any bells? As far as I know I have everything set up correctly with the integration. This is reinforced by the fact that the admin user is working fine.

    Some other details:

    – I have flushed cookies and tried this on multiple browsers

    – I have all the secret keys defined on both sides

    – I have “define(‘WP_AUTH_COOKIE_VERSION’, 1);” in bb-config.php

    – I am using deep integration, but get the same result without it

    – I get the same result with the standard bbPress theme

    Of course, I’ve searched this forum and the bbPress forum for clues.

Viewing 25 replies - 1 through 25 (of 26 total)

  • r-a-y
    Keymaster

    @r-a-y

    Have you used the bbPress Integration plugin?

    https://wordpress.org/extend/plugins/bbpress-integration/

    And copied the config lines verbatim?

    You probably have just double-checking!


    Greg
    Participant

    @rebootnow

    R-a-y, thanks for checking, but yes, I have done this.


    r-a-y
    Keymaster

    @r-a-y

    Need more info, Reboot Now.

    Can the user log into WordPress? But not into bbPress?

    Okay, here’s another check:

    Double-check that your uploaded bbPress files are actually the same as the files from the distribution package! This one killed me a couple of days ago.


    Greg
    Participant

    @rebootnow

    As far as I can see, *everything* works except posting on the forum (only admin can post to the forum).

    – logging in and out to both forum and bp

    – sending messages

    – commenting on the blog

    – modifying the profile

    I have looked at the cookies in FF and can’t see anything obvious wrong.

    I will upload the files again. Don’t think I’ve changed anything in there, but worth a try.


    Greg
    Participant

    @rebootnow

    Nope, I just replaced all the files from the distribution and non-admin members still can’t post.


    Greg
    Participant

    @rebootnow

    At this point I am questioning everything. Following Burt’s updated integration instructions there is only one point where I have the slightest doubt. In the bbPress admin page for WP integration, it says the following about the SALTs:

    This must match the value of the WordPress setting named “auth_salt” in your WordPress site. Look for the option labeled “auth_salt” in this WordPress admin page.

    There are no SALT values in “/wp-admin/options.php”. So I put values like the following in wp-config.php:

    define(‘AUTH_SALT’, ‘XXX’);

    define(‘LOGGED_IN_SALT’, ‘XXX’);

    define(‘SECURE_AUTH_SALT’, ‘XXX’);

    …where the XXX values came from “https://api.wordpress.org/secret-key/1.1/”. I have corresponding “BB_” entries in “bb-config.php”.


    Greg
    Participant

    @rebootnow

    I’m closer to figuring this out. I originally created the “wp_users” users table by copying in the table from a bbPress install (i.e. from “bb_users”).

    In “bb_users” the user_login field can have caps, but the “user_nicename” is all lowercase.

    It seems that users who had no caps in their user_login field can post. But a user with names like…

    – user_login = RebootNow

    – user_nicename = rebootnow

    ..can’t post.

    I previously had BP integrated with bbPress 0.9.0.5 and this wasn’t the case. All users could post.

    Does anyone have any idea whether this was an intentional change?


    Korhan Ekinci
    Participant

    @korhanekinci

    I have the same problem! I have bp 1.0.3 and bbpress 1.0.1. There is deep integration as well, use bbpress-integration plugin.

    As reboot now says: *everything* works except posting on the forum (only admin can post to the forum). No errors, after posting I am returned to the forum home page and nothing is posted!!!

    It used to work fine, but after I upgraded wpmu to 2.8.1 and bp to 1.0.3, it stopped working


    Korhan Ekinci
    Participant

    @korhanekinci

    Ok, I don’t know if this helps, but when I had wpmu 2.7.1 and used bbpress-integration plugin, I had to add

    define( 'COOKIEHASH', '####################' );
    define( 'COOKIE_DOMAIN', '.yourdomain.org' );
    define( 'SITECOOKIEPATH', '/' );
    define( 'COOKIEPATH', '/' );

    to the wp-config.php file and

    define( 'WP_AUTH_COOKIE_VERSION', 1 );

    to the bb-config.php file

    After upgarding to wpmu 2.8.1, I read here that I had to delete the line I added to the bb-config.php file. Could that be the problem???


    Korhan Ekinci
    Participant

    @korhanekinci

    When you login the forum page as a member, posting is ok. But not ok, when you login bp and move to bbpress.


    Greg
    Participant

    @rebootnow

    korhanekinci, yes, I did add those four lines that the bbPress Integration plugin suggested.

    I also defined WP_AUTH_COOKIE_VERSION. Without this line the cookie integration doesn’t work at all.

    Like I mentioned above, my current clue is that only users who have NO caps in their “login_name” (field in the wp_users table) can post on the forum.

    Now, WPMU strips caps from the username when people register, but I have bbPress users that pre-dated the WPMU integration and they do have caps in their login_name.

    One other datapoint to add: I tried a standalone installation of bbPress 1.0.1 and it doesn’t have this problem. Users with caps in “login-name” can post fine.


    Korhan Ekinci
    Participant

    @korhanekinci

    Also, I would like to mention that, when I go to the forum page and login, I get page not found error but when I refresh it I am logged in!?! This only happens in the home page of the forum. Loging in other forum pages don’t give this error. How can this be solved?


    Greg
    Participant

    @rebootnow

    korhanekinci, I think you may have a different issue that warrants its own thread. Particularly if you are on 2.8.1. I have something very specific going on here: only users WITHOUT caps in user_login can post.


    Greg
    Participant

    @rebootnow

    UPDATE: it really is about the caps. For user_nicename “reboot”…

    – user_login = rebootzzz CAN post

    – user_login = rebootZZZ can NOT post

    – user_login = Reboot can NOT post

    I have started a thread on the bbPress support forum too.


    plrk
    Participant

    @plrk

    My users had “no role on these forums” until I installed some bbPress plugin that fixed this (by giving them the “member” role automatically – before that I had to it by hand). Are you sure this is not the case?


    Greg
    Participant

    @rebootnow

    I have checked and the users have the correct role. The situation is as simple as this (using phpmyadmin for the user with user_nicename = “reboot”):

    – if I set login_name to “reboot”, I can post

    – if I set login_name to “Reboot”, CAN’T post

    – if I set login_name to “rebootzzz”, I can post

    – if I set login_name to “rebootZZZ”, I CAN’T post


    r-a-y
    Keymaster

    @r-a-y

    That’s a weird one, Reboot Now!

    The thing is for the “login_name”, are you even allowed to signup with capital letters?


    Korhan Ekinci
    Participant

    @korhanekinci

    Ok, I did lots of tests and Reboot Now, I have exact the exact same problem. User names with a capital letter in it cannot post a forum post!!!

    Here is the interesting part:

    When the user with any capital letter in username logsin from the homepage and goes to forum pages he/she cannot post! When he/she logsin from the forum page, he/she can post!


    Korhan Ekinci
    Participant

    @korhanekinci

    Another interesting thing is that I use Facebook connect plugin and they CAN post in all cases!


    Greg
    Participant

    @rebootnow

    Ray, you’re right that WPMU (or is it BP?) strips caps on registration. But these users came from a previous bbPress installation (where caps were allowed).

    I guess I could make user_login = user_nicename for all of these users, but I would like to ensure that the lack of caps support for user_login is a limitation on WPMU and not just a symptom of some other problem.


    r-a-y
    Keymaster

    @r-a-y

    Good question.

    Has anyone over on the bbPress forums experienced a similar thing when upgrading from 0.9 -> 1.0+, while integrating WP(MU)?


    Jason Giedymin
    Participant

    @jason_jm

    Before I chime in, when we run our unit tests with users; we:

    • When testing an upgrade, I always delete a test user of mine: qauser
    • sql delete, and php register the user again after the upgrade.
    • I leave one user, qaeditor around. This user stays with the upgrade.
    • Allows me to know if perms were set across apps, if new users are good to go, and if old users are ok.
    • We flip roles too, but thats another test. :-)

    Anyways, Camel Case not supported for login.

    Lowercase was put in back in 05.09 https://trac.mu.wordpress.org/changeset/1770

    In trunk here is the snipit:

    571	function _fill_user( &$user ) {
    572 global $wpdb;
    573
    574 // WPMU uses lowercase logins
    575 $user->user_login = strtolower( $user->user_login );


    Greg
    Participant

    @rebootnow

    Thanks Jason. I have copied user_nicename into user_login and all is well.


    Korhan Ekinci
    Participant

    @korhanekinci

    I have the same problem and I am a little lost, can someone tell me in which file and what changes to make please? Is it in functions.bb-pluggable.php file? If yes what change please?


    Greg
    Participant

    @rebootnow

    korhanekinci, this is a change that I made in the database itself. I use phpmyadmin for database manipulation.

    In this case the operation (i.e. the SQL query) was pretty simple, but if you haven’t manipulated the database directly before then it is a little risky. One thing you definitely want to do is to create a backup copy of the db before starting.

    I’m working on a test version of my site so there is no risk of damaging the production version.

    The SQL query I used:

    UPDATE wp_users SET user_login = user_nicename WHERE 1

Viewing 25 replies - 1 through 25 (of 26 total)
  • The topic ‘(sigh) integration cookie problem for all users except admin’ is closed to new replies.
Skip to toolbar