bbPress

Simple, Fast, Elegant

bbPress support forums » Troubleshooting

another type of login problem

(18 posts)
  • Started 2 years ago by AphelionZ
  • Latest reply from AphelionZ
  • This topic is resolved
  1. I have a user named Professor Stigious and a user named POS

    POS is able to log in with no problems, and navigates cleanly between my blog and my bb with no trouble whatsoever.

    However, when Professor Stigious goes to the bb he's not logged in and when he tries to the space in his name screws him up! he needs your help! please!

    Posted 2 years ago #
  2. Maybe he doesn't have the cockies enabled ?

    Posted 2 years ago #
  3. Both cockies and cookies are enabled, sir!

    Posted 2 years ago #
  4. It's the space.

    Try this plugin:

    <?php
    /*
    Plugin Name: Allow spaces in user names
    Plugin URI: http://bbpress.org/forums/topic/99
    */

    function wpbb_user_sanitize( $text, $raw, $strict ) {
    $username = strip_tags($raw);
    // Kill octets
    $username = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '', $username);
    $username = preg_replace('/&.+?;/', '', $username); // Kill entities

    // If strict, reduce to ASCII for max portability.
    if ( $strict )
    $username = preg_replace('|[^a-z0-9 _.\-@]|i', '', $username);

    return $username;
    }

    add_filter( 'user_sanitize', 'wpbb_user_sanitize', -1, 3);

    ?>

    Posted 2 years ago #
  5. I copied this code into a file called userspace.php and then copied that file into the my-plugins folder. Is there anything else I need to do?

    Professor Stigious is also the keymaster. Is this super problematic?

    btw thank you for your fast response!

    Posted 2 years ago #
  6. That snhould be all you need to do (it shouldn't matter who's what). But I haven't actually tested it.

    Please let me know how it goes.

    Posted 2 years ago #
  7. I'm afraid that it did not work.

    My site is outletzine.org

    my forum is at outletzine.org/forums2

    If i can provide any more information that might help please let me know.

    Posted 2 years ago #
  8. Did not work, I put a print statement in the userspace.php, printing "This code is being executed." and it showed up, but does not solve the whitespace problem.

    Posted 2 years ago #
  9. Is there a simple modification to the plugin that can be made to fix this problem?

    Posted 2 years ago #
  10. Has nobody else had this problem with spaces in the username?

    Posted 2 years ago #
  11. Strange - it worked for me.

    Make sure that userspace.php has no whitespace before the <?php or after the ?>

    Posted 2 years ago #
  12. It still does not work. My forum is at outletzine.org/forums2

    Posted 2 years ago #
  13. This is very hacking debugging but I put another print statement in, this time inside the custom function which prints "the code is being executed"
    when the wpbb_user_sanitize function and that does not display on the page at any point during any sort of login, successful or unsuccessful.

    Is there anything else you can suggest?

    Posted 2 years ago #
  14. Can you paste the entire contents of that file http://pastebin.com/ and then post the link here?

    Posted 2 years ago #
  15. http://pastebin.com/814442

    cool site, btw!

    Posted 2 years ago #
  16. Ah!

    My sincere apologies. I've sent you on a wild goose chase. That plugin will only work with the upcoming next release of bbPress.

    Don't dispair, though. That new release is coming soon.

    Sorry!

    Posted 2 years ago #
  17. ok, no worries! I'm itching for it... itching!

    Posted 2 years ago #
  18. correct! works now!

    Posted 2 years ago #

RSS feed for this topic

Reply

You must log in to post.

Code is Poetry.