mirror of
https://github.com/kevachat/webapp.git
synced 2025-02-02 09:55:58 +00:00
add node settings username validation
This commit is contained in:
parent
ed9b29da14
commit
8dc01763bf
@ -1158,15 +1158,17 @@ class RoomController extends AbstractController
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set default username
|
||||||
|
$user = $this->getParameter('app.add.user.name.anon');
|
||||||
|
|
||||||
// Detect username (key @postfix)
|
// Detect username (key @postfix)
|
||||||
if (preg_match('/@([^@]+)$/', $data['key'], $match))
|
if (preg_match('/@([^@]+)$/', $data['key'], $match))
|
||||||
|
{
|
||||||
|
// Set username on match node settings
|
||||||
|
if (preg_match($this->getParameter('app.add.user.name.regex'), $match[1]))
|
||||||
{
|
{
|
||||||
$user = $match[1];
|
$user = $match[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$user = $this->getParameter('app.add.user.name.anon');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (object)
|
return (object)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user