diff options
author | Colin Smith <colin@pfsense.org> | 2005-07-10 04:52:37 +0000 |
---|---|---|
committer | Colin Smith <colin@pfsense.org> | 2005-07-10 04:52:37 +0000 |
commit | 20d4d05e86e2f9f9c06bf0ed61c2f7df2e622342 (patch) | |
tree | 6ab0e8830ae3af40ff6f2c9fdacfe4ae2bcb7c29 | |
parent | 8e13319b8f7b38b782cfaf3caf18b4d13aa091b7 (diff) | |
download | pfsense-20d4d05e86e2f9f9c06bf0ed61c2f7df2e622342.zip pfsense-20d4d05e86e2f9f9c06bf0ed61c2f7df2e622342.tar.gz |
* Fix close_notice().
* Add print_notice_box.
* get_notices(): Return false if $notices is null.
-rw-r--r-- | etc/inc/notices.inc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/etc/inc/notices.inc b/etc/inc/notices.inc index 755d4ef..4dff7c2 100644 --- a/etc/inc/notices.inc +++ b/etc/inc/notices.inc @@ -44,7 +44,7 @@ $notice_path = $g['tmp_path'] . '/notices'; * $priority - A notice's priority. Higher numbers indicate greater severity. * 0 = informational, 1 = warning, 2 = error, etc. This may also be arbitrary, */ -function file_notice($id, $notice, $category = "General", $url = "", $priority = 1) { +function file_notice($id, $notice, $category = "General", $url, $priority = 1) { global $notice_path; if(!$queue = get_notices()) $queue = array(); $queuekey = time(); @@ -66,6 +66,7 @@ function get_notices($category = "all") { global $notice_path; if(file_exists($notice_path)) { $queue = unserialize(file_get_contents($notice_path)); + if(!$queue) return false; if($category != 'all') { foreach($queue as $time => $notice) { if(strtolower($notice['category']) == strtolower($category)) @@ -103,10 +104,9 @@ function close_notice($id) { break; } } - /* XXX: what's $queue? This does nothing right now so I commented it out --Bill */ -/* $queueout = fopen($notice_path, "w"); + $queueout = fopen($notice_path, "w"); fwrite($queueout, serialize($queue)); - fclose($queueout);*/ + fclose($queueout); return; } @@ -151,4 +151,10 @@ function print_notices($notices, $category = "all") { return $toreturn; } +function print_notice_box($category = "all") { + $notices = get_notices(); + if(!$notices) return; + print_info_box_np(print_notices($notices, $category)); + return; +} ?> |