Icy Phoenix

     
 


Post new topic  Reply to topic 
Page 1 of 1
 
 
Reply with quote Download Post 
Post Nickname With Russian Letters 
 
Hello, please tell me where can I change the option which allow users to register nicknames with russian letters, it is now only a-z allowed  
 



 
RipleySend private messageVisit poster's website  
Back to topPage bottom
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.

Support us
 
Reply with quote Download Post 
Post Re: Nickname With Russian Letters 
 
Take a look here:
http://www.icyphoenix.com/viewtopic.php?f=4&t=1524
 




____________
TheSteffen
Often SEARCH is the quickest way to get support.
IcyPhoenix German Support
 
TheSteffenSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Nickname With Russian Letters 
 
TheSteffen wrote: [View Post]
Take a look here:
http://www.icyphoenix.com/viewtopic.php?f=4&t=1524

It does not work  
 



 
RipleySend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Nickname With Russian Letters 
 
Have you done this?

OPEN includes/functions_validate.php
FIND
Code: [Download] [Hide] [Select]
if (!preg_match("/^[a-z0-9&\-_ ]+$/i", $username))

REPLACE WITH
Code: [Download] [Hide] [Select]
if (!preg_match("/^[a-z0-9&\-_ а-я]+$/i", $username))


Or maybe this
Code: [Download] [Hide] [Select]
if (!preg_match("/^[a-z0-9&\-_ а-я]+$/i", $username))


For me it is working... but I only used some spezial letter like ÄÖÜäöüß
 




____________
TheSteffen
Often SEARCH is the quickest way to get support.
IcyPhoenix German Support
 
TheSteffenSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Nickname With Russian Letters 
 
Yes, I did everything from this topic http://www.icyphoenix.com/viewtopic.php?f=4&t=1524 Changed  includes/functions_validate.php and lang main.php at eng and russian folders, cleared cache several times, then tried to register different nicknames with ru letters from different browsers, but in doubt  
What is interesting - users that done registration containing russian letters at phpbb3 before we converted to ip, can still log in to the forum   . But no one is able to register, and it is a problem, because we are russian forum
 



 
RipleySend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Nickname With Russian Letters 
 
My seconde one should be different... but it isn't here.

Can you try to insert
Code: [Download] [Hide] [Select]
&_#1072;-&_#1103;
without this _
This are the HTML Codes for Russian (Cyrillic)

Anyway, what is helping for sure is, if you inserte every letter you want in big and small letters
Code: [Download] [Hide] [Select]
if (!preg_match("/^[a-z0-9&\-_ АаБб and so on]+$/i", $username))

 




____________
TheSteffen
Often SEARCH is the quickest way to get support.
IcyPhoenix German Support
 
TheSteffenSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Nickname With Russian Letters 
 
TheSteffen, thank you very much, I tried this:


