1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Adding Usergroup to moderator log?

Discussion in 'XenForo Development Discussions' started by Phases, Aug 3, 2015.

  1. Phases

    Phases Active Member

    We have many staff members, and many have rights such as split, edit, move - but are not in the "moderating" usergroup because they do not need access to the report center, and because I use @moderating to 'mention' the mods specifically, etc.

    Is there an easy place to edit in this usergroup's ID for moderator log inclusions? I don't like not having an audit trail, plus we have a custom developed log viewer that was developed to monitor these users activities (prior to moving to xf, in vb - and we migrated it too, and it worked at first, but only because it had current log entries to work with that came over from VB) - and this no longer is useful.

    Any insight appreciated .
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    Moderator logging is not based on user groups. It's based on whether the user is set up as a moderator in Admin CP > Users > Moderators.

    Their actions will only be logged if they are Moderators. Which group those users are in doesn't matter.
     
  3. Phases

    Phases Active Member

    Yes.... right. That's.. why I'm asking this at all. We have users who are not in the moderator usergroup who perform moderator actions, so I would like to include their usergroup ID in whatever function determines what is wrote to the log.

    You know. Somewhere it may say "if 'Moderating' then write to log". I'd like to change that to "if 'Moderating' OR 'usergroup == 16' then write to log".
     
  4. James

    James Well-Known Member

    An addon can manipulate the log but you've already said users perform moderator actions but aren't in the group.

    As per Chris, anyone who has a moderator permission ticked or is set as a moderator in the Users -> Moderators then their actions will be logged anyway.

    In short, they should be in the moderator log if they are in the list of Moderators (not the usergroup, the admin CP moderator section).
     
  5. Phases

    Phases Active Member

    I don't want these users to be in the moderating usergroup - because then they have access to the report center, etc etc.
     
  6. Chris D

    Chris D XenForo Developer Staff Member

    Being in the "Moderating" user group doesn't make someone a moderator nor does it give them access to the report centre.

    Making them a Moderator doesn't put them in the "Moderating" user group automatically -- the actual user group they are placed in can be defined as the Moderator is added/edited (they don't actually have to be in an additional user group at all).

    If you made them a Moderator it would automatically provide the logging facility. It would give them access to the Report Centre page, but they would only actually see and be able to action reports for the content they are allowed to manage.

    As an example, they would only see reports for posts in forums where they have permission to both delete any post and edit any post.

    Based on your first post, moderators who can split, edit or move posts won't actually see any reports. It does somewhat make the Reports link being visible somewhat superfluous, but it seems like the most simple way (and the correct way) to ensure their actions are logged.
     
  7. Phases

    Phases Active Member

    Sorry I think I meant "moderator" in back end, not the "moderating" usergroup. We don't want to put them in Moderator because theyn yes they get the report center.

    Since they have edit, delete, move, merge etc, site wide, they would see all reports, yes?

    They don't have ban, moderate threads..

    They don't operate on reports, so, reports to move or edit etc still aren't relevant to them. They operate off a specific set of instructions, keeping FAQ threads updated, etc. I would like what they do logged though.

    So, I got a little confused on your post. Does my clarification here help?

    You know what would be easier. I'll bet I can put them in Moderator, get things logged - but then edit the "reports" link itself to only show to appropriate people, and hide for them.

    That would probably do it..
     
    Last edited: Aug 3, 2015
  8. Chris D

    Chris D XenForo Developer Staff Member

    They need the edit any, AND delete any permission. So, if they can't delete, they won't see any reports.

    The reports link will still show, so yes, you may still want to do this.
     
  9. Phases

    Phases Active Member

    Arg, they do have edit and delete, my mistake.

    I feel like I'm getting closer though, thanks for the replies.

    Still, shouldn't there be a code snippit to modify, to log their actions in addition to 'moderator' ?
     
  10. Phases

    Phases Active Member

    Maybe I should just phase out this group or, simply let them in report center. Problem is, mods use report center to report and discuss this other usergroup, too.
     
  11. Mike

    Mike XenForo Developer Staff Member

    I think it's actually OR. (As not having either removes the posts.) The reports are basically visible if the user has the ability to take an action against the content.

    Look at XenForo_ModeratorLogHandler_Abstract::log(). That has the conditions for logging.
     
    Phases likes this.
  12. Phases

    Phases Active Member

    Awesome will look there. Appreciate everyone's help.
     
  13. Phases

    Phases Active Member

    In log.php ?
     
  14. Chris D

    Chris D XenForo Developer Staff Member

    Abstract.php function log
     
  15. Phases

    Phases Active Member

    Appreciate it thanks guys!
     
  16. Phases

    Phases Active Member

    Worked, thanks a lot!
     
  17. jellytoe

    jellytoe Member

    What was the solution? I'm having the exact same issue.
     
  18. Phases

    Phases Active Member

    Well.. In abstract.php there is this chunk:

    Code:
    if (  !$logUser['user_id'] || !$logUser['is_moderator'] || !$this->isLoggable($logUser, $content, $action) )
      {
       return false;
      }
    We basically told it to ignore those checks if they are in usergroup 16. Didn't go about it the cleanest way and need to refine but, proof of concept so we're happy.

    Hope this helps!
     
  19. jellytoe

    jellytoe Member

    Can you share your revised code to exclude these conditionals for usergroup 16?
     

Share This Page