vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Username Registration (A-Z, 0-9 Characters Only) (https://vborg.vbsupport.ru/showthread.php?t=92309)

untold4you 07-15-2005 10:00 PM

Username Registration (A-Z, 0-9 Characters Only)
 
In Reply to this thread: https://vborg.vbsupport.ru/showthread.php?t=92308

Only accept usernames with no special characters or spaces.

Database query:

Open up PhpMyAdmin, goto to your vbulletin database, run following query:
Code:

INSERT INTO setting ( varname , grouptitle , value , defaultvalue , optioncode , displayorder , advanced , volatile )
VALUES (
'az09characters', 'register', '1', '1', 'yesno', '101', '0', '1'
)

Phrases To Add:

Code:

Phrase Type: Front-End Error Messages
Varname:    az09charactersonly
Text:        Only  characters A-Z, 0-9 may be used in usernames, no spaces, no special ascii-type letters.

Phrase Type: vBulletin Settings
Varname:    setting_az09characters_title
Text:            Disallow Special Characters

Phrase type: vBulletin Settings
Varname:    setting_az09characters_desc
Text:        Setting this to "yes" prevents users from using special characters or spaces in there user name.


File Modifications:

Open:

[forumroot]/register.php

Find:

PHP Code:

    // check username does not contain semi-colons
    
if (preg_match('/(?<!&#[0-9]{3}|&#[0-9]{4}|&#[0-9]{5});/'$_POST['username']))
    {
        
//eval(print_standard_error('error_username_semicolon'));
        
eval('$errors[10] = "' fetch_phrase('username_semicolon'PHRASETYPEID_ERROR) . '";');
    } 

Above that add:

PHP Code:

    // Only A-Z, 0-9 Characters Only */
    
if ($vboptions['az09characters'])
    {
        if (!
eregi("^[A-Za-z0-9]+$"$_POST['username']))
        {
            eval(
print_standard_error('error_az09charactersonly'));
        }    
    } 

Save:

register.php

Now users can not use special chars or spaces in their username when signing up.

To disable the function goto, Admin CP > vBulletin Options > User Registration Options.
Find the yes/no option under ?Disallow Special Characters ?

That's all, Gr3?Tz Untold....

T3MEDIA 07-16-2005 11:06 AM

I did something like this that is less intensive...
I wont put the link to highjack your thread but maybe we can do something that is better for both hacks... a new cleaner version?

Up to you.

waza 07-16-2005 11:39 AM

thx,
that way my users can have a subdomain.

Erwin 07-22-2005 10:27 AM

This should really be standard with vB. :)

uae 08-22-2005 08:26 AM

I would love to see this hack ported to vB3.5

Thanks.

PixelFx 08-22-2005 08:31 AM

Quote:

Originally Posted by Erwin
This should really be standard with vB. :)

I agree

Gio~Logist 09-09-2005 07:05 PM

I have a question.....

What are the symbols that YOU SHOULD RESTRICT, if you use mod re-write to make profiles be www.site.com/username

Because i know that there are some characters that either might effect the LINK itself, can be used to ppossible "hack" the site, etc.

untold4you 09-09-2005 08:12 PM

Maybe this is what your looking for? http://forum.modrewrite.com/viewtopic.php?t=571

Update: http://forum.modrewrite.com/viewtopic.php?t=127

Gio~Logist 09-09-2005 09:45 PM

I think those are for subdomains...... mines isnt username.site.com it's site.com/username Perhaps all i should exclude is /?

007 09-10-2005 08:16 PM

I loved this in vb3.0... Does anybody plan to port it? I am going to try, but I haven't used the hook system yet. I think this could be made as a product or plugin, but I'm not really sure.


All times are GMT. The time now is 06:28 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01144 seconds
  • Memory Usage 1,739KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete