summaryrefslogtreecommitdiffstats
path: root/app/class
diff options
context:
space:
mode:
authorMalf Furious <m@lfurio.us>2016-05-01 01:42:30 -0400
committerMalf Furious <m@lfurio.us>2016-05-01 01:42:30 -0400
commitd431ef2954455ad38454d27f5be866061794b4bf (patch)
treeceb03f3c9cf27e5c388cbc923476d9df5b49c10b /app/class
parent93fa361ba63c8afa2370c43b7918c9dd513a4586 (diff)
parent395f7ed73b0b868027285512040fbfe3d0adf347 (diff)
downloadscrott-d431ef2954455ad38454d27f5be866061794b4bf.tar.gz
scrott-d431ef2954455ad38454d27f5be866061794b4bf.zip
Merge branch 'feature/user-img-mgmt' into dev
Diffstat (limited to 'app/class')
-rw-r--r--app/class/form.class.php4
-rw-r--r--app/class/user.class.php19
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);
+ }
}
?>