Browse Source

show post form when the node own this room only

main
ghost 10 months ago
parent
commit
0d0df93e5e
  1. 21
      src/Controller/ModuleController.php

21
src/Controller/ModuleController.php

@ -129,6 +129,27 @@ class ModuleController extends AbstractController
Request $request Request $request
): Response ): 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 // Connect memcached
$memcached = new \Memcached(); $memcached = new \Memcached();
$memcached->addServer( $memcached->addServer(

Loading…
Cancel
Save