How To / General

When Joomla User Name contains space

  • Claudio
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
11 years 5 days ago #1 by Claudio
When Joomla User Name contains space was created by Claudio
When a user register to Joomla with a username containing space (for example "Claudio Bartoloni") the registration ends in error
XML-RPC Error (404): Unknown error
The user do not receive any email form the site (as it should be) and cannot login to the site.
The only way to solve the problem is to enter the administration site edit the user profile to remove the space from the user name (for example "ClaudioBartoloni"), set the user as activated and enabled and the problem is solved.
I'm asking here if Joomdle can be modified to be compatible with usernames containing spaces or send a message to the user to inform that spaces are not allowed in username field.
Thanks a lot

Please Log in or Create an account to join the conversation.

More
11 years 5 days ago #2 by Antonio Durán
Replied by Antonio Durán on topic When Joomla User Name contains space
Hi.

This is a Moodle restriction: it does not allow spaces in usernames.

To deal with this, we created the Joomdle user check plugin, that you can download at: www.joomdle.com/download/category/27-plugins-additional
This plugin will check username before registration, and inform user that spaces are not allowed if he tries to use one in his username.

Please Log in or Create an account to join the conversation.

  • Claudio
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
11 years 5 days ago #3 by Claudio
Replied by Claudio on topic When Joomla User Name contains space
Super!

Please Log in or Create an account to join the conversation.

  • Claudio
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
11 years 5 days ago #4 by Claudio
Replied by Claudio on topic When Joomla User Name contains space
The plugin also check that the username do not contains upper case letters.
This is a problem with existing users that are already active in Joomdle and Moodle
If the user try to update his profile in Joomla the plugin do not allow the user to save his profile because the username contains upper case letters.
If the user change his username to lower case the plugin say that there is another user register with the same email.
Probably I need to disable this upper case check in the plugin but there is no option for this.
I have disabled the plugin to avoid lots of problems with my users
Could you please help?

Please Log in or Create an account to join the conversation.

More
11 years 5 days ago #5 by Antonio Durán
Replied by Antonio Durán on topic When Joomla User Name contains space
Uppercase is not allowed in usernames in Moodle anymore:
tracker.moodle.org/browse/MDL-42993

This has changed in Moodle some time ago.

You can check it yourself if you have a current version: try to create a user with uppercase in Moolde, and it will fail with "Only lowercase letters allowed".

Please Log in or Create an account to join the conversation.

  • Claudio
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
11 years 5 days ago #6 by Claudio
Replied by Claudio on topic When Joomla User Name contains space
I'm using Moodle 2.6.
I confirm you that is not possible to create a new user with uppercase characters in the username field.
But I suppose that when a user register in Joomla using uppercase letters Joomdle transform the username in lowercase and create a username in Moodle
This will explain why uppercase username appear lowercase in moodle

Please Log in or Create an account to join the conversation.

More
11 years 4 days ago #7 by Antonio Durán
Replied by Antonio Durán on topic When Joomla User Name contains space
You are right: Joomdle converts username to lowercase when syncing to Moodle.

Please Log in or Create an account to join the conversation.

  • Claudio
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
11 years 4 days ago #8 by Claudio
Replied by Claudio on topic When Joomla User Name contains space
OK,
why the plugin do not allow an existing and synced user to update his profile if the username is not lowercase in Joomla?
The plugin should know that an uppercase username has been converted to lowercase when synced to moodle so why bother the user about his username being not lowercase?
I cannot enable the plugin because it disturb existing users but in this way I cannot prevent new user from inserting spaces in the username field and this is dangerous.
I'm trapped into this conflicting constraint.

Please Log in or Create an account to join the conversation.

More
11 years 4 days ago #9 by Chris
Replied by Chris on topic When Joomla User Name contains space
The plugin is the current way as this is how it was requested from other customers. If you require a custom modification that is unique to your situation, we can discuss this and make it work the way you need.

You may also wish to look at your registration process. For example,
- if you are using the standard Joomla registration form, you can override the form using template overrides and insert messages telling the user the type of username that is required.
- if you are using CB, Jomsocial, VM, Hikashop, or other 3rd party extensions for registration, most of these allow you to include validation checks to ensure the user is entering the username the way you wish.
- you can also implement 3rd party plugins that will perform validation against the standard Joomla registration form.

Please Log in or Create an account to join the conversation.

More
11 years 3 days ago #10 by Antonio Durán
Replied by Antonio Durán on topic When Joomla User Name contains space
You are right: the plugin should not check old users.

You should be able to fix that editing plugins/user/joomdleusercheck/joomdleusercheck.php, function onUserBeforeSave.
At the start of the function add:
Code:
if (!$isnew) return true;

Please Log in or Create an account to join the conversation.