|
|
@ -61,20 +61,6 @@ class RoomController extends AbstractController |
|
|
|
$this->getParameter('app.kevacoin.password') |
|
|
|
$this->getParameter('app.kevacoin.password') |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
// Set title |
|
|
|
|
|
|
|
$name = $request->get('namespace'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach ((array) $client->kevaListNamespaces() as $namespace) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
// Get current room namespace (could be third-party) |
|
|
|
|
|
|
|
if ($namespace['namespaceId'] == $request->get('namespace')) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
$name = $namespace['displayName']; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Check for external rooms reading allowed in config |
|
|
|
// Check for external rooms reading allowed in config |
|
|
|
if ( |
|
|
|
if ( |
|
|
|
!in_array( |
|
|
|
!in_array( |
|
|
@ -178,7 +164,6 @@ class RoomController extends AbstractController |
|
|
|
return $this->render( |
|
|
|
return $this->render( |
|
|
|
'default/room/index.rss.twig', |
|
|
|
'default/room/index.rss.twig', |
|
|
|
[ |
|
|
|
[ |
|
|
|
'name' => $name, |
|
|
|
|
|
|
|
'feed' => $feed, |
|
|
|
'feed' => $feed, |
|
|
|
'request' => $request |
|
|
|
'request' => $request |
|
|
|
], |
|
|
|
], |
|
|
@ -190,7 +175,6 @@ class RoomController extends AbstractController |
|
|
|
return $this->render( |
|
|
|
return $this->render( |
|
|
|
'default/room/index.html.twig', |
|
|
|
'default/room/index.html.twig', |
|
|
|
[ |
|
|
|
[ |
|
|
|
'name' => $name, |
|
|
|
|
|
|
|
'feed' => $feed, |
|
|
|
'feed' => $feed, |
|
|
|
'request' => $request |
|
|
|
'request' => $request |
|
|
|
] |
|
|
|
] |
|
|
@ -221,15 +205,13 @@ class RoomController extends AbstractController |
|
|
|
$this->getParameter('app.memcached.port') |
|
|
|
$this->getParameter('app.memcached.port') |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
$memory = [ |
|
|
|
$memory = md5( |
|
|
|
'app.add.post.remote.ip.delay' => md5( |
|
|
|
sprintf( |
|
|
|
sprintf( |
|
|
|
'%s.RoomController::post:add.post.remote.ip.delay:%s', |
|
|
|
'kevachat.app.add.post.remote.ip.delay:%s.%s', |
|
|
|
__DIR__, |
|
|
|
$this->getParameter('app.name'), |
|
|
|
$request->getClientIp(), |
|
|
|
$request->getClientIp(), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
), |
|
|
|
]; |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
// Connect kevacoin |
|
|
|
// Connect kevacoin |
|
|
|
$client = new \Kevachat\Kevacoin\Client( |
|
|
|
$client = new \Kevachat\Kevacoin\Client( |
|
|
@ -322,7 +304,7 @@ class RoomController extends AbstractController |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// Validate remote IP limits |
|
|
|
/// Validate remote IP limits |
|
|
|
if ($delay = (int) $memcached->get($memory['app.add.post.remote.ip.delay'])) |
|
|
|
if ($delay = (int) $memcached->get($memory)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// Error |
|
|
|
// Error |
|
|
|
return $this->redirectToRoute( |
|
|
|
return $this->redirectToRoute( |
|
|
@ -369,9 +351,9 @@ class RoomController extends AbstractController |
|
|
|
{ |
|
|
|
{ |
|
|
|
// Register event time |
|
|
|
// Register event time |
|
|
|
$memcached->set( |
|
|
|
$memcached->set( |
|
|
|
$memory['app.add.post.remote.ip.delay'], |
|
|
|
$memory, |
|
|
|
time(), |
|
|
|
time(), |
|
|
|
(int) $this->getParameter('app.add.post.remote.ip.delay') |
|
|
|
(int) $this->getParameter('app.add.post.remote.ip.delay') // auto remove on cache expire |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
// Redirect back to room |
|
|
|
// Redirect back to room |
|
|
|