diff options
Diffstat (limited to 'app/class')
-rw-r--r-- | app/class/form.class.php | 4 | ||||
-rw-r--r-- | app/class/user.class.php | 19 |
2 files changed, 22 insertions, 1 deletions
diff --git a/app/class/form.class.php b/app/class/form.class.php index 907c0a2..fd85638 100644 --- a/app/class/form.class.php +++ b/app/class/form.class.php @@ -191,7 +191,9 @@ class Form { if ($file['error'] > 0) { - $this->logError("An unknown error occurred"); + if ($file['error'] != UPLOAD_ERR_NO_FILE) + $this->logError("An unknown error occurred"); + return false; } diff --git a/app/class/user.class.php b/app/class/user.class.php index 1130396..1d17dfe 100644 --- a/app/class/user.class.php +++ b/app/class/user.class.php @@ -187,6 +187,25 @@ class User extends Object return "glyphicon glyphicon-user"; } + + /* + * Get this user's head image + */ + function getHeadImage() + { + 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); + } } ?> |