Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Quick solution for 'edit' folder being deleted  (Read 15376 times)

0 Members and 1 Guest are viewing this topic.

yoshikiwei

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Posts: 68
Quick solution for 'edit' folder being deleted
« on: September 22, 2004, 08:22:17 am »

My /albums/edit folder is being deleted every now and then.
And getting frustrated with it, I decided to modify the following codes in upload.php

upload.php, find
Code: [Select]
function spring_cleaning($directory_path) {

    //First we get the transitory directory handle.
    $directory_handle = opendir($directory_path);

    // Exit if the directory cannot be opened.
    if(!$directory_handle) {

        // Return.
       return;

    }
replace with
Code: [Select]
function spring_cleaning($directory_path) {

    //First we get the transitory directory handle.
    $directory_handle = @opendir($directory_path);

    // Exit if the directory cannot be opened.
    if(!$directory_handle) {

        // Return.
mkdir($directory_path, 0777);
        return;

    }

this codes simply creates the edit folder if it cannot be opened

use this at your own risks and preference
« Last Edit: September 22, 2004, 06:44:42 pm by yoshikiwei »
Logged

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: Quick solution for 'edit' folder being deleted
« Reply #1 on: September 22, 2004, 06:12:07 pm »

Actually, you should use the albums path that's in the config settings instead of hardcoding it.  Like this:

Code: [Select]
global $CONFIG;
mkdir('.' . $CONFIG['fullpath'] . 'edit', 0777);
Logged
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

yoshikiwei

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Posts: 68
Re: Quick solution for 'edit' folder being deleted
« Reply #2 on: September 22, 2004, 06:45:36 pm »

true enough
or perhaps I should use $directory_path instead

btw, have the dev team already know what causes the edit folder to be deleted ?
Logged

erroneus

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 58
Re: Quick solution for 'edit' folder being deleted
« Reply #3 on: September 22, 2004, 10:07:19 pm »

Ok, so what's the fix for this?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Quick solution for 'edit' folder being deleted
« Reply #4 on: October 26, 2004, 05:16:46 am »

as suggested (just summarizing the previous posts up): edit upload.php, find
Code: [Select]
function spring_cleaning($directory_path) {

    //First we get the transitory directory handle.
    $directory_handle = opendir($directory_path);

    // Exit if the directory cannot be opened.
    if(!$directory_handle) {

        // Return.
       return;

    }
and replace with
Code: [Select]
function spring_cleaning($directory_path) {
    global $CONFIG;
    //First we get the transitory directory handle.
    $directory_handle = @opendir($directory_path);

    // Exit if the directory cannot be opened.
    if(!$directory_handle) {
mkdir('.' . $CONFIG['fullpath'] . 'edit', 0777);
        // Return.
        return;
    }
This is a quick-and-dirty fix - wouldn't mind if I were you though, it won't break anything.

Joachim
Logged

Pauky

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Quick solution for 'edit' folder being deleted
« Reply #5 on: November 27, 2004, 08:40:05 pm »

Hey guys,

I'm assuming the above problem relates to me.  I've noticed that my 'edit' directory keeps losing it's permissions (from 755 to 666).  I think this is because it's getting deleted as well.  I changed the code in the 'pload.php' but it's not adding the 777 permissions and I get the following error:

 Warning: mkdir(.albums/edit): No such file or directory in /c59/ewiddel/gallery/upload.php on line 402


I did a search on the above errors with different variations, but found thing.  

Any ideas guys?  In the mean time, I'll call my Web hosting company to have them change the permissions to 755 again.  Thanks in advance.
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: Quick solution for 'edit' folder being deleted
« Reply #6 on: November 28, 2004, 04:41:29 pm »

Open your include/picmgmt.inc.php file, and find and change '0666' to '0755'.
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

Pauky

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Quick solution for 'edit' folder being deleted
« Reply #7 on: November 30, 2004, 01:54:10 am »

I changed the 0666 to 0755 on the include/picmgmt.inc.php file and that didn't seem to work.  I verified that the Albums, Albums/userpics, and albums/edit folders are set to 755.

I still get Warning: mkdir(.albums/edit): No such file or directory in /c59/ewiddle/gallery/upload.php on line 402 when I click on the upload link and the following when I actually try and upload a picture (the same symptoms that everyone gets when the 'edit' folder isn't set to 755 although mine is.  Any ideas?

Warning: move_uploaded_file(./edit/mHTTP_temp_2995890e.jpg): failed to open stream: No such file or directory in /c59/ewiddle/gallery/upload.php on line 1155

Warning: move_uploaded_file(): Unable to move '/tmp/phpkkemiK' to './edit/mHTTP_temp_2995890e.jpg' in /c59/ewiddle/gallery/upload.php on line 1155
Logged
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 15 queries.