+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Username restriction?

  1. #1

    Username restriction?

    Hi Flynax Supporter,

    Is there anyway to restrict username when register for new account?
    So far I saw username that has only 3 characters like: abc
    Some of them has space: he lo

    Is there anyway to restrict it to at least 4 characters and no space?

  2. #2
    Hello Wei,

    If you want you can do it yourself.

    go to ftp://libs>>javascript>>flynax.lib.js find method: this.registration

    find code:

    Code:
    Only registered members can view the code.
    and above add new :

    Code:
    Only registered members can view the code.

    then find code:

    Code:
    Only registered members can view the code.
    and replace to:

    Code:
    Only registered members can view the code.
    save it. Then open file: ftp://includes>>classes>>rlAccount.class.php

    find method: ajaxSubmitProfile
    and code in:
    PHP Code:
    Only registered members can view the code
    and change 3 to 4 save.

    Then open file: ftp://templates>>your_template>>tpl>>js_config.tpl

    find line:

    Code:
    Only registered members can view the code.
    and above add new 1:

    Code:
    Only registered members can view the code.
    save and check username on registration page. I think it should work
    Last edited by Viktor; March 28, 2014 at 04:03 AM.
    Viktor,
    Flynax technical department,
    Best wishes.

  3. #3
    Thank you so much for your hard work as always Viktor

    Best regards,

  4. #4
    Hi,

    Is there anyway to restrict the name of seller page to more than 4 characters? Because some users make their url when they register like this: www.domain.com/01, www.domain.com/02
    And it is not accessible, return 404 error.

  5. #5
    Guru
    Join Date
    Jan 2013
    Location
    Australia
    Posts
    2,005
    That from memory is an automated thing where flnax auto ads the /01 02 etc when a user name already exists, from memory it is on auto / instant sign up thingo forget the correct name. If so then Viktor set mine that made them create a new user name and not get the 01 / 02 etc. extension so check with him if so.

  6. #6
    Quote Originally Posted by Pete Young View Post
    That from memory is an automated thing where flnax auto ads the /01 02 etc when a user name already exists, from memory it is on auto / instant sign up thingo forget the correct name. If so then Viktor set mine that made them create a new user name and not get the 01 / 02 etc. extension so check with him if so.
    Hi Pete, but there is an option for user to create their own page url. And it is on on my site. For example if user register with the unique username: abcde <--- He/she has the option to choose his/her profile page url, so for this case, this user abcde picked www.domain.com/ab <-- for example I use ab instead of 01/02. The system still let it pass. And obviously that url return 404 error. So this user abcde can't access his profile page he picked which is domain.com/ab.

  7. #7
    Hello Wei,

    Yes it is possible. You need to create 1 condition.
    Go to ftp://includes>>classes>>rlAccount.class.php in method: validateUserLocation
    find 1-st condition and add new 1 after that:

    PHP Code:
    Only registered members can view the code
    Also you should add new phrase in Admin Panel >> Languages with key: personal_address_short
    save and check try to register new user again.
    Viktor,
    Flynax technical department,
    Best wishes.

  8. #8
    Quote Originally Posted by Viktor View Post
    Hello Wei,

    Yes it is possible. You need to create 1 condition.
    Go to ftp://includes>>classes>>rlAccount.class.php in method: validateUserLocation
    find 1-st condition and add new 1 after that:

    PHP Code:
    Only registered members can view the code
    Also you should add new phrase in Admin Panel >> Languages with key: personal_address_short
    save and check try to register new user again.
    Hi Viktor,

    THank you for your instruction. But I couldn't find the method: validateUserLocation. My flynax is using 4.3, is it the reason?
    I found this code instead:

    /* check personal address */
    if ( $account_types[$type]['Own_location'] )
    {
    /* validate */
    $location = trim($location);

    preg_match('/[\W]+/', str_replace(array('-', '_'), '', $location), $matches);

    if ( empty($location) || !empty($matches) )
    {
    $errors .= '<li>'. $lang['personal_address_error'] .'</li>';
    $fields .= 'profile[location],';
    }

    /* check for uniqueness */
    $wildcard_deny = explode(',', $config['account_wildcard_deny']);
    $this -> setTable('pages');
    $deny_pages_tmp = $this -> fetch(array('Path'), null, "WHERE `Path` <> ''");

    foreach ($deny_pages_tmp as $deny_page)
    {
    $wildcard_deny[] = $deny_page['Path'];
    }
    unset($deny_pages_tmp);

    $rlValid -> sql( $location );
    if ( in_array($location, $wildcard_deny) || $this -> getOne('ID', "`Own_address` = '{$location}'", 'accounts') )
    {
    $errors .= '<li>'. $lang['personal_address_in_use'] .'</li>';
    $fields .= 'profile[location],';
    }
    }

  9. #9
    Hi Viktor,

    Is there any fix for 4.3? Or only 4.4?

  10. #10
    Hello Wei Hong,

    Would you please send me your site with version 4.3 I will check and give you instruction for 4.3 version too.
    Viktor,
    Flynax technical department,
    Best wishes.

+ Reply to Thread