Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Users posting in categories/root

I found a few other threads with similar problems but none of them seemed to have the answer.
People are posting in "categories/root" (on purpose) which for some reason exists, and I can't find any way to lock it.

Is there any way to stop this?

I'm using vanilla 2.0.18.10

Answers

  • whu606whu606 I'm not a SuperHero; I just like wearing tights... MVP

    @Skynum‌

    Welcome to the community.

    In Dashboard, under Forum, have you set Categories to

    Display root categories as headings.

  • R_JR_J Ex-Fanboy Munich Admin

    There is no check in the DiscussionModel for CategoryID >=1 so if someone really wants to post to root category he can always spoof he http request. In order to prevent that, you would have to write a simple plugin:

    public function DiscussionModel_BeforeSaveDiscussion_Handler($Sender) {
       $Sender->Validation->AddRule('NoRootCategoryID', 'regex:/^[1-9]\d*$/');
       $Sender->Validation->ApplyRule('CategoryID', 'NoRootCategoryID', T('GOTCHA!'));
    }
    
Sign In or Register to comment.