Jump to content

[SOLVED] webcalendar 1.2 problem


jmr3460

Recommended Posts

I get a warning when I try and set the admin settings for the Webcalendar 1.2 the warning says:

Warning: unlink(/tmp/cf556e7d9a5d3658018d3287e86fccbezB1dat) [function.unlink]: Operation not permitted in /home/crowleys/public_html/calendar/includes/dbi4php.php on line 828

This is the snippet from the script:

function dbi_clear_cache () {
  global $db_connection_info;

  if ( empty ( $db_connection_info['cachedir'] ) )
    return 0;

  $cnt = 0;
  $fd = @opendir ( $db_connection_info['cachedir'] );
  if ( empty ( $fd ) )
    dbi_fatal_error ( translate ( 'Error opening cache dir' ) . ': '
       . $db_connection_info['cachedir'] );

  $b = 0;
  while ( false !== ( $file = readdir ( $fd ) ) ) {
    if ( preg_match ( '/^\S\S\S\S\S\S\S\S\S\S+.dat$/', $file ) ) {
      // echo 'Deleting ' . $file . '<br />';
      $cnt++;
      $fullpath = $db_connection_info['cachedir'] . '/' . $file;
      $b += filesize ( $fullpath );
      if ( ! unlink ( $fullpath ) )
        echo '<!-- ' . translate ( 'Error' ) . ': '
         . str_replace ( 'XXX', translate ( 'delete' ),
          translate ( 'Could not XXX file' ) ) . " $file. -->\n";
      // TODO: log this somewhere???
    }
  }
  return $cnt;
}

It seems to be an infinite loop, I have to stop the browser from running it.

Can anyone help? Is there another function used instead of unlink().

Link to comment
Share on other sites

  • 1 month later...

The reason for the error is because it's trying to delete the temp files in the /tmp dir of the server.

Which you do not have access to delete those files.

 

I found my solution to be a bit more correct, as the application was designed to have a temp file system. Yes you can comment out the line db_cachedir:

But you can also change it to another path. 

 

Example: db_cachedir: /home/user/tmp_cal

Then CHMOD permissions to 0777

 

This will let the application do what is was designed to do. 

 

Also remember for security reasons do not make db_cachedir: in or after www or public_html

 

Hope this helps others..

 

-Anthony

Link to comment
Share on other sites

Thanks, yea that is what I finally did. I will have to look into where I have my temp folder.  Does anyone know how I can check to see if my send_reminder.php is not sending me my email? I really do not know what it does yet. Can anyone answer these question?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.