- Fix conflicts

This commit is contained in:
Dave M. 2026-07-01 13:29:51 -04:00
parent c181cdfb28
commit 90a2f4d083
8 changed files with 40 additions and 16 deletions

View File

@ -5,6 +5,8 @@ use Ulmus\User\{Entity,
Lib\Authorize, Lib\Authorize,
Middleware\HeaderAuthenticationMiddleware, Middleware\HeaderAuthenticationMiddleware,
Middleware\PostRequestAuthenticationMiddleware, Middleware\PostRequestAuthenticationMiddleware,
Middleware\LocalMacAddressMiddleware,
Authorize\MacAddressAuthentication,
Authorize\PostRequestAuthentication}; Authorize\PostRequestAuthentication};
use Picea\Picea; use Picea\Picea;
@ -24,6 +26,10 @@ return [
PostRequestAuthenticationMiddleware::class => create(PostRequestAuthenticationMiddleware::class)->constructor(get(Entity\UserInterface::class), get('authentication.error'), get(PostRequestAuthentication::class)), PostRequestAuthenticationMiddleware::class => create(PostRequestAuthenticationMiddleware::class)->constructor(get(Entity\UserInterface::class), get('authentication.error'), get(PostRequestAuthentication::class)),
MacAddressAuthentication::class => create(MacAddressAuthentication::class)->constructor(get(Authenticate::class), "mac"),
LocalMacAddressMiddleware::class => create(LocalMacAddressMiddleware::class)->constructor(get(Entity\UserInterface::class), get('authentication.error'), get(MacAddressAuthentication::class)),
'authentication.method' => null, 'authentication.method' => null,
'authorize.error' => function($c) { 'authorize.error' => function($c) {

View File

@ -40,7 +40,7 @@ return [
EmailConfiguration::class => function($c) { EmailConfiguration::class => function($c) {
$email = new EmailConfiguration( EmailConfiguration::AUTH_TYPE_SMTP ); $email = new EmailConfiguration( EmailConfiguration::AUTH_TYPE_SMTP );
$email->smtpHost = getenv('SMTP_HOSTNAME'); $email->smtpHost = getenv('SMTP_HOST');
$email->smtpPort = getenv('SMTP_PORT'); $email->smtpPort = getenv('SMTP_PORT');
$email->smtpUsername = getenv('SMTP_USERNAME'); $email->smtpUsername = getenv('SMTP_USERNAME');
$email->smtpPassword = getenv('SMTP_PASSWORD'); $email->smtpPassword = getenv('SMTP_PASSWORD');

View File

@ -82,6 +82,13 @@ trait ControllerTrait {
return HttpFactory::createRedirectResponse($url, $code, $headers); return HttpFactory::createRedirectResponse($url, $code, $headers);
} }
#[Ignore]
protected function refresh(int $code = 204, array $headers = []) {
return static::renderNothing($code, [
'Refresh' => 0
] + $headers);
}
#[Ignore] #[Ignore]
public static function renderNothing(int $code = 204, array $headers = []) : ResponseInterface public static function renderNothing(int $code = 204, array $headers = []) : ResponseInterface
{ {

View File

@ -11,9 +11,9 @@ use Psr\Http\Message\StreamInterface;
class HttpFactory implements HttpFactoryInterface class HttpFactory implements HttpFactoryInterface
{ {
public static function createResponse(string $url, int $code = 302, array $headers = []) : ResponseInterface public static function createResponse(mixed $body = 'php://memory', int $code = 200, array $headers = []) : ResponseInterface
{ {
return new Response($url, $code, $headers); return new Response($body, $code, $headers);
} }
public static function createRedirectResponse(string $url, int $code = 302, array $headers = []) : ResponseInterface public static function createRedirectResponse(string $url, int $code = 302, array $headers = []) : ResponseInterface
@ -63,6 +63,6 @@ class HttpFactory implements HttpFactoryInterface
public static function createStream(string $content): StreamInterface public static function createStream(string $content): StreamInterface
{ {
return (new StreamFactory())->createStream($content); return new StreamFactory()->createStream($content);
} }
} }

View File

@ -244,4 +244,15 @@ class Lean
return call_user_func($func); return call_user_func($func);
} }
public static function path(...$parts) : string
{
return implode(DIRECTORY_SEPARATOR, $parts);
}
public static function rawPath(...$parts) : string
{
return implode(DIRECTORY_SEPARATOR, $parts);
}
} }

View File

@ -43,7 +43,6 @@ class FileDownloadResponse extends Response
else { else {
$finfo = finfo_open(FILEINFO_MIME_TYPE); $finfo = finfo_open(FILEINFO_MIME_TYPE);
$mime = finfo_file($finfo, $filepath); $mime = finfo_file($finfo, $filepath);
finfo_close($finfo);
} }
parent::__construct( parent::__construct(

View File

@ -0,0 +1,11 @@
{% arguments array $contextList %}
{% if $contextList %}
<div class="message-wrapper">{% php
foreach($contextList as $name => $context) {
foreach($context->formContextMessages ?? [] as $message) {
echo $message->render();
}
}
%}</div>
{% endif %}

View File

@ -5,14 +5,4 @@
if ($context && ! in_array($context, $messageList)) { if ($context && ! in_array($context, $messageList)) {
$messageList[] = $context; $messageList[] = $context;
} }
%} %}{% block "lean/block/message", $messageList %}{% endblock %}
{% if $messageList %}
<div class="message-wrapper">{% php
foreach($messageList as $name => $context) {
foreach($context->formContextMessages ?? [] as $message) {
echo $message->render();
}
}
%}</div>
{% endif %}