aboutsummaryrefslogtreecommitdiff
path: root/mod/profile/icon.php
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-05-21 14:55:17 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-05-21 14:55:17 +0000
commit11c1b520e80ced1a7f226da0bd5faaaffb11becf (patch)
treefb127b913ee7f038bb90062966bde08f664c5cae /mod/profile/icon.php
parent48274a3bb170696c1514db0a3e0fc9484c2d495a (diff)
downloadelgg-11c1b520e80ced1a7f226da0bd5faaaffb11becf.tar.gz
elgg-11c1b520e80ced1a7f226da0bd5faaaffb11becf.tar.bz2
Assorted profile icon fixes
git-svn-id: https://code.elgg.org/elgg/trunk@668 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/profile/icon.php')
-rw-r--r--mod/profile/icon.php14
1 files changed, 11 insertions, 3 deletions
diff --git a/mod/profile/icon.php b/mod/profile/icon.php
index dd87ff939..c201d7716 100644
--- a/mod/profile/icon.php
+++ b/mod/profile/icon.php
@@ -26,9 +26,17 @@
// Try and get the icon
$filehandler = new ElggFile();
- $filehandler->setFilename($username . $size . ".jpg");
- if ($filehandler->open("read") && $contents = $filehandler->read($filehandler->size())) {
- } else {
+ $filehandler->owner_guid = $user->getGUID();
+ $filehandler->setFilename("profile/" . $username . $size . ".jpg");
+
+ $success = false;
+ if ($filehandler->open("read")) {
+ if ($contents = $filehandler->read($filehandler->size())) {
+ $success = true;
+ }
+ }
+
+ if (!$success) {
global $CONFIG;
$contents = @file_get_contents($CONFIG->pluginspath . "profile/graphics/default{$size}.jpg");