Reserving Usernames

Ok not sure this is directly a Yii question but maybe someone here can help.

When it comes to reserving usernames in an app what is the best approach. I know that in using forum software there is generally an easy interface in the admin space to list words (including the use of wildcards) that can not be used. I don’t currently have one loaded to see how they do it though.

I would like to do the same and currently use both yii-user and yii-user-management. I don’t know if I just need to fill in db entries which seems ridiculous creating a bunch of bogus records, but maybe that is how it is done?

Anyone have suggestions?

I would just have an array that gets checked on new registrations.




    if (!in_array($name, $reservedNames)) {

        //Yay, I'm allowed.

    }



I guess I can do something along these lines. Data integrity within the db is also important so maybe I can create a table specifically to hold these values and provide that reference point to the code.

If you hold the reserved values in the database you can just do a select using the value from the user, if it’s empty then the name isn’t reserved.

I would store it where ever the settings are stored. ;)