"Already used" in User profile edit page. using Japanese

irieweb
@irieweb
2 years ago
12 posts
Hi

If i enter Japanese in "profile_name" on the profile change screen, an error will occur.

"The User Name you have entered is already being used by another account."

This phenomenon always occurs when the user inputs in Japanese, but there is no problem when accessing as Admin.

Which specification is correct for this?

My hope is that "user_name"and"profile_url" should be a-z,0-9,-, but I would be happy if "profile_name" could be in Japanese.

Thank You!




--
I am not good at English. I do not really understand scripts like PHP. Please forgive me. It is difficult to find information on JAMROOM in Japanese.
NORIYOSHI TAKEUCHI

updated by @irieweb: 04/08/23 10:13:14PM
michael
@michael
2 years ago
7,692 posts
The profile_name_url needs to be in A-Z characters. Jamroom doesnt have a translitteration system to change 'マイケル' to 'michael' so what happens is the characters gets stripped and it becomes '' which is the same for anyone else using all japanese characters.

Try using the FORM DESIGNER on the profile update page to add the form field profile_name_url and enter a-z characters in there.

There is no issue with 2 profiles using the same profile_name but there is an issue with 2 profiles using the same profile_name_url because thats what gets used at yoursite.com/profile_name_url
irieweb
@irieweb
2 years ago
12 posts
Thank you! @micheal

I understand.

Using Japanese characters for "profile_name" is fine, but there is a problem with "profile_name_url", so we limit it to "A-Z" only.

Am I correct in this understanding?

I was a little skeptical.

As shown in the attached image, you can set it to Japanese by logging in as Admin and editing profile_name.

Attachments: Login-Admin1-4 JPG

If you log in with a user account, an error will occur even if the same process is performed. I didn't realize this.

Attachment: Login-User1~3 JPG

Please let me know if there is any discomfort.

For us, being able to use Japanese for profile names is a big advantage. Japanese people often search in Japanese. (Reference: Google search.jpg)

What problems can I expect if I use an administrator account and change to Japanese?

Thank you for your busy time! アリガトウゴザイマス!
Login-Admin-1.jpg
Login-Admin-1.jpg  •  51KB

Login-Admin-2.jpg
Login-Admin-2.jpg  •  62KB

Login-Admin-3.jpg
Login-Admin-3.jpg  •  54KB

Login-Admin-4.jpg
Login-Admin-4.jpg  •  122KB

Login-User-1.jpg
Login-User-1.jpg  •  52KB

Login-User-2.jpg
Login-User-2.jpg  •  61KB

Login-User-3.jpg
Login-User-3.jpg  •  102KB

formDesigner.jpg
formDesigner.jpg  •  76KB

Google-Search.jpg
Google-Search.jpg  •  58KB




--
I am not good at English. I do not really understand scripts like PHP. Please forgive me. It is difficult to find information on JAMROOM in Japanese.
NORIYOSHI TAKEUCHI

updated by @irieweb: 11/19/22 07:44:39AM
michael
@michael
2 years ago
7,692 posts
I tested what I thought might work and it didn't work. I'll look into the code and see if there's some way to get it going.
irieweb
@irieweb
2 years ago
12 posts
Sorry for inconvenience💦


--
I am not good at English. I do not really understand scripts like PHP. Please forgive me. It is difficult to find information on JAMROOM in Japanese.
NORIYOSHI TAKEUCHI
michael
@michael
2 years ago
7,692 posts
Sorry I haven't got to this yet, been a bit busy. I will get a test environment setup and find the cause.
michael
@michael
2 years ago
7,692 posts
Ok, I can see the issue and why it was done that way. The technical reason is: Because there is no way to preg_match just japanese characters.

The closest code I found to matching hiragana and katakan and kanji is:
preg_match('/[^a-zA-Z0-9\p{Katakana}\p{Hiragana}\p{Han}]', $value)
but the problem with that is it does allow * and ? through and probably more.

So since we cant be SURE that what the user is passing in as their profile_name does not contain code used to hack the site the use of those characters are limited to admin users only.

Admin will be able to change a profile name to japanese characters but a regular user will not be able to.

Unless I can locate some validation system that will ONLY let valid characters through but not extra code then this can't be changed.

Maybe Japanese programmers have a way to do it, but I don't know it unfortunately.
irieweb
@irieweb
last year
12 posts
Thank you! and happy new year!
Sorry I'm late in checking this reply.
I will try to find a Japanese programmer and give them advice.
I have one more question, but I'm having trouble setting up PayPal in Japanese Yen. Which file of mine should I modify to make the changes here?


--
I am not good at English. I do not really understand scripts like PHP. Please forgive me. It is difficult to find information on JAMROOM in Japanese.
NORIYOSHI TAKEUCHI
michael
@michael
last year
7,692 posts
Most of the time you don't want to modify any of the jamroom files because those changes will be over-written if there is a module update. Instead what you want to do is use the "Events and Listeners" system to adjust other modules by building your own.

Then you know that since your custom module will never be updated other than by you that your changes will always work.

Docs: "Events and Listeners"
https://www.jamroom.net/the-jamroom-network/documentation/module-developer-guide/1011/events-and-listeners

If its not possible to get to the point you want to adjust without changing a core module let us know and we'll add in an event close to the point you're after or adjust the core module with the change.
irieweb
@irieweb
last year
12 posts
Thank You! @micheal
I'll look into what adjustments are needed.


--
I am not good at English. I do not really understand scripts like PHP. Please forgive me. It is difficult to find information on JAMROOM in Japanese.
NORIYOSHI TAKEUCHI

Tags