mirror of
https://github.com/kevachat/webapp.git
synced 2025-01-27 23:14:25 +00:00
add external room settings
This commit is contained in:
parent
0aecdd302d
commit
816e8c61db
3
.env
3
.env
@ -51,6 +51,9 @@ APP_KEVACOIN_ROOM_NAMESPACES_READONLY=EDIT_ME
|
|||||||
# Redirect from index page to default room
|
# Redirect from index page to default room
|
||||||
APP_KEVACOIN_ROOM_NAMESPACE_DEFAULT=EDIT_ME
|
APP_KEVACOIN_ROOM_NAMESPACE_DEFAULT=EDIT_ME
|
||||||
|
|
||||||
|
# Allow users to read external node rooms (true|false)
|
||||||
|
APP_KEVACOIN_ROOM_NAMESPACE_EXTERNAL=false
|
||||||
|
|
||||||
# Allow remotes to create new rooms (namespaces)
|
# Allow remotes to create new rooms (namespaces)
|
||||||
APP_ADD_ROOM_REMOTE_IP_REGEX=/.*/
|
APP_ADD_ROOM_REMOTE_IP_REGEX=/.*/
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@ parameters:
|
|||||||
app.kevacoin.room.namespaces: '%env(APP_KEVACOIN_ROOM_NAMESPACES)%'
|
app.kevacoin.room.namespaces: '%env(APP_KEVACOIN_ROOM_NAMESPACES)%'
|
||||||
app.kevacoin.room.namespaces.readonly: '%env(APP_KEVACOIN_ROOM_NAMESPACES_READONLY)%'
|
app.kevacoin.room.namespaces.readonly: '%env(APP_KEVACOIN_ROOM_NAMESPACES_READONLY)%'
|
||||||
app.kevacoin.room.namespace.default: '%env(APP_KEVACOIN_ROOM_NAMESPACE_DEFAULT)%'
|
app.kevacoin.room.namespace.default: '%env(APP_KEVACOIN_ROOM_NAMESPACE_DEFAULT)%'
|
||||||
|
app.kevacoin.room.namespace.external: '%env(APP_KEVACOIN_ROOM_NAMESPACE_EXTERNAL)%'
|
||||||
app.kevacoin.mine.address: '%env(APP_KEVACOIN_MINE_ADDRESS)%'
|
app.kevacoin.mine.address: '%env(APP_KEVACOIN_MINE_ADDRESS)%'
|
||||||
app.kevacoin.mine.pool.url: '%env(APP_KEVACOIN_MINE_POOL_URL)%'
|
app.kevacoin.mine.pool.url: '%env(APP_KEVACOIN_MINE_POOL_URL)%'
|
||||||
app.kevacoin.mine.solo.url: '%env(APP_KEVACOIN_MINE_SOLO_URL)%'
|
app.kevacoin.mine.solo.url: '%env(APP_KEVACOIN_MINE_SOLO_URL)%'
|
||||||
|
@ -75,6 +75,21 @@ class RoomController extends AbstractController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check for external rooms reading allowed in config
|
||||||
|
if (
|
||||||
|
!in_array(
|
||||||
|
$request->get('namespace'),
|
||||||
|
(array) explode('|', $this->getParameter('app.kevacoin.room.namespaces'))
|
||||||
|
)
|
||||||
|
&&
|
||||||
|
$this->getParameter('app.kevacoin.room.namespace.external') === 'false'
|
||||||
|
) {
|
||||||
|
// @TODO process to error page instead of redirect to default room
|
||||||
|
return $this->redirectToRoute(
|
||||||
|
'room_index'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Get room feed
|
// Get room feed
|
||||||
$feed = [];
|
$feed = [];
|
||||||
|
|
||||||
@ -225,7 +240,7 @@ class RoomController extends AbstractController
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check namespace writable
|
// Check namespace defined in config
|
||||||
if (!in_array($request->get('namespace'), (array) explode('|', $this->getParameter('app.kevacoin.room.namespaces'))))
|
if (!in_array($request->get('namespace'), (array) explode('|', $this->getParameter('app.kevacoin.room.namespaces'))))
|
||||||
{
|
{
|
||||||
return $this->redirectToRoute(
|
return $this->redirectToRoute(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user