Skip to:
Content

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#1310 closed defect (fixed)

Anonymous issues

Reported by: mr_pelle Owned by:
Milestone: 1.1 Priority: normal
Severity: major Version: 1.1-alpha
Component: Back-end Keywords: has-patch tested
Cc:

Description

Today I noticed all of my Recently Moderated Items are listed as "Anonymous".. and they link to current user profile.

I tried to delete a new post by another user and links got updated correctly, but names did not: they became all deleted post author's but one, which remained "Anonymous"..

Then I undeleted the post and they all got back to "Anonymous", linking to current user profile.

Seems an issue between anonyous posting and back-end...

P.S: I did no post as anonymous.

Attachments (4)

1310.diff (415 bytes) - added by mr_pelle 4 years ago.
tentative patch
1310.2.diff (1.2 KB) - added by mr_pelle 4 years ago.
patch for dashboard and topic
1310.3.diff (2.7 KB) - added by GautamGupta 4 years ago.
1310.4.diff (4.7 KB) - added by GautamGupta 4 years ago.

Download all attachments as: .zip

Change History (20)

mr_pelle4 years ago

tentative patch

comment:1 mr_pelle4 years ago

  • Keywords has-patch added

Attached a first patch. I've not tested it with posts by real Anonymous users, but it works with "normal" users.

comment:2 mr_pelle4 years ago

  • Keywords tested added

Works with real Anonymous too. =)

comment:3 mr_pelle4 years ago

  • Summary changed from Anonymous issues with Recently Moderated Items to Anonymous issues

Happens on deleted topics too...

mr_pelle4 years ago

patch for dashboard and topic

comment:4 follow-ups: GautamGupta4 years ago

get_topic_author works for me on the topic page but in the admin section, it shows "Anonymous". And get_user_display_name displays nothing for anonymous users.

comment:5 GautamGupta4 years ago

  • Keywords needs-patch added; has-patch tested removed

comment:6 in reply to: ↑ 4 mr_pelle4 years ago

Replying to GautamGupta:

get_topic_author works for me on the topic page but in the admin section, it shows "Anonymous". And get_user_display_name displays nothing for anonymous users.

I didn't know about that, I'm sorry...

get_topic_author works for me too, but not on deleted topics (with view=all).

comment:7 in reply to: ↑ 4 mr_pelle4 years ago

Replying to GautamGupta:

get_user_display_name displays nothing for anonymous users.

I double checked and actually it does not. It works as a charm for me both on the dashboard and on topics (completely deleted or containing deleted posts).

comment:8 follow-up: chrishajer4 years ago

Is this one ready to be checked in?

comment:9 in reply to: ↑ 8 mr_pelle4 years ago

Replying to chrishajer:

Is this one ready to be checked in?

No, sorry. Gautam said get_user_display_name displays nothing for anonymous users: this happens to me on

*) topics started by Anonymous users with the first post deleted,
*) the Topics page in the Dashboard,

but doesn't happen on Recently Moderated Items, which show wrong names linked correctly to the profiles...

comment:10 mr_pelle4 years ago

Correction: it DOES happen on Recently Moderated Items too, I was looking only at topics and not also at posts, which get processed before...

comment:11 GautamGupta4 years ago

Here are 2 more points which I would like to be fixed:

  • Anonymous users shouldn't be allowed to add tags (currently the box is displayed, but even if they write anything in it, tags aren't added)
  • Title Box should be displayed after the Anonymous Posting form

I would try to write a patch for this today.

comment:12 GautamGupta4 years ago

  • Keywords has-patch tested added; needs-patch removed

Ok, I went into the root cause of the issue reported by mr_pelle, here's the explaination:

  • Create a new topic anonymously.
  • Login as admin and go to that topic (the first post is cached, including the author) and then delete the topic.
  • Go to admin panel, you would see something like this in recently moderated items:
    Topic titled ''Topic Name'' started by ''Topic Author''
    
  • But, if the topic was marked as spam by Akismet or the cache wouldn't have been there, then you would see something like this:
    Topic titled ''Topic Name'' started by Anonymous
    
  • Even if you visit the deleted topic, its first post wouldn't be cached because the SQL statement in bb_cache_first_posts contains post_status = 0.
  • But why does get_post_author works and get_topic_author doesn't? Because get_topic_author uses bb_get_first_post which uses bb_cache_first_posts (if cache isn't there), and as it isn't able to cache posts for deleted/spammed topics, Anonymous is displayed.
  • Any solutions? Probably removing post_status = 0 from the SQL statement in bb_cache_first_posts (but it might break other things, I haven't tried this yet).

Attaching the patch for rest 2 points.

GautamGupta4 years ago

comment:13 GautamGupta4 years ago

2 more points :P

  • aria-required isn't required for website field in anonymous posting form, and URL should be Website (I added this in 1310.3.diff)
  • Author name, author email and website url should be sanitized in bb-post.php itself, and errors should be displayed if needed. (I'll add this in the new patch)

GautamGupta4 years ago

comment:14 chrishajer4 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [2511]) Fix multiple anonymous posting issues. Fixes #1310. Props GautamGupta

comment:15 GautamGupta4 years ago

Oh oh.. sorry Mr_Pelle that I misunderstood your ticket as a loginless posting issues ticket (because of the title) and posted some more points. While giving it another thought, I understood what you really meant. Still, this comment of mine applies to that too, and I think we should let it remain because making one wrong right and two rights wrong isn't correct or if you can post a comprehensively tested patch, then we may try it out (it would be better to open up a new ticket for that).

comment:16 mr_pelle4 years ago

I've taken a look at the patch and it actually doesn't fix anything of what I reported. It saddens me to open a new ticket, but the issues remain...

Note: See TracTickets for help on using tickets.