Updating modules/backend/models
This commit is contained in:
parent
6ccf49bdd9
commit
07a0a7e428
|
|
@ -37,5 +37,4 @@ class AccessLog extends Model
|
|||
|
||||
return $record;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -66,8 +66,9 @@ class User extends UserBase
|
|||
// return parent::getPersistCode();
|
||||
|
||||
// Option B:
|
||||
if (!$this->persist_code)
|
||||
if (!$this->persist_code) {
|
||||
return parent::getPersistCode();
|
||||
}
|
||||
|
||||
return $this->persist_code;
|
||||
}
|
||||
|
|
@ -77,18 +78,23 @@ class User extends UserBase
|
|||
*/
|
||||
public function getAvatarThumb($size = 25, $default = null)
|
||||
{
|
||||
if ($this->avatar)
|
||||
if ($this->avatar) {
|
||||
return $this->avatar->getThumb($size, $size);
|
||||
else
|
||||
return '//www.gravatar.com/avatar/' . md5(strtolower(trim($this->email))) . '?s='.$size.'&d='.urlencode($default);
|
||||
} else {
|
||||
return '//www.gravatar.com/avatar/'.
|
||||
md5(strtolower(trim($this->email))) .
|
||||
'?s='. $size .
|
||||
'&d='. urlencode($default);
|
||||
}
|
||||
}
|
||||
|
||||
public function afterCreate()
|
||||
{
|
||||
$this->restorePurgedValues();
|
||||
|
||||
if ($this->send_invite)
|
||||
if ($this->send_invite) {
|
||||
$this->sendInvitation();
|
||||
}
|
||||
}
|
||||
|
||||
public function sendInvitation()
|
||||
|
|
@ -100,10 +106,8 @@ class User extends UserBase
|
|||
'link' => Backend::url('backend'),
|
||||
];
|
||||
|
||||
Mail::send('backend::mail.invite', $data, function($message)
|
||||
{
|
||||
Mail::send('backend::mail.invite', $data, function ($message) {
|
||||
$message->to($this->email, $this->full_name);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,8 +31,9 @@ class UserPreferences extends PreferencesBase
|
|||
public function resolveUser($user)
|
||||
{
|
||||
$user = BackendAuth::getUser();
|
||||
if (!$user)
|
||||
if (!$user) {
|
||||
throw new SystemException(trans('backend::lang.user.preferences.not_authenticated'));
|
||||
}
|
||||
|
||||
return $user;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue