diff options
| author | Malf Furious <m@lfurio.us> | 2016-04-30 22:19:36 -0400 | 
|---|---|---|
| committer | Malf Furious <m@lfurio.us> | 2016-05-01 01:34:23 -0400 | 
| commit | 6d6e62add5976b3afec23d1745302d676ccd88ac (patch) | |
| tree | aa8824fe72b39382fd12fc056afec6b6e490e3f7 /app/class | |
| parent | 519035a6eb28dd36ce898a80d652c08138b110c5 (diff) | |
| download | scrott-6d6e62add5976b3afec23d1745302d676ccd88ac.tar.gz scrott-6d6e62add5976b3afec23d1745302d676ccd88ac.zip | |
Add function User::rmHeadImage()
Function to delete the user image file for the given user object.
Diffstat (limited to 'app/class')
| -rw-r--r-- | app/class/user.class.php | 11 | 
1 files changed, 11 insertions, 0 deletions
| 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); +    }  }  ?> | 
