OneBot: Leantime 改造版源码(BOM/Univer 表格/AI 接管/品牌替换等)

This commit is contained in:
wangruiguo
2026-09-03 18:49:20 +08:00
commit d647428529
3501 changed files with 1988906 additions and 0 deletions

View File

@@ -0,0 +1,63 @@
<?php
namespace Leantime\Domain\Auth\Models;
use Illuminate\Contracts\Auth\Authenticatable;
/**
* Lightweight Authenticatable wrapper around a user-data row.
*
* Replaces the `(object) $userRow` stdClass casts in AuthUser/ApiGuard so the provider/guard
* methods satisfy their `?Authenticatable` contracts. It uses dynamic properties on purpose so it
* stays a behavioural drop-in for the old stdClass cast — same property reads, same json/array
* serialization, truthy even when empty — and merely ADDS the Authenticatable accessor methods.
*/
#[\AllowDynamicProperties]
class AuthenticatableUser implements Authenticatable
{
/**
* @param array<string, mixed> $attributes A user row (column => value).
*/
public function __construct(array $attributes = [])
{
foreach ($attributes as $key => $value) {
$this->{$key} = $value;
}
}
public function getAuthIdentifierName(): string
{
return 'id';
}
public function getAuthIdentifier(): mixed
{
return $this->id ?? null;
}
public function getAuthPasswordName(): string
{
return 'password';
}
public function getAuthPassword(): string
{
return $this->password ?? '';
}
public function getRememberToken(): string
{
return $this->remember_token ?? '';
}
public function setRememberToken($value): void
{
// No-op: Leantime does not persist remember tokens (mirrors Auth::setRememberToken and
// AuthUser::updateRememberToken, which are likewise not implemented).
}
public function getRememberTokenName(): string
{
return 'remember_token';
}
}