mirror of
https://github.com/kevachat/webapp.git
synced 2025-01-22 12:34:25 +00:00
show post form when the node own this room only
This commit is contained in:
parent
f0bafed3ce
commit
0d0df93e5e
@ -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(
|
||||
|
Loading…
x
Reference in New Issue
Block a user