general improvements
This commit is contained in:
parent
bac08dc7cf
commit
ddb11f0619
25 changed files with 305 additions and 140 deletions
|
|
@ -83,6 +83,10 @@ func (db *DB) CreateUser(username, password string, admin bool) error {
|
|||
}
|
||||
|
||||
func (db *DB) Login(username, password string) (u core.User, err error) {
|
||||
if username == defUser && !db.admin {
|
||||
err = errors.New("db: user disabled")
|
||||
return
|
||||
}
|
||||
u, err = db.GetUser(username)
|
||||
if err != nil {
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue