summaryrefslogtreecommitdiffstats
path: root/application/models/mfile.php
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2016-08-20 23:10:36 +0200
committerFlorian Pritz <bluewind@xinu.at>2016-08-21 15:40:56 +0200
commit1ce6e4b4f78b633296db099acf8b18577906a6a4 (patch)
tree787859f0c54fde3971e045f1d5a6badd940086f3 /application/models/mfile.php
parentce54c1b9c23f4bdb7b2525b8aab66a6ba11bda0d (diff)
muser: Add delete_user()
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/models/mfile.php')
-rw-r--r--application/models/mfile.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/application/models/mfile.php b/application/models/mfile.php
index 6b7b38d41..748d187a3 100644
--- a/application/models/mfile.php
+++ b/application/models/mfile.php
@@ -202,6 +202,18 @@ class Mfile extends CI_Model {
}
}
+ public function delete_by_user($userid)
+ {
+ $query = $this->db->select("id")
+ ->where("user", $userid)
+ ->get("files")->result_array();
+ $ids = array_map(function ($a) {return $a['id'];}, $query);
+
+ foreach ($ids as $id) {
+ $this->delete_id($id);
+ }
+ }
+
public function delete_id($id)
{
$filedata = $this->get_filedata($id);