mirror of
https://github.com/kevachat/webapp.git
synced 2025-01-22 12:34:25 +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;
|
||||
}
|
||||
|
||||
// Set default username
|
||||
$user = $this->getParameter('app.add.user.name.anon');
|
||||
|
||||
// Detect username (key @postfix)
|
||||
if (preg_match('/@([^@]+)$/', $data['key'], $match))
|
||||
{
|
||||
$user = $match[1];
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$user = $this->getParameter('app.add.user.name.anon');
|
||||
// Set username on match node settings
|
||||
if (preg_match($this->getParameter('app.add.user.name.regex'), $match[1]))
|
||||
{
|
||||
$user = $match[1];
|
||||
}
|
||||
}
|
||||
|
||||
return (object)
|
||||
|
Loading…
x
Reference in New Issue
Block a user