The MU forums have moved to WordPress.org

how to filter on wpmu_validate_user_signup() (1 post)

  1. plaverty
    Member
    Posted 12 years ago #

    We are trying to use Shibboleth with our WPMU instance and when you do that, the usernames come in the format of an email address, they have an @ and a . in the username. This works fine if the system admin adds the user to the system first, or if the user manually signs up, Shibboleth will correctly create an account for them. However, sometimes a blog admin will want to add someone to their blog who isn't already in the database. When they try to create the account, I get an error message that says usernames can only be alphanumeric.

    I found the function that does the check in wp-includes/wpmu-functions.php

    function wpmu_validate_user_signup($user_name, $user_email) {
    ...
    preg_match( "/[a-z0-9]+/", $user_name, $maybe );
    ...
    }

    So clearly one solution is to just add the @ and . to the preg_match function, but I never want to edit core.

    So my next thought was to just create a filter that allows for the @ and . but when I look at the list of functions that I can hook on to, wpmu_validate_user_signup isn't in the list. So now what?

    I'm really new to creating plugins and filters, so maybe I'm thinking about this wrong. If I am, please set me straight.

    Thanks!

About this Topic

  • Started 12 years ago by plaverty