Answering to "Allow Recent posts only for certain roles?" (http://drupal.org/node/199152) I've found, that there is no hook_perm in tracker.module (Drupal 5.3&5.5).

It cause missing "tracker access" row under Access control page (admin/user/access).

After deep googling, old patch was found, tested and seems to work.

I've insert

/* Implementation of hook_perm() */

function tracker_perm() {
  return array('access recent posts');
}

before

/**
 * Implementation of hook_menu().
 *

and replace

  'callback' => 'tracker_page', 'access' => user_access('access content'),

to

 'callback' => 'tracker_page', 'access' => (user_access('access content') && user_access('access recent posts')),

It works for me, but for sure it need to be tested before patched and committed. Somebody?

P.S. I've attach tracker.module file with code, mentioned above.

Comments

johanneshahn’s picture

also replaced line 48:

'callback' => 'tracker_track_user', 'access' => user_access('access content'),

to:

'callback' => 'tracker_track_user', 'access' => (user_access('access content') && user_access('access recent posts')),

look at if($may_cache) else ->

summit’s picture

Hi,

The hook is not working for me.
The /tracker page is still available for anonymous users while I set the access control to only be accessable to admin.

EDIT: This post maked me happy: http://drupal.org/node/199152#comment-654288
It appears there is also a view tracker. That should also be disabled.
It is working now, thanks for the hook!

Greetings,
Martijn

davemybes’s picture

Version: 5.5 » 5.7
Status: Active » Needs review
StatusFileSize
new1.52 KB

Great fix for a really annoying bug! Thanks. FYI, it also works for 5.7 - patch is attached.

Note, if you have Views enabled, but not tracker, simply disable the "recent posts" View.

drumm’s picture

Version: 5.7 » 7.x-dev
Category: bug » feature

This new permission would remove access to the tracker when upgrading 5.x until an admin sets the new permission. This is not something that should happen during a routine bugfix upgrade.

It would be best to start with the current development version.

lilou’s picture

StatusFileSize
new1.46 KB

Reroll.

lilou’s picture

Status: Needs review » Needs work

CNW since hook_perm update.

aspilicious’s picture

Status: Needs work » Closed (won't fix)

Never heard of tracker module ;)