mirror of
https://github.com/jech/galene.git
synced 2024-11-22 16:45:58 +01:00
Disallow usernames with spaces.
This commit is contained in:
parent
563545bd13
commit
78003fdc7d
1 changed files with 6 additions and 0 deletions
|
@ -12,6 +12,7 @@ import (
|
||||||
"log"
|
"log"
|
||||||
"math"
|
"math"
|
||||||
"os"
|
"os"
|
||||||
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"time"
|
"time"
|
||||||
|
@ -151,6 +152,11 @@ func startClient(conn *websocket.Conn) (err error) {
|
||||||
c.writerDone = make(chan struct{})
|
c.writerDone = make(chan struct{})
|
||||||
go clientWriter(conn, c.writeCh, c.writerDone)
|
go clientWriter(conn, c.writeCh, c.writerDone)
|
||||||
|
|
||||||
|
if strings.ContainsRune(m.Username, ' ') {
|
||||||
|
err = userError("don't put spaces in your username")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
g, users, err := addClient(m.Group, c, m.Username, m.Password)
|
g, users, err := addClient(m.Group, c, m.Username, m.Password)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue