thomascube
2005-12-11 9fc381f4e8712fec0e7b67c0f4e7af0980261e16
Check if log files are writeable


2 files modified
10 ■■■■ changed files
program/include/bugs.inc 8 ●●●● patch | view | raw | blame | history
program/steps/mail/sendmail.inc 2 ●●● patch | view | raw | blame | history
program/include/bugs.inc
@@ -67,12 +67,18 @@
    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']);
      }
    }
/*
program/steps/mail/sendmail.inc
@@ -283,7 +283,7 @@
               $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);