diff --git a/Rocksolid_Light/common/header.php b/Rocksolid_Light/common/header.php index c6e0a23..057a2a4 100644 --- a/Rocksolid_Light/common/header.php +++ b/Rocksolid_Light/common/header.php @@ -166,22 +166,26 @@ if($unread) { echo ''; echo '
'; function check_unread_mail() { -global $CONFIG, $spooldir; + global $CONFIG, $spooldir; if(isset($_COOKIE['mail_name'])) { $name = strtolower($_COOKIE['mail_name']); $database = $spooldir.'/mail.db3'; - $dbh = head_mail_db_open($database); - $query = $dbh->prepare('SELECT * FROM messages where rcpt_to=:rcpt_to'); - $query->execute(['rcpt_to' => $name]); - $newmail = false; - while (($row = $query->fetch()) !== false) { - if(($row['rcpt_viewed'] != 'true') && ($row['to_hide'] !='true')) { - $newmail = true; + if(is_file($database)) { + $dbh = head_mail_db_open($database); + $query = $dbh->prepare('SELECT * FROM messages where rcpt_to=:rcpt_to'); + $query->execute(['rcpt_to' => $name]); + $newmail = false; + while (($row = $query->fetch()) !== false) { + if(($row['rcpt_viewed'] != 'true') && ($row['to_hide'] !='true')) { + $newmail = true; + } } - } - $dbh = null; - return $newmail; + $dbh = null; + return $newmail; + } else { + return false; } + } } function head_mail_db_open($database, $table='messages') { diff --git a/Rocksolid_Light/rocksolid/overboard.php b/Rocksolid_Light/rocksolid/overboard.php index 0a851c3..cae9d4f 100755 --- a/Rocksolid_Light/rocksolid/overboard.php +++ b/Rocksolid_Light/rocksolid/overboard.php @@ -276,8 +276,9 @@ function display_threads($threads, $oldest) { echo '