|
Support Incident Tracker GIT4.x
|
Go to the source code of this file.
Functions | |
| if(realpath(__FILE__)==realpath($_SERVER['SCRIPT_FILENAME'])) | journal ($loglevel, $event, $bodytext, $journaltype, $refid) |
| if (realpath(__FILE__)==realpath($_SERVER['SCRIPT_FILENAME'])) journal | ( | $ | loglevel, |
| $ | event, | ||
| $ | bodytext, | ||
| $ | journaltype, | ||
| $ | refid | ||
| ) |
Inserts an entry into the Journal table and marks the user online
| int | $loglevel | The log level required for this event to be logged |
| string | $event | Text title for the event |
| string | $bodytext | Text describing the event in detail |
| int | $journaltype | One of the defined journal types |
| int | $refid | An ID to relate to data, the table this ID is for depends on the journal type used |
Definition at line 30 of file journal.inc.php.
References $bodytext, $CONFIG, $dbJournal, $result, $sql, and E_USER_WARNING.
Referenced by authenticate(), authenticateSQL(), delete_signature(), and display_update_page().
{
global $CONFIG, $sit, $dbJournal;
// Journal Types
// 1 = Logon/Logoff
// 2 = Support Incidents
// 3 = -Unused-
// 4 = Sites
// 5 = Contacts
// 6 = Admin
// 7 = User Management
// Logging Level
// 0 = No logging
// 1 = Minimal Logging
// 2 = Normal Logging
// 3 = Full Logging
// 4 = Max Debug Logging
$bodytext = mysql_real_escape_string($bodytext);
if ($loglevel <= $CONFIG['journal_loglevel'])
{
$sql = "INSERT INTO `{$dbJournal}` ";
$sql .= "(userid, event, bodytext, journaltype, refid) ";
$sql .= "VALUES ('{$_SESSION['userid']}', '{$event}', '{$bodytext}', '{$journaltype}', '{$refid}') ";
$result = mysql_query($sql);
if (mysql_error()) trigger_error(mysql_error(),E_USER_WARNING);
return TRUE;
}
else
{
// Below minimum log level - do nothing
return FALSE;
}
}