summaryrefslogtreecommitdiffstats
path: root/application/service/files.php
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2016-08-21 15:15:47 +0200
committerFlorian Pritz <bluewind@xinu.at>2016-08-21 15:40:56 +0200
commitce54c1b9c23f4bdb7b2525b8aab66a6ba11bda0d (patch)
tree28216b78b6fa231f442db42b8a390c77fcbb233a /application/service/files.php
parent342e2b1cd341599b734ec581a6c47019b09ac97b (diff)
mfile->add_file: Take userid via argument
This allows for easier testing. Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/service/files.php')
-rw-r--r--application/service/files.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/application/service/files.php b/application/service/files.php
index 9202c7f31..54b1f85af 100644
--- a/application/service/files.php
+++ b/application/service/files.php
@@ -94,12 +94,12 @@ class files {
return $multipaste_info;
}
- static public function add_file_data($id, $content, $filename)
+ static public function add_file_data($userid, $id, $content, $filename)
{
$f = new \libraries\Tempfile();
$file = $f->get_file();
file_put_contents($file, $content);
- self::add_file_callback($id, $file, $filename);
+ self::add_file_callback($userid, $id, $file, $filename);
}
/**
@@ -140,12 +140,12 @@ class files {
return implode("\n", $lines);
}
- static public function add_uploaded_file($id, $file, $filename)
+ static public function add_uploaded_file($userid, $id, $file, $filename)
{
- self::add_file_callback($id, $file, $filename);
+ self::add_file_callback($userid, $id, $file, $filename);
}
- static private function add_file_callback($id, $new_file, $filename)
+ static private function add_file_callback($userid, $id, $new_file, $filename)
{
$CI =& get_instance();
$hash = md5_file($new_file);
@@ -191,7 +191,7 @@ class files {
rename($new_file, $tmpfile);
$dest->commit();
- $CI->mfile->add_file($id, $filename, $storage_id);
+ $CI->mfile->add_file($userid, $id, $filename, $storage_id);
}
static public function verify_uploaded_files($files)