Remove file change ownership on file upload
This commit is contained in:
parent
7c3bb65f8b
commit
9203e2426b
|
@ -48,7 +48,7 @@ class Media extends StandardController
|
||||||
|
|
||||||
if (!file_put_contents($new_file_path, 'a'))
|
if (!file_put_contents($new_file_path, 'a'))
|
||||||
{
|
{
|
||||||
throw new \Exception('pute de merde');
|
throw new \Exception('Cannot write file ' . $new_file_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!rename($tmpfile_path, $new_file_path))
|
if (!rename($tmpfile_path, $new_file_path))
|
||||||
|
@ -56,16 +56,6 @@ class Media extends StandardController
|
||||||
throw new \Exception('Cannot create file ' . $new_file_path);
|
throw new \Exception('Cannot create file ' . $new_file_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!chown($new_file_path, fileowner($user_path)))
|
|
||||||
{
|
|
||||||
throw new \Exception('Cannot give file ' . $new_file_path . ' to user : ' . fileowner($user_path));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!chgrp($new_file_path, filegroup($user_path)))
|
|
||||||
{
|
|
||||||
throw new \Exception('Cannot give file ' . $new_file_path . ' to group : ' . filegroup($user_path));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!chmod($new_file_path, self::DEFAULT_CHMOD))
|
if (!chmod($new_file_path, self::DEFAULT_CHMOD))
|
||||||
{
|
{
|
||||||
throw new \Exception('Cannot give file ' . $new_file_path . ' rights : ' . self::DEFAULT_CHMOD);
|
throw new \Exception('Cannot give file ' . $new_file_path . ' rights : ' . self::DEFAULT_CHMOD);
|
||||||
|
|
Loading…
Reference in New Issue