summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-02-11 01:20:58 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-02-11 01:20:58 +0000
commit7b2274cb1d33756ce23aae4b0de21235ebdf1f8e (patch)
treee3aa462a0367a3f1fe37a2dab6fa576a92176e07 /usr
parentbfd3e48743b399055876b6df70cf23a964e851eb (diff)
downloadpfsense-7b2274cb1d33756ce23aae4b0de21235ebdf1f8e.zip
pfsense-7b2274cb1d33756ce23aae4b0de21235ebdf1f8e.tar.gz
* Introduce pfsense specific utilities file for easier syncing with m0n0wall util.inc
* Introduce new log_error() command that logs to syslog * Convert all old syslog() functions to use log_error()
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/www/diag_backup.php4
-rwxr-xr-xusr/local/www/pkg_mgr_install.php7
2 files changed, 6 insertions, 5 deletions
diff --git a/usr/local/www/diag_backup.php b/usr/local/www/diag_backup.php
index 4bb6d41..76edb6a 100755
--- a/usr/local/www/diag_backup.php
+++ b/usr/local/www/diag_backup.php
@@ -64,7 +64,7 @@ if ($_POST) {
$command = "/sbin/sysctl -a | grep carp";
$fd = fopen($_FILES['conffile']['tmp_name']);
if(!$fd) {
- syslog(LOG_WARNING, "Warning, could not open " . $_FILES['conffile']['tmp_name']);
+ log_error("Warning, could not open " . $_FILES['conffile']['tmp_name']);
return 1;
}
while(!feof($fd)) {
@@ -72,7 +72,7 @@ if ($_POST) {
}
fclose($fd);
if(stristr($tmp, "m0n0wall" != FALSE)) {
- syslog(LOG_WARNING, "Upgrading m0n0wall configuration to pfsense.");
+ log_error("Upgrading m0n0wall configuration to pfsense.");
/* m0n0wall was found in config. convert it. */
$onlyconsonants = str_replace("m0n0wall", "pfsense", $tmp);
fopen($_FILES['conffile']['tmp_name'], "w");
diff --git a/usr/local/www/pkg_mgr_install.php b/usr/local/www/pkg_mgr_install.php
index d905118a..91a38ec 100755
--- a/usr/local/www/pkg_mgr_install.php
+++ b/usr/local/www/pkg_mgr_install.php
@@ -174,6 +174,7 @@ if($_GET['showlog'] <> "") {
* open logging facility
*/
$fd_log = fopen("/tmp/pkg_mgr.log", "w");
+if(!$fd_log) log_error("Warning, could not open /tmp/pkg_mgr.log for writing");
fwrite($fd_log, "Begin of Package Manager installation session.\n");
if(!file_exists("/tmp/pkg_config.xml")) {
@@ -301,7 +302,7 @@ foreach ($packages_to_install as $id) {
fwrite($fd_log, "Begining (" . $id. ") " . $pkgent['name'] . " package installation.\n" . $status);
- syslog(LOG_WARNING, "Begining (" . $id. ") " . $pkgent['name'] . " package installation.");
+ log_error("Begining (" . $id. ") " . $pkgent['name'] . " package installation.");
update_progress_bar($pb_percent);
$pb_percent += 10;
@@ -486,11 +487,11 @@ foreach ($packages_to_install as $id) {
if($status <> "") {
update_status("Package installation completed.");
fwrite($fd_log, "Package installation completed.\n");
- syslog(LOG_WARNING, "Package " . $pkgent['name'] . " installation completed okay.");
+ log_error("Package " . $pkgent['name'] . " installation completed okay.");
} else {
update_status("Package WAS NOT installed properly.");
fwrite($fd_log, "Package WAS NOT installed properly.\n");
- syslog(LOG_WARNING, "Package " . $pkgent['name'] . " did not install correctly.");
+ log_error("Package " . $pkgent['name'] . " did not install correctly.");
}
} else {
update_status("Package installation completed.");
OpenPOWER on IntegriCloud