summaryrefslogtreecommitdiffstats
path: root/etc/inc/notices.inc
diff options
context:
space:
mode:
authorColin Smith <colin@pfsense.org>2005-07-10 04:52:37 +0000
committerColin Smith <colin@pfsense.org>2005-07-10 04:52:37 +0000
commit20d4d05e86e2f9f9c06bf0ed61c2f7df2e622342 (patch)
tree6ab0e8830ae3af40ff6f2c9fdacfe4ae2bcb7c29 /etc/inc/notices.inc
parent8e13319b8f7b38b782cfaf3caf18b4d13aa091b7 (diff)
downloadpfsense-20d4d05e86e2f9f9c06bf0ed61c2f7df2e622342.zip
pfsense-20d4d05e86e2f9f9c06bf0ed61c2f7df2e622342.tar.gz
* Fix close_notice().
* Add print_notice_box. * get_notices(): Return false if $notices is null.
Diffstat (limited to 'etc/inc/notices.inc')
-rw-r--r--etc/inc/notices.inc14
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;
+}
?>
OpenPOWER on IntegriCloud