Improve syslog integration
- correctly open log - log only failures Issue #6146 Signed-off-by: Michal Čihař <michal@cihar.com>
This commit is contained in:
parent
95819f1557
commit
6fe468f7db
@ -22,10 +22,12 @@ function PMA_logUser($user, $status = 'ok')
|
||||
apache_note('userID', $user);
|
||||
apache_note('userStatus', $status);
|
||||
}
|
||||
if (function_exists('syslog')) {
|
||||
if (function_exists('syslog') && $status != 'ok') {
|
||||
@openlog('phpMyAdmin', LOG_NDELAY | LOG_PID, LOG_AUTHPRIV);
|
||||
@syslog(
|
||||
LOG_AUTHPRIV,
|
||||
'phpMyAdmin: ' . $user . ' (' . $status . ') from ' . $_SERVER['REMOTE_ADDR']
|
||||
LOG_WARNING,
|
||||
'user denied: ' . $user . ' (' . $status . ') from ' .
|
||||
$_SERVER['REMOTE_ADDR']
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user