Gossamer Forum
Home : Products : DBMan : Customization :

Admin Screen auth_logging

Quote Reply
Admin Screen auth_logging
Quick question for you all. Does anyone know of a way to log the actions that an administrator takes, to the log file (thorough $auth_logging). I have several administrators that have access to that screen, and would like to know (via the log file) who did what (i.e. Added new user name, changed users password, changed permissions, etc). (i.e. Admin2 changed user Test1 permissions 0:0:0:0:0 at <time> <date>), etc.

Thanks for all your help in advance!
Chris Kinsler

Quote Reply
Re: Admin Screen auth_logging In reply to
What you'll need to do is open up your db.cgi file and edit the admin_display sub-routine.

The sub-routine is split into 4 main sections, Adding, Deleting, Updating and Displaying usernames, each is separated by comments describing the upcoming section. The first 3 sections are the one's we'll be editing.

Towards the bottom of each section, you'll see code similar to:
$message = something...
last CASE;
};


All you need to do is add the logging fuction with your particular message, for example, for the delete section:
$found ?
($message = "User: $in{'username'} deleted.") :
($message = "Unable to find userid: $in{'username'} in password file.");
&auth_logging("deleted $in{'username'}") if ($auth_logging);
last CASE;
};


Note that the variable $in{'username'} varies slightly between sections, so take note of which section you're in, and use the following:
$in{'new_username'} for the new user section
$in{'username'} for the update and delete sections

If you'd like some more detailed steps, let me know.

Good luck!

- Mark


Astro-Boy!!
http://www.zip.com.au/~astroboy/