- update error messages to be correct
- move suspended message into template and include for other pages
- check suspended status on all relevant pages and show message if
logged in user is suspended.
- fix possible nil pointer error
- remove changes to db schema files
- add version comment to migration
- add UserStatus type with UserActive and UserSuspended
- change database table to use status column instead of suspended
- update toggle suspended handler to be toggle status in prep for
possible future inclusion of further user statuses
err:=db.QueryRow("SELECT username, password, email, created, suspended FROM users WHERE id = ?",id).Scan(&u.Username,&u.HashedPass,&u.Email,&u.Created,&u.Suspended)
err:=db.QueryRow("SELECT username, password, email, created, status FROM users WHERE id = ?",id).Scan(&u.Username,&u.HashedPass,&u.Email,&u.Created,&u.Status)
err:=db.QueryRow("SELECT id, password, email, created, suspended FROM users WHERE username = ?",username).Scan(&u.ID,&u.HashedPass,&u.Email,&u.Created,&u.Suspended)
err:=db.QueryRow("SELECT id, password, email, created, status FROM users WHERE username = ?",username).Scan(&u.ID,&u.HashedPass,&u.Email,&u.Created,&u.Status)
switch{
caseerr==sql.ErrNoRows:
// Check if they've entered the wrong, unnormalized username
err:=db.QueryRow("SELECT id, password, email, created, suspended FROM users WHERE id = ?",u.ID).Scan(&u.ID,&u.HashedPass,&u.Email,&u.Created,&u.Suspended)
err:=db.QueryRow("SELECT id, password, email, created, status FROM users WHERE id = ?",u.ID).Scan(&u.ID,&u.HashedPass,&u.Email,&u.Created,&u.Status)