summaryrefslogtreecommitdiffstats
path: root/etc/inc/util.inc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2010-12-10 16:02:18 -0500
committerScott Ullrich <sullrich@pfsense.org>2010-12-10 16:02:18 -0500
commit3aba1835f9d1a45e4f0d17823af2e13a4de19787 (patch)
tree248edb20629448851d3b01b76681565231abf38d /etc/inc/util.inc
parent6735d0929eee41ef1cf2f253fa2a50740c066660 (diff)
downloadpfsense-3aba1835f9d1a45e4f0d17823af2e13a4de19787.zip
pfsense-3aba1835f9d1a45e4f0d17823af2e13a4de19787.tar.gz
Add log_auth() which with send items to syslogd using LOG_AUTH facilities. Use this new log_authh() for login error and success entries
Diffstat (limited to 'etc/inc/util.inc')
-rw-r--r--etc/inc/util.inc19
1 files changed, 18 insertions, 1 deletions
diff --git a/etc/inc/util.inc b/etc/inc/util.inc
index 6c40c45..3cc88e9 100644
--- a/etc/inc/util.inc
+++ b/etc/inc/util.inc
@@ -790,6 +790,23 @@ function log_error($error) {
return;
}
+/****f* util/log_auth
+* NAME
+* log_error - Sends a string to syslog as LOG_AUTH facility
+* INPUTS
+* $error - string containing the syslog message.
+* RESULT
+* null
+******/
+function log_auth($error) {
+ global $g;
+ $page = $_SERVER['SCRIPT_NAME'];
+ syslog(LOG_AUTH, "$page: $error");
+ if ($g['debug'])
+ syslog(LOG_WARNING, var_dump(debug_backtrace()));
+ return;
+}
+
/****f* util/exec_command
* NAME
* exec_command - Execute a command and return a string of the result.
@@ -1468,4 +1485,4 @@ function array_merge_recursive_unique($array0, $array1)
return $result;
}
-?>
+?> \ No newline at end of file
OpenPOWER on IntegriCloud