Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

access / check for access to forum type in forum post #4658

Closed
Jimmi08 opened this issue Jan 15, 2022 · 0 comments · Fixed by #4717
Closed

access / check for access to forum type in forum post #4658

Jimmi08 opened this issue Jan 15, 2022 · 0 comments · Fixed by #4717
Assignees
Labels
type: bug A problem that should not be happening
Milestone

Comments

@Jimmi08
Copy link
Contributor

Jimmi08 commented Jan 15, 2022

Bug Description

There are different checks or wrong check.

I have imported forums (not created manually). It happened that forum moderator was set to contact class.
As the main admin, I don't have this class, so I shouldn't be forum moderator.

I added new sticky topic. Type wasn't save. It is because this:

$threadVals['thread_sticky'] = (MODERATOR ? (int)$_POST['threadtype'] : 0);

It is correct, I checked value of MODERATOR constant and it was false, so my settings was ignored. As soon as I switched moderator class, it worked.

But why I can see this setting if I am not moderator?
image

There is this check:
if (deftrue('MODERATOR') && $this->var['action'] == "nt" || varset($this->var['thread_datestamp']) == $this->var['post_datestamp'])

With this :

        var_dump(deftrue('MODERATOR'));
        var_dump($this->var['action']);
        var_dump($this->var['thread_datestamp']);
        var_dump($this->var['post_datestamp']);

Values are
For new topic:

  • string(0) ""
  • string(2) "nt"
  • NULL
  • NULL

For edit topic:
string(0) ""
string(4) "edit"
string(10) "1642246300"
string(10) "1642246300"

I think that check should be:

if (deftrue('MODERATOR') && ($this->var['action'] == "nt" || varset($this->var['thread_datestamp']) == $this->var['post_datestamp']))

Thanks

@Jimmi08 Jimmi08 added the type: bug A problem that should not be happening label Jan 15, 2022
@CaMer0n CaMer0n added this to the e107 2.3.2 milestone Mar 27, 2022
CaMer0n added a commit that referenced this issue Mar 27, 2022
Fixes #4658 access / check for access to forum type in forum post
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A problem that should not be happening
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants