إضافة 'anonymous*' إلى reserved_usernames يمنع إنشاء بنية الاسم 'AnonymousXX' في وضع Anonymous

Continuing the discussion from How to anonymise a single post?:

I tried this just now, and the anonymous user created for the user was 20-character set of seemingly random alphanumeric characters beginning with cb426… I had expected it to be in the format “anonymous99” or “anonymous100”.

Is this a bug or am I doing something the wrong way?

إعجابَين (2)

I have just impersonated a test user and then entered anonymous mode and the name generated is in the anonymousNN style.

Is this something you can replicate on more than one account?

إعجاب واحد (1)

Yes, it’s the same (albeit a different random username) for another user I tried it with.

I’m using 2.9.0.beta10 (0c38757250).

إعجابَين (2)

I wonder whether I have anonymous mode enabled for TL1+ and was trying to impersonate/anonymise a TL0 user. I’ll check later.

إعجاب واحد (1)

I made sure that allow anonymous posting was set, that anonymous posting min trust level was 0, created a brand new user, logged in as that user (not impersonating), entered anonymous mode, and the username created was…

30d844ebb6818fcb7eab

So it’s something about anonymising on its own, rather than just when impersonating. I’ll change the title of this topic from Anonymous user created when impersonating user doesn’t begin with “anonymous” to something more accurate.

P.S. still 2.9.0.beta10 (0c38757250)

Do you have a lot of anonymous users?

I think this was fixed at the time, but there may have been a regression?

إعجاب واحد (1)

Just over a dozen, plus four of these 20-random-character users in the last fortnight or so.

The person it cropped up for had created a real username “Anonymous20” when the next anonymised name would have been “anonymous20” (I can’t remember the actual number).

(I then renamed him and added “anonymous” to the list of words you can’t use in a username.)

Could that be relevant?

إعجاب واحد (1)

This sounds promising. Let me check on my test site. :+1:

إعجاب واحد (1)

Cheers. Looking at it, to reserved usernames I added anonymous and anonymous*

I’ve just removed those two additions, and it all works fine again! Thanks for pointing me to the old topic which made me think of this.

It would still be good to prevent users from creating accounts with the word “anonymous” in it, but still have anonymous mode work properly. I guess this is still a bug.

إعجاب واحد (1)

It’s the anonymous* that’s the culprit:

image

The user_name_suggester checks the reserved names before allocating one, so adding that will be what’s gumming it up: :+1:

إعجاب واحد (1)

Thanks for clarifying this.

Maybe it would be better for Discourse to check reserved usernames but ignore any prohibition on the word “anonymous” when creating an anonymous user.

إعجاب واحد (1)

I’d like to prevent the word “Anonymous” being used in a username except for when created by Discourse’s anonymous mode.

This wasn’t possible because of the problem noted above (i.e. preventing humans from using “Anonymous” also prevents Discourse’s anonymous mode from using it).

But has it been changed since then?