1
0
mirror of https://github.com/flarum/core.git synced 2025-06-28 21:55:30 +02:00

Show post IP address in meta dropdown. closes #956 closes #657

This commit is contained in:
Davis
2016-05-21 22:02:42 +09:30
committed by Toby Zerner
parent 38c15c5a08
commit 909f52522b
9 changed files with 36 additions and 7 deletions

View File

@ -61,13 +61,14 @@ class CreateDiscussionController extends AbstractCreateController
protected function data(ServerRequestInterface $request, Document $document)
{
$actor = $request->getAttribute('actor');
$ipAddress = array_get($request->getServerParams(), 'REMOTE_ADDR', '127.0.0.1');
if (! $request->getAttribute('bypassFloodgate')) {
$this->floodgate->assertNotFlooding($actor);
}
$discussion = $this->bus->dispatch(
new StartDiscussion($actor, array_get($request->getParsedBody(), 'data', []))
new StartDiscussion($actor, array_get($request->getParsedBody(), 'data', []), $ipAddress)
);
// After creating the discussion, we assume that the user has seen all