PHPBB W3ALL Transfer does not transfer usernames on Cyrillic

Post a reply


This question is a means of preventing automated form submissions by spambots.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

If you wish to attach one or more files enter the details below.

Maximum filesize per attachment: 1 MiB.

Expand view Topic review: PHPBB W3ALL Transfer does not transfer usernames on Cyrillic

Re: PHPBB W3ALL Transfer does not transfer usernames on Cyrillic

by axew3 » Sun Sep 15, 2024 7:20 am

2.9.0 will allow to add or migrate phpBB usernames in WordPress in any language and characters.
To apply, on 2.9.0 > it is required to do just this:
https://www.axew3.com/w3/2024/09/phpbb- ... haracters/

2.9.0 will be released today after some test more.
Please read the linked post and report what you think if you can, about my final considerations.
Thank you

Re: PHPBB W3ALL Transfer does not transfer usernames on Cyrillic

by axew3 » Sun Sep 08, 2024 7:50 pm

2.9.0 add an option that will allow to add usernames transliterated into WordPress as Latin alphabet (any language) as default, OR into any other language.
Considered alphabets are as follow (not all will works, but the most important and common yes) and the function can:

detect and return the type of the alphabet in $text
OR
return transliterated $text from an alphabet to any another

Code: Select all

# https://www.regular-expressions.info/unicode.html // Unicode Scripts

# Human writing systems switches Test function - axew3.com

#$text = 'ڳاڙهو چنڊ'; # Arabic
#$text = '红月亮'; # Chinese (Hans): do not work transliterating into chinese some other language. Works transliterating from chinese to others (almost all others that works!)
#$text = 'двойняшки'; # Cirillic
#$text = "Well, Latin text it's the only one i know!";

# Note: Han (Chinese) transliteration (Any-Hans transliterator ID)) and SOME OTHER lang alphabet will not work: it maybe require different ids for the transliteration (not tested all, anyway the most important works fine)
# The function return false if there is no transliteration result

# Note:
# The ' $tolang ' param expect the Language name into one of these formats/names (CaseSensitive):
# Arabic,Armenian,Bengali,Bopomofo,Braille,Buhid,Canadian_Aboriginal,Cherokee,Cyrillic,Devanagari,Ethiopic,Georgian,Greek,Gujarati,Gurmukhi,Han,Hangul,Hanunoo,Hebrew,Hiragana,Inherited,Kannada,Katakana,Khmer,Lao,Latin,Limbu,Malayalam,Mongolian,Myanmar,Ogham,Oriya,Runic,Sinhala,Syriac,Tagalog,Tagbanwa,TaiLe,Tamil,Telugu,Thaana,Thai,Tibetan,Yi

# any passed text is converted/transliterated to LATIN ASCII then transliterated again to the required Language (one of the above) using again transliterator_transliterate

//$test = w3all_detect_convert_language($text, $toLang = 'Arabic');
//$test = w3all_detect_convert_language($text, $toLang = '', $returnDetectLang = true);

# C 2024 axew3.com
function w3all_detect_convert_language($text, $toLang = '', $returnDetectLang = false)
{
....
....
Considered languages are as follow

Code: Select all

Arabic,Armenian,Bengali,Bopomofo,Braille,Buhid,Canadian_Aboriginal,Cherokee,Cyrillic,Devanagari,Ethiopic,Georgian,Greek,Gujarati,Gurmukhi,Han,Hangul,Hanunoo,Hebrew,Hiragana,Inherited,Kannada,Katakana,Khmer,Lao,Latin,Limbu,Malayalam,Mongolian,Myanmar,Ogham,Oriya,Runic,Sinhala,Syriac,Tagalog,Tagbanwa,TaiLe,Tamil,Telugu,Thaana,Thai,Tibetan,Yi

Re: PHPBB W3ALL Transfer does not transfer usernames on Cyrillic

by axew3 » Fri Sep 06, 2024 7:54 am

I am a little confused on how this thing should be managed.
I see this morning, giving to the code some minutes of tests, that even setting as Russian the language into WP, when i go to register a name in Cyrillic like let say нужно починить, that translated into Latin chars is needs to be fixed (a strange test username ok, but legit), WordPress answer the follow:
Ошибка: Это имя пользователя некорректно, поскольку оно содержит недопустимые символы. Пожалуйста, введите корректное имя пользователя.
so
Error: This username is invalid because it contains invalid characters. Please enter a valid username.
Why this happen and how so, if a login done by user_login/username will not work (work of course by email instead) and WP do not recognize the username passed as Cyrillic even if the wp is set as Russian, and the email is not updated as observed and described above,
then my question is: the code of the integration plugin, should transliterate all usernames as Latin and store usernames in Latin?

Re: PHPBB W3ALL Transfer does not transfer usernames on Cyrillic

by axew3 » Thu Sep 05, 2024 9:45 pm

Hello, i am testing all added new features and fixes, any way and i note this into a default WP, about usernames added in native alphabet,
so if the user is transferred and added in Cyrillic alphabet in WP.
When the user go to update the email into his profile, the change email is sent, but the WordPress return error
Cannot create a user with an empty login name.
It seem that the wp_insert_user some way is fired along the user update, and i suspect that it happen because the passed user_login to the WP update profile function, test for the username if it exists or not, and seem to not recognize that the passed Cyrillic username exist, then try to create the user. Not reversed and i do not exactly know.
Then after that anyway the change email, email, is sent, when i go to click into the link to confirm the email change, the wordpress profile message say that the email successfully changed, but instead it reset to the old one.
And i cannot login into wordpress using the user_login/username, but only using the email.


If i set WordPress in Cyrillic, when i go to change the email, i get the same
Нельзя создать пользователя с пустым логином.
that i assume without translating it that mean
Cannot create a user with an empty login name.
And even if the confirmation email is sent, when i click the confirmation email, the email is not updated at all.

This happen by default in WP, it has been tested that is not due to the integration plugin that it happen.
How do you manage this thing?

Re: PHPBB W3ALL Transfer does not transfer usernames on Cyrillic

by madnnes » Mon Sep 02, 2024 7:18 am

Hey,

Thanks a lot! It's working now :)

All my cyrillic usernames are properly transferred now.

Re: PHPBB W3ALL Transfer does not transfer usernames on Cyrillic

by axew3 » Sun Sep 01, 2024 5:24 pm

No worry, i tested it any way, and it is ready.
You should substitute
into the plugin /admin/ folder
the file wp_w3all_users_to_wp.php
with this one:
wp_w3all_users_to_wp.zip
(4.24 KiB) Downloaded 32 times
then into the /common/ folder add the follow file:
helpers.zip
(746 Bytes) Downloaded 32 times
Users are now transferred in cyrillic, if the username into phpBB is in cyrillc.
The plugin code will allow with few easy modifications, to transfer users in any native language (i did it for this, even if actually it is still just for cyrillic).
2.9.0 will add users in cyrillic (or any other language) onlogin and when on verify_credential (logged in user in phpBB added on fly into WP because present a valid phpBB session cookie).

Probably the code will use the included function on the helpers.php file that translate the cyrillic based on the alphabet and that i've found in internet, and not the native Php (depend if it is active or not into your php.ini) transliterator_transliterate() function. Let know if the alphabet is correct
and all works as expected!

Top