Do a better job of saving the original avatar from Facebook
This commit is contained in:
parent
3b28f226c7
commit
000e5c0c01
|
@ -458,9 +458,13 @@ class FacebookfinishloginAction extends Action
|
||||||
common_log(LOG_WARNING, 'Couldn\'t save tmp Facebook avatar: ' . $tmpname, __FILE__);
|
common_log(LOG_WARNING, 'Couldn\'t save tmp Facebook avatar: ' . $tmpname, __FILE__);
|
||||||
} else {
|
} else {
|
||||||
// save it as an avatar
|
// save it as an avatar
|
||||||
|
|
||||||
|
$file = new ImageFile($user->id, Avatar::path($tmpname));
|
||||||
|
$filename = $file->resize(180); // size of the biggest img we get from Facebook
|
||||||
|
|
||||||
$profile = $user->getProfile();
|
$profile = $user->getProfile();
|
||||||
|
|
||||||
if ($profile->setOriginal($tmpname)) {
|
if ($profile->setOriginal($filename)) {
|
||||||
common_log(
|
common_log(
|
||||||
LOG_INFO,
|
LOG_INFO,
|
||||||
sprintf(
|
sprintf(
|
||||||
|
@ -475,7 +479,7 @@ class FacebookfinishloginAction extends Action
|
||||||
__FILE__
|
__FILE__
|
||||||
);
|
);
|
||||||
|
|
||||||
// clean up
|
// clean up tmp file
|
||||||
@unlink(Avatar::path($tmpname));
|
@unlink(Avatar::path($tmpname));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user