I currently use the legal module to display the terms and conditions to a user's first login. In other words, the user logs in, the terms and conditions page appears, and then they get on to the rest of the site.

The problem is on the watchdog log, the "Session opened for..." message gets logged twice, one for the login upon approaching the terms and conditions, and one for accepting the terms and conditions.

Just to make sure the duplicate entry was coming from the legal module, I took a look at the legal.module file. Under the "legal_login_submit" function, I see the call to watchdog (it's on line 599 for 5.x-1.0... do a find for "Session opened" and you should see it). I commented out this line, and indeed I only get one line in the watchdog log (even when changing the terms and conditions and getting prompted again with an existing user who agreed to the old terms and conditions). This line appears to be in both official releases: 5.x-1.0 and 4.7.x-1.0.

I know this may not seem very important relative to other issues, but it is important to me as I'm recording the number of logins from the watchdog table and I don't want to have to recomment this line out after every module upgrade.

Is it safe for me to just comment out the call to watchdog, or is it there for an important reason? Again, this only gets recorded twice on the user's first time logging into a site (when they view the terms and conditions); the watchdog log is being reported correctly otherwise which is why I haven't commented the watchdog call out from the other module.

Comments

robert castelo’s picture

Version: 5.x-1.0 » 6.x-7.x-dev
Status: Active » Closed (fixed)

Have changed this in the Drupal 6 version.

Watchdog message is now:

Legal: accepted T&C version .