Not signed in (Sign In)

Categories

Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.

Help keep Vanilla free:
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    • CommentAuthorsstawarz
    • CommentTimeMar 21st 2008
     # 1
    What's the easiest way to prevent spaces in the username field?

    I looked for an extension or something, and it appears there is not something available.
    •  
      CommentAuthorWallPhone
    • CommentTimeMar 22nd 2008
     # 2
    You'd have to make your own extension, something like this:<?php
    /*
    Extension Name: Space Username Check
    Extension Url: http://lussumo.com/community/discussion/8033/whats-the-easiest-way-to-prevent-spaces-in-the-user-name-field/#Item_0
    Description: Prevents users from registering duplicate accounts with a space in the username.
    Version: 1.0
    Author: WallPhone
    Author Url: http://WallPhone.com/
    */

    if ('people.php' == $Context->SelfUrl) {
    $Context->SetDefinition('NoSpacesAllowed', 'The username may not contain a space.');

    Function SpaceUsernameCheck(&$UserManager) {
    $u = &$UserManager->DelegateParameters['User'];

    if (stripos($u->Name, ' ')) $UserManager->Context->WarningCollector->Add($UserManager->Context->GetDefinition('NoSpacesAllowed'));
    }
    $Context->AddToDelegate('UserManager', 'PostValidation', 'SpaceUsernameCheck');
    }
  1.  # 3
    Why would he make his own? You just made it ;)
Add your comments
    Username Password
  • Format comments as