I do not want the activity module to record my admin user's action like create node or update feed, can i be able to disable it from certain user/content type ? thx

Comments

jaydub’s picture

The new 5.4 branch and the new 6.x branch have each contrib
module's activity settings displayed on their own page now reached
via the activity admin page admin/settings/activity. There are
checkboxes for each contrib module's activity token type and
activity operation types. When activity records are about to
be written a check is done to see if the relevant combination of
token type and operation type is enabled and only then is the
activity record written.

See also #237240: privacy? for privacy option which you could use to not write
activity for the admin user.

Note that you should not test this out on a production site as
many token patterns have changed and no upgrade functions
have been written at this point.

#314433: Activity 6.1 & 5.4

sirkitree’s picture

Status: Active » Fixed

Pretty much fixed I'd say.

mjourney2’s picture

Title: Can I only record activity for certain user/content type? » Not logging activity for Visitors (unregistered users)
Version: 5.x-3.0-beta2 » 6.x-1.x-dev

My activity page is flooded with actions from anonymous users and I would like to disable that. Is there a way to make it so that only the activity of registered users is recorded?

Thank you

jaydub’s picture

Title: Not logging activity for Visitors (unregistered users) » Not logging activity for anonymous users
Status: Fixed » Active

that's probably another good option to consider adding. I'll add it to the TODO list.

jaydub’s picture

Assigned: Unassigned » jaydub
sirkitree’s picture

Category: support » task
jaydub’s picture

Issue tags: +activity-6.x-1-0-rc1

tagging

jaydub’s picture

Thinking of this approach:

new permission of 'hide activity' which enabled for a role means that the user's activity will not be recorded. So for anon users enabling 'hide activity' for anonymous role will stop that activity from being recorded.

jaydub’s picture

Status: Active » Needs review
StatusFileSize
new842 bytes
new1.03 KB

For sirkitree to review:

attached patch shows the changes made to activity.module and to one of the contrib modules (nodeactivity here) to add in the check for 'hide activity'. Changes to other contrib modules are similar.

sirkitree’s picture

Status: Needs review » Needs work

I don't think the extra function is really needed.

Simply do this in nodeactivity.module

        // User hide activity permission check
        if (!user_access('hide activity', $user)) {
          return FALSE;
        }

instead of

        // User hide activity permission check
        if (activity_user_hide_activity($user)) {
          return FALSE;
        }

You can search for the string if (!user_access in core to see this used.

jaydub’s picture

yeah I'm guilty of function-itis. If the basic idea is sound, change the status to RTBC and I'll implement as in #10

sirkitree’s picture

Status: Needs work » Reviewed & tested by the community
jaydub’s picture

Status: Reviewed & tested by the community » Fixed

added to CVS.

alexking’s picture

Is it just me, or does this latest code make it so that it's impossible for the admin user to log activities?

// User hide activity permission check
if (user_access('hide activity', $user)) {
   return FALSE;
}

That user_access call is always going to return true for an admin, right? I know this is something some people want, but it isn't very configurable, and is odd when you update and the admin user stops logging altogether.

Status: Fixed » Closed (fixed)
Issue tags: -activity-6.x-1-0-rc1

Automatically closed -- issue fixed for 2 weeks with no activity.