Browse Source

rename anonymous users to guest

main
ghost 1 year ago
parent
commit
8318291440
  1. 4
      src/Controller/RoomController.php
  2. 10
      templates/default/module/post.html.twig
  3. 2
      templates/default/room/index.html.twig

4
src/Controller/RoomController.php

@ -344,7 +344,7 @@ class RoomController extends AbstractController
sprintf( sprintf(
'%s@%s', '%s@%s',
time(), // @TODO save timestamp as part of key to keep timing actual for the chat feature time(), // @TODO save timestamp as part of key to keep timing actual for the chat feature
$request->get('user') === 'ip' ? $request->getClientIp() : 'anonymous' $request->get('user') === 'ip' ? $request->getClientIp() : 'guest'
), ),
$request->get('message') $request->get('message')
) )
@ -408,7 +408,7 @@ class RoomController extends AbstractController
private function _identicon(mixed $value): ?string private function _identicon(mixed $value): ?string
{ {
if ($value === 'anonymous') if ($value === 'guest')
{ {
return null; return null;
} }

10
templates/default/module/post.html.twig

@ -4,13 +4,13 @@
<output name="error" for="form-post-message">{{ error }}</output> <output name="error" for="form-post-message">{{ error }}</output>
{% endif %} {% endif %}
<textarea name="message" id="form-post-message" placeholder="{{ 'enter your message...' | trans }}">{{ message }}</textarea> <textarea name="message" id="form-post-message" placeholder="{{ 'enter your message...' | trans }}">{{ message }}</textarea>
{% if user == 'anonymous' or user != 'ip' %} {% if user == 'guest' or user != 'ip' %}
<input type="radio" name="user" value="anonymous" id="form-post-user-anonymous" checked="checked" /> <input type="radio" name="user" value="guest" id="form-post-user-guest" checked="checked" />
{% else %} {% else %}
<input type="radio" name="user" value="anonymous" id="form-post-user-anonymous" /> <input type="radio" name="user" value="guest" id="form-post-user-guest" />
{% endif %} {% endif %}
<label for="form-post-user-anonymous"> <label for="form-post-user-guest">
{{ 'anonymous' | trans }} {{ 'guest' | trans }}
</label> </label>
{% if user == 'ip' %} {% if user == 'ip' %}
<input type="radio" name="user" value="ip" id="form-post-user-ip" checked="checked" /> <input type="radio" name="user" value="ip" id="form-post-user-ip" checked="checked" />

2
templates/default/room/index.html.twig

@ -20,7 +20,7 @@
<img src="{{ post.icon }}" alt="icon" /> <img src="{{ post.icon }}" alt="icon" />
{% else %} {% else %}
<strong> <strong>
@{{ 'anonymous' | trans }} @{{ 'guest' | trans }}
</strong> </strong>
{% endif %} {% endif %}
&bull; &bull;

Loading…
Cancel
Save