Try our conversational search powered by Generative AI!

Can't delete programmatically created user

Vote:
 

Hi!

I'm creating users programmatically via a register function. All goes well, but if I want to delete these users I can't do so in Adminmode. I'm experiencing the same problem both in our site and when extending the Alloysite. When I click on delete, the username seems to be urlencoded, for example as "name%40mysite.se" instead of "name@mysite.se". If I go to the used url directly, /secure/ui/CMS/admin/DeleteMembershipDialog.aspx?NameRoleOrUser=name%40mysite.se&SecurityEntity=0&ProviderName=SqlServerMembershipProvider and change the username to name@mysite.se, the user can be deleted.

Any ideas on how to solve this?

Best regards,

Timea

#64575
Jan 02, 2013 17:47
Vote:
 

Does it work if you create a user with an email address as user name from the admin interface?

#64606
Jan 04, 2013 12:28
Vote:
 

Yes, it all works fine when created in adminmode. The problem is when creating the user from code.

#64639
Jan 04, 2013 21:11
Vote:
 

I also made sure so that the email is not encoded when saving the new user. Any ideas on this,is this a bug or something we're doing wrong?

#64685
Jan 07, 2013 10:50
Vote:
 

I reproduced this now, but the strange thing is that in the installation where I did I can't delete users created in admin mode either... I will research futher but I'm thinking it's probably a bug.

#64693
Jan 07, 2013 11:12
Vote:
 

Yes it is a bug that has been fixed. You can contact support and request a hotfix for bug #91051, or you can try to work around it youself.

The bug is in UserMembership.ascx which is in the UI/CMS/Edit path of the episerver installation (e.g. Program Files (x86)\EPiServer\CMS\7.0.586.1\Application\UI\CMS\Edit). If you change this file directly you have to remember to do so on every machine where your site is going to run.

A (better) alternative is to copy this file to your site project and change it there, and then use the virtual path mapper to replace the file with your version. Check EPiServerFramework.config in a default Alloy installation which has a commented-out example of how to use the virtualPathMappings element and the VirtualPathMappedProvider.

The bug is in line 131 where the call to the javascript function OpenDeleteDialog has a Server.UrlEncode(MembershipUser.Value) statement that should just be MembershipUser.Value without encoding.

#64695
Edited, Jan 07, 2013 11:56
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.