Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

UserName Bug
bluisana
#1 Posted : Wednesday, 12 May 2010 6:42:03 AM(UTC)
Rank: Member

Joined: 15/04/2010(UTC)
Posts: 26
Location: Raleigh

Hey Roger,

I had a user register with a ' in their name. The user name was Sarah's Rescues. I think the ' breaks something in the user admin interface within the gallery. I couldn't edit or delete this user from the interface. I ended up manually deleting (MemberShip.DeleteUser() ) the user and asking them to register with a different name.

Bryan

Roger Martin
#2 Posted : Wednesday, 12 May 2010 9:09:19 AM(UTC)
Roger Martin

Rank: Administration

Joined: 3/08/2007(UTC)
Posts: 3,300
Location: Fort Atkinson, WI

Thanks for letting me know about this. This was actually a bug I fixed last year, but I accidentally "unfixed" it recently when I fixed a different bug that occurred with backslashes in the user or role name.

This will be fixed in the next release. I don't have a workaround at the moment, but if you want to update the source code to get the fix right away, here are the changes:

gs\pages\admin\manageusers.ascx.cs: Find the following two javascript functions and replace with this:

Code:
function getUserName(dataItem)
{{
var userName = dataItem.getMember('UserName').get_value();
// Escape quotes, apostrophes and back slashes. Replace encoded < symbol (#%cLt#%) caused by CA with <
return encodeURI(userName.replace(/""/g, '\\\""').replace(/\\/g, '\\\\').replace(/\'/g, ""\\'"").replace(/#%cLt#%/g, '<'));
}}

function getUserNameNoEncode(dataItem)
{{
var userName = dataItem.getMember('UserName').get_value();
// Escape quotes, apostrophes and back slashes
return userName.replace(/""/g, '\\\""').replace(/\\/g, '\\\\').replace(/\'/g, ""\\'"");
}}


gs\pages\admin\manageroles.ascx.cs: Find the following two javascript functions and replace with this:

Code:
function getRoleName(dataItem)
{{
var roleName = dataItem.getMember('RoleName').get_value();
// Escape quotes, apostrophes and back slashes. Replace encoded < symbol (#%cLt#%) caused by CA with <
return encodeURI(roleName.replace(/""/g, '\\\""').replace(/\\/g, '\\\\').replace(/\'/g, ""\\'"").replace(/#%cLt#%/g, '<'));
}}

function getRoleNameNoEncode(dataItem)
{{
var roleName = dataItem.getMember('RoleName').get_value();
// Escape quotes, apostrophes and back slashes
return roleName.replace(/""/g, '\\\""').replace(/\\/g, '\\\\').replace(/\'/g, ""\\'"");
}}


Roger Martin
Creator and Lead Developer of Gallery Server Pro
bluisana
#3 Posted : Wednesday, 12 May 2010 12:47:52 PM(UTC)
Rank: Member

Joined: 15/04/2010(UTC)
Posts: 26
Location: Raleigh

I hate it when a bug fix breaks an earlier forgotten fix.
Rss Feed  Atom Feed
Users browsing this topic
Guest
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.