Skip to content

A free open source IT asset/license management system

Only load the remote gravatar image if the server can talk to the outside world

snipeaa0ccf11fa35
diff --git a/app/Models/User.php b/app/Models/User.php
index 67a86782be..9a5180a698 100755
--- a/app/Models/User.php
+++ b/app/Models/User.php
@@ -9,6 +9,7 @@ use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
use Watson\Validating\ValidatingTrait;
use Illuminate\Database\Eloquent\SoftDeletes;
use App\Http\Traits\UniqueUndeletedTrait;
+use App\Models\Setting;
class User extends Model implements AuthenticatableContract, CanResetPasswordContract
{
@@ -146,10 +147,8 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
return config('app.url').'/uploads/avatars/'.$this->avatar;
}
- if ($this->email) {
- // Generate the Gravatar hash
+ if ((Setting::getSettings()->load_remote=='1') && ($this->email!='')) {
$gravatar = md5(strtolower(trim($this->email)));
- // Return the Gravatar url
return "//gravatar.com/avatar/".$gravatar;
}