user_access('administer basic_webmail') ?
      watchdog('basic_webmail', 'The !server_settings for Basic webmail have not yet been configured. Please do that before checking your e-mail.', array('!server_settings' => l('server settings', 'admin/settings/basic_webmail')), WATCHDOG_ERROR) :
      watchdog('basic_webmail', 'The server settings for Basic webmail have not yet been configured. Please do that before checking your e-mail.', WATCHDOG_ERROR)

Comments

hefox’s picture

Title: Fix the watchdog messages based on current user's settings » Watchdog message is different based on the current user's permissions (whereas the viewer of logs is all that matters)
Project: Basic webmail fork » Basic webmail
Version: » 6.x-1.x-dev
Status: Active » Needs review
hefox’s picture

oadaeh’s picture

I guess what you're saying here is that if a user has access to view the logs, they'll also likely have access to configure the system? Or is it that it doesn't matter whether they have access to configure the system?

hefox’s picture

The user that triggers the watchdog message isn't likely the user that is viewing the watchdog messages. With syslog, that person could be some random ops guy permission without even an account to the site.

But yea, usually it's assumed if given permission to see reports, can likely configure site.

oadaeh’s picture

Status: Needs review » Fixed

Okay. I get you. The argument of the user creating the watchdog message not the same as the user seeing it is what swayed me. The other is still not convincing enough, but that's an aside.

Commited the the Drupal 6 branch here: http://drupalcode.org/project/basic_webmail.git/commit/83541dd
Commited the the Drupal 7 branch here: http://drupalcode.org/project/basic_webmail.git/commit/cc0b4ff

Status: Fixed » Closed (fixed)

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