Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Z_ChangeStockCode.php does not rename image file
04-19-2013, 11:55 AM,
#6
RE: Z_ChangeStockCode.php does not rename image file
Hi:

The file_exists() does fail depending on the user running the script.

On the very same machine against the very same webERP installation:
- If a regular user (not admin) runs Z_ChangeStockCode.php it says "No image to rename".
- logout and login as admin user... it works perfectly. It finds the image and renames it.
- logut and login again an a 3rd user (not admin) and fails again.

To test the issue added these 4 lines just before the if file_exists() to snif the filesnames and in both cases are OK.

Code:
        $oldfilename = $_SESSION['part_pics_dir'] . '/' .$_POST['OldStockID'].'.jpg';
        $newfilename = $_SESSION['part_pics_dir'] . '/' .$_POST['NewStockID'].'.jpg';
        echo ' OLDNAME ' .$oldfilename;
        echo ' NEW ' .$newfilename;

So, it has to do with some privileges needed for file_exists().

Could you pls test it?
Regards,
Pak Ricard
Reply


Messages In This Thread
RE: Z_ChangeStockCode.php does not rename image file - by PakRicard - 04-19-2013, 11:55 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)