preg_match("/^[a-z0-9&\-_ АаБбВвГгДдЕеЁёЖжЗзИиЙйКкЛлМмНнОоПпРрСсТтУуФфХхЦцЧчШшЩщЪъЫыЬьЭэЮюЯя]+$/i" here was a usual this username is not available

if (!preg_match("/^[_0-9A-Za-zА-Яа-яЁё]+$/u", $username)) this was some error :[Icy Phoenix Debug] PHP Notice: in file /includes/functions_validate.php on line 103: preg_match() [function.preg-match]: Compilation failed: invalid UTF-8 string at offset 13
1
I saw 103 line is right here if (!preg_match("/^[_0-9A-Za-zА-Яа-яЁё]+$/u", $username)) , but I do not know wher exactly..
 



 
RipleySend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Nickname With Russian Letters 
 
I am sorry, I am not so skilled.

For me it is working  

You can deactivate this username controll compleatly, but I don't know how.

Maybe someone else can help you. Or we have to wait for MG.

I guess it would be easier with next IP release because of UTF-8, but this will need some time.
 




____________
TheSteffen
Often SEARCH is the quickest way to get support.
IcyPhoenix German Support
 
TheSteffenSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Nickname With Russian Letters 
 
TheSteffen wrote: [View Post]
I am sorry, I am not so skilled.

For me it is working  

You can deactivate this username controll compleatly, but I don't know how.

Maybe someone else can help you. Or we have to wait for MG.

I guess it would be easier with next IP release because of UTF-8, but this will need some time.


Hello, yes I did not found how to deactivate username control in ACP  I'll try this &_#1072;-&_#1103; tomorrow   Thanks for reply  love_friends_02
 



 
RipleySend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Nickname With Russian Letters 
 
Use it at your own risk, make a back up copy of the includes/functions_validate.php file first.

Replace the content of the file with this:

Code: [Download] [Hide] [Select]
<?php
/***************************************************************************
 *                          functions_validate.php
 *                            -------------------
 *   begin                : Saturday, Feb 13, 2001
 *   copyright            : (C) 2001 The phpBB Group
 *   email                : support@phpbb.com
 *
 *   $Id: functions_validate.php,v 1.6.2.12 2003/06/09 19:13:05 psotfx Exp $
 *
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/

//
// Check to see if the username has been taken, or if it is disallowed.
// Also checks if it includes the " character, which we don't allow in usernames.
// Used for registering, changing names, and posting anonymously with a username
//
function validate_username($username)
{
    global $db, $lang, $userdata;

    // Remove doubled up spaces
    $username = preg_replace('#\s+#', ' ', trim($username));
    $username = phpbb_clean_username($username);

    $sql = "SELECT username
        FROM " . USERS_TABLE . "
        WHERE LOWER(username) = '" . strtolower($username) . "'";
    if ($result = $db->sql_query($sql))
    {
        while ($row = $db->sql_fetchrow($result))
        {
            if ( ($userdata['session_logged_in'] && ($row['username'] != $userdata['username'])) || !$userdata['session_logged_in'])
            {
                $db->sql_freeresult($result);
                return array('error' => true, 'error_msg' => $lang['Username_taken']);
            }
        }
    }
    $db->sql_freeresult($result);

    $sql = "SELECT group_name
        FROM " . GROUPS_TABLE . "
        WHERE LOWER(group_name) = '" . strtolower($username) . "'";
    if ($result = $db->sql_query($sql))
    {
        if ($row = $db->sql_fetchrow($result))
        {
            $db->sql_freeresult($result);
            return array('error' => true, 'error_msg' => $lang['Username_taken']);
        }
    }
    $db->sql_freeresult($result);

    $sql = "SELECT disallow_username
        FROM " . DISALLOW_TABLE;
    if ($result = $db->sql_query($sql))
    {
        if ($row = $db->sql_fetchrow($result))
        {
            do
            {
                if (preg_match("#\b(" . str_replace("\*", ".*?", preg_quote($row['disallow_username'], '#')) . ")\b#i", $username))
                {
                    $db->sql_freeresult($result);
                    return array('error' => true, 'error_msg' => $lang['Username_disallowed']);
                }
            }
            while($row = $db->sql_fetchrow($result));
        }
    }
    $db->sql_freeresult($result);

    $sql = "SELECT word
        FROM  " . WORDS_TABLE;
    if ($result = $db->sql_query($sql))
    {
        if ($row = $db->sql_fetchrow($result))
        {
            do
            {
                if (preg_match("#\b(" . str_replace("\*", ".*?", preg_quote($row['word'], '#')) . ")\b#i", $username))
                {
                    $db->sql_freeresult($result);
                    return array('error' => true, 'error_msg' => $lang['Username_disallowed']);
                }
            }
            while ($row = $db->sql_fetchrow($result));
        }
    }
    $db->sql_freeresult($result);

//         if ( !preg_match("/^[a-z0-9&\-_\/]+$/i", $username) )
//    {
//        return array('error' => true, 'error_msg' => $lang['Forbidden_characters']);
//     }

    // Disallow " and ALT-255 in username.
    if (strstr($username, '"') || strstr($username, '&quot;') || strstr($username, chr(160)) || strstr($username, chr(173)))
    {
        return array('error' => true, 'error_msg' => $lang['Username_invalid']);
    }

    return array('error' => false, 'error_msg' => '');
}

//
// Check to see if email address is banned
// or already present in the DB
//
function validate_email($email)
{
    global $db, $lang;

    if ($email != '')
    {
        if (preg_match('/^[a-z0-9&\'\.\-_\+]+@[a-z0-9\-]+\.([a-z0-9\-]+\.)*?[a-z]+$/is', $email))
        {
            $sql = "SELECT ban_email
                FROM " . BANLIST_TABLE;
            if ($result = $db->sql_query($sql))
            {
                if ($row = $db->sql_fetchrow($result))
                {
                    do
                    {
                        $match_email = str_replace('*', '.*?', $row['ban_email']);
                        if (preg_match('/^' . $match_email . '$/is', $email))
                        {
                            $db->sql_freeresult($result);
                            return array('error' => true, 'error_msg' => $lang['Email_banned']);
                        }
                    }
                    while($row = $db->sql_fetchrow($result));
                }
            }
            $db->sql_freeresult($result);

            $sql = "SELECT user_email
                FROM " . USERS_TABLE . "
                WHERE user_email = '" . str_replace("\'", "''", $email) . "'";
            if (!($result = $db->sql_query($sql)))
            {
                message_die(GENERAL_ERROR, "Couldn't obtain user email information.", "", __LINE__, __FILE__, $sql);
            }

            if ($row = $db->sql_fetchrow($result))
            {
                return array('error' => true, 'error_msg' => $lang['Email_taken']);
            }
            $db->sql_freeresult($result);

            return array('error' => false, 'error_msg' => '');
        }
    }

    return array('error' => true, 'error_msg' => $lang['Email_invalid']);
}

//
// Does supplementary validation of optional profile fields. This expects common stuff like trim() and strip_tags()
// to have already been run. Params are passed by-ref, so we can set them to the empty string if they fail.
//
function validate_optional_fields(&$icq, &$aim, &$msnm, &$yim, &$skype, &$website, &$location, &$occupation, &$interests, &$phone, &$selfdes, &$sig)
{
    $check_var_length = array('aim', 'msnm', 'yim', 'skype', 'location', 'occupation', 'interests', 'sig');

    for($i = 0; $i < count($check_var_length); $i++)
    {
        if (strlen($$check_var_length[$i]) < 2)
        {
            $$check_var_length[$i] = '';
        }
    }

    // ICQ number has to be only numbers.
    if (!preg_match('/^[0-9]+$/', $icq))
    {
        $icq = '';
    }

    // website has to start with http://, followed by something with length at least 3 that
    // contains at least one dot.
    if ($website != "")
    {
        if (!preg_match('#^http[s]?:\/\/#i', $website))
        {
            $website = 'http://' . $website;
        }

        if (!preg_match('#^http[s]?\:\/\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $website))
        {
            $website = '';
        }
    }

    return;
}

?>


Save and upload to server.
 




____________
Regards,

BIG BOSS
 
BIG BOSSSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Nickname With Russian Letters 
 
BIG BOSS, thank you very much, it works!!!
 



 
RipleySend private messageVisit poster's website  
Back to topPage bottom
Post new topic  Reply to topic  Page 1 of 1
 


Display posts from previous:    

HideWas this topic useful?

Link this topic
URL
BBCode
HTML




 
Permissions List
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events