A lot of things.
This commit is contained in:
@@ -74,4 +74,9 @@ class XenForoGuard implements Guard
|
||||
$this->user = $user;
|
||||
}
|
||||
|
||||
public function logout(): void
|
||||
{
|
||||
redirect('/');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,10 +4,13 @@ namespace App\Auth;
|
||||
|
||||
use App\Services\XenforoService;
|
||||
use App\XenForoDataTypes\XenForoData;
|
||||
use Filament\Models\Contracts\FilamentUser;
|
||||
use Filament\Models\Contracts\HasName;
|
||||
use Filament\Panel;
|
||||
use Illuminate\Contracts\Auth\Access\Authorizable;
|
||||
use Illuminate\Contracts\Auth\Authenticatable;
|
||||
|
||||
class XenForoUser extends XenForoData implements Authenticatable, Authorizable {
|
||||
class XenForoUser extends XenForoData implements Authenticatable, Authorizable, FilamentUser, HasName {
|
||||
|
||||
use \Illuminate\Foundation\Auth\Access\Authorizable;
|
||||
|
||||
@@ -75,4 +78,31 @@ class XenForoUser extends XenForoData implements Authenticatable, Authorizable {
|
||||
|
||||
return ($this->permissions[$permissionGroup][$permissionName] ?? 0) === true;
|
||||
}
|
||||
|
||||
/* FILAMENT COMPATIBILITY */
|
||||
|
||||
public function canAccessPanel(Panel $panel): bool
|
||||
{
|
||||
return $this->is_admin === 1;
|
||||
}
|
||||
|
||||
public function getFilamentName(): string
|
||||
{
|
||||
return $this->username ?? "XF";
|
||||
}
|
||||
|
||||
public function getAttributeValue($key)
|
||||
{
|
||||
return $this->{$key} ?? null;
|
||||
}
|
||||
|
||||
public function getKey()
|
||||
{
|
||||
return $this->data->user_id;
|
||||
}
|
||||
|
||||
public function getKeyName()
|
||||
{
|
||||
return 'user_id';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user