diff options
| author | roundcube <roundcube@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2005-12-11 23:19:48 +0000 |
|---|---|---|
| committer | roundcube <roundcube@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2005-12-11 23:19:48 +0000 |
| commit | f4976fb36afdb30f8740ecd17c663c9fb81cf1f8 (patch) | |
| tree | 0759f6d8f1a8d7e2fd4ce93c5a9f0630bd8e3971 | |
| parent | 9b7197a96f70232c254b7ff6ec84de7a9f34b024 (diff) | |
Check if log files are writeable
git-svn-id: https://svn.roundcube.net/trunk@90 208e9e7b-5314-0410-a742-e7e81cd9613c
| -rw-r--r-- | roundcubemail/program/include/bugs.inc | 8 | ||||
| -rw-r--r-- | roundcubemail/program/steps/mail/sendmail.inc | 2 |
2 files changed, 8 insertions, 2 deletions
diff --git a/roundcubemail/program/include/bugs.inc b/roundcubemail/program/include/bugs.inc index bc1a2932d..771f1aeda 100644 --- a/roundcubemail/program/include/bugs.inc +++ b/roundcubemail/program/include/bugs.inc @@ -67,12 +67,18 @@ function log_bug($arg_arr) if (empty($CONFIG['log_dir'])) $CONFIG['log_dir'] = $INSTALL_PATH.'logs'; - if ($fp = fopen($CONFIG['log_dir'].'/errors', 'a')) + // try to open specific log file for writing + if ($fp = @fopen($CONFIG['log_dir'].'/errors', 'a')) { fwrite($fp, $log_entry); fclose($fp); } + else + { + // send error to PHPs error handler + trigger_error($arg_arr['message']); + } } /* diff --git a/roundcubemail/program/steps/mail/sendmail.inc b/roundcubemail/program/steps/mail/sendmail.inc index 8ec30b0a7..6a3b51123 100644 --- a/roundcubemail/program/steps/mail/sendmail.inc +++ b/roundcubemail/program/steps/mail/sendmail.inc @@ -283,7 +283,7 @@ if ($CONFIG['smtp_log']) $mailto, $msg_subject); - if ($fp = fopen($CONFIG['log_dir'].'/sendmail', 'a')) + if ($fp = @fopen($CONFIG['log_dir'].'/sendmail', 'a')) { fwrite($fp, $log_entry); fclose($fp); |
