Tips and Tricks > Username restrictions only apply to Usernames > Invisionize.eu - IP.Board (IPB) News
Kanał Rss Kanał Rss
Kanał Atom Kanał Atom

Tips and Tricks > Username restrictions only apply to Usernames

wersja drukowalna wersja Microsoft Word wersja HTML

Username Restrictions in ACP->System Settings->Members->Username Restrictions->Characters allowed in usernames apply to BOTH usernames and display names by default.

If you want those restrictions to ONLY apply to USERNAMES, then you need to make a file edit.

Edit /admin/sources/classes/member/memberFunctions.php and find

        //-----------------------------------------
        // Blocking certain chars in username?
        //-----------------------------------------
        
        if( ipsRegistry::$settings['username_characters'] )
        {
            $check_against = preg_quote( ipsRegistry::$settings['username_characters'], "/" );

            if( !preg_match( "/^[" . $check_against . "]+$/i", $name ) )
            {
                return array( 'name' => $original, 'errors' => array( str_replace( '{chars}', ipsRegistry::$settings['username_characters'], ipsRegistry::$settings['username_errormsg'] ) ) );
            }
        }


Change that to

        //-----------------------------------------
        // Blocking certain chars in username?
        //-----------------------------------------

        if ($field == 'name')
        {
        if( ipsRegistry::$settings['username_characters'] )
        {
            $check_against = preg_quote( ipsRegistry::$settings['username_characters'], "/" );

            if( !preg_match( "/^[" . $check_against . "]+$/i", $name ) )
            {
                return array( 'name' => $original, 'errors' => array( str_replace( '{chars}', ipsRegistry::$settings['username_characters'], ipsRegistry::$settings['username_errormsg'] ) ) );
            }
        }
        }


And the restriction will only apply to the username.

wto, 08 wrzesień 2009

Komentarze:

Brak komentarzy

Imię/Nick:

Adres email:

Strona WWW:

Treść Komentarza: