From 0d0df93e5e5f84818684753754f60cf19f08239f Mon Sep 17 00:00:00 2001 From: ghost Date: Wed, 21 Feb 2024 10:02:16 +0200 Subject: [PATCH] show post form when the node own this room only --- src/Controller/ModuleController.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/Controller/ModuleController.php b/src/Controller/ModuleController.php index e259676..6221262 100644 --- a/src/Controller/ModuleController.php +++ b/src/Controller/ModuleController.php @@ -129,6 +129,27 @@ class ModuleController extends AbstractController Request $request ): Response { + // Connect kevacoin + $client = new \Kevachat\Kevacoin\Client( + $this->getParameter('app.kevacoin.protocol'), + $this->getParameter('app.kevacoin.host'), + $this->getParameter('app.kevacoin.port'), + $this->getParameter('app.kevacoin.username'), + $this->getParameter('app.kevacoin.password') + ); + + // Check room own + $rooms = []; + foreach ((array) $client->kevaListNamespaces() as $value) + { + $rooms[] = $value['namespaceId']; + } + + if (!in_array($request->get('namespace'), $rooms)) + { + return new Response(); + } + // Connect memcached $memcached = new \Memcached(); $memcached->addServer(