[development] access module

Earnie Boyd earnie at users.sourceforge.net
Fri Aug 22 12:43:58 UTC 2008


Quoting Balazs Dianiska <csillagasz at gmail.com>:

> Hi all,
>
> for work I am thinking on implementing an access logging module, but
> before I would start head on I would like to ask your opinion on the
> subject. Drupal core provides a logging module (the access module),
> which effectively logs on hook_exit. The problem I have with this
> approach is that this
> a) as far I know will get ignored for aggressive caching,
> b) it gets triggered for page load from any source.
>
> I thought about using a JavaScript snippet placed into the page (maybe
> with token so it couldn't be misused, but then a cached page is not
> trivial) as most bots cant run the JS. Is there any way a callback
> like this could be validated for a cache stored page? What do you
> think of the approach?
>

Have you researched existing solutions?  
http://www.google.com/search?q=access+log+site%3Adrupal.org%2Fproject

Are you looking for a method to log each form access?

Create a module foo.

<?php
function foo_form_alter ($form_id, &$form) {
  global $user;
  watchdog ('form access', t('@uid accessed @form_id', array('@uid' => 
$user->uid, '#form_id' => $form_id)));
}
?>

Earnie -- http://for-my-kids.com/
-- http://give-me-an-offer.com/



More information about the development mailing list