From 6d6e62add5976b3afec23d1745302d676ccd88ac Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Sat, 30 Apr 2016 22:19:36 -0400 Subject: Add function User::rmHeadImage() Function to delete the user image file for the given user object. --- app/class/user.class.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'app') diff --git a/app/class/user.class.php b/app/class/user.class.php index ab9ecf5..1d17dfe 100644 --- a/app/class/user.class.php +++ b/app/class/user.class.php @@ -195,6 +195,17 @@ class User extends Object { return $this->ar() . "/file.php?d=img/heads&f=" . $this->guid; } + + /* + * Remove this user's head image + */ + function rmHeadImage() + { + if (!is_file("assets/img/heads/" . $this->guid)) + return true; + + return unlink("assets/img/heads/" . $this->guid); + } } ?> -- cgit v1.2.3