ASPX templates
Version 5.x > ASPX templates > CMSEnsureSafeUserNames doesn't seem to be taking. View modes: 
User avatar
BitWise Blake - 11/16/2011 8:39:39 AM
CMSEnsureSafeUserNames doesn't seem to be taking.
I've added the value <add key="CMSEnsureSafeUserNames" value="false" /> to the web.config on a v5.5.4248 R2 site, and it's either not taking, or the setting doesn't do what I think.

From CMS Desk / Administration / Users / Edit, trying to edit a username, if i add a space, and hit OK, it still displays the message
Please enter valid user name. The user name can contain only alphanumeric characters and some of special characters (_, -, ., @, \).

My understaning of CMSEnsureSafeUserNames was that, if set to false, it would allow anything at that point. Is that correct?

If so, any ideas why it's not taking? I saved the web.config which should have reset things as they were, and for safe measure, restarted the site in IIS and did Restart Application under Site Manager.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 11/18/2011 2:54:00 AM
RE:CMSEnsureSafeUserNames doesn't seem to be taking.

The user name can have just the specified characters at any time - this is the .Net specification. That key you are using is just when using Windows authentication and it tells whether the "domain\username" format should be converted to "domain-username" format. The slash is being rmeoved if that key is set to true to ensure correct wildcard URLs behavior.

Best regards,
Juraj Ondrus