Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Safe mode enabled

  • 21-05-2006 12:48pm
    #1
    Registered Users, Registered Users 2 Posts: 1,667 ✭✭✭


    Hi

    I have installed RoundCube webmail client for a website on a php safe mode enabled server. Everything is working good so far except attachment. The script/function won't work due to safe mode restriction i.e. different owner/group id in folder/files created by the script/function. These are the scripts that I hopefully can change to make things work :
    // create temp-dir for uploaded attachments
      if (!empty($CONFIG['temp_dir']) && is_writeable($CONFIG['temp_dir']))
        {
        mkdir($temp_dir, 0777);
        $_SESSION['compose']['temp_dir'] = $temp_dir;
    

    The second one has move_uploaded_file function which won't work with safe mode on.
    $response = '';
    
    foreach ($_FILES['_attachments']['tmp_name'] as $i => $filepath)
      {
      $tmpfname = tempnam($temp_dir, 'rcmAttmnt');
      if (move_uploaded_file($filepath, $tmpfname))
        {
        $_SESSION['compose']['attachments'][] = array('name' => $_FILES['_attachments']['name'][$i],
                                                      'mimetype' => $_FILES['_attachments']['type'][$i],
                                                      'path' => $tmpfname);
    
        $response .= sprintf("parent.%s.add2attachment_list('%s');\n", $JS_OBJECT_NAME, $_FILES['_attachments']['name'][$i]);
        }
      }
    

    I am thinking of coding script to ftp, not sure how does it work really and how safe is it going to be, having ftp logins in the script file.

    Comments and suggestions are always welcome. Thanks.

    Mart


Advertisement