A lot of things.

This commit is contained in:
2026-06-08 16:25:52 +02:00
parent 6f6d6b9b84
commit f529f74823
94 changed files with 9178 additions and 107 deletions

View File

@@ -74,4 +74,9 @@ class XenForoGuard implements Guard
$this->user = $user;
}
public function logout(): void
{
redirect('/');
}
}

View File

@@ -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';
}
}