limit bumps to 1 record
This commit is contained in:
parent
69e2778b3d
commit
4db3ca30a9
7
main.go
7
main.go
|
@ -7,13 +7,14 @@ import (
|
|||
"encoding/base32"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/jmoiron/sqlx"
|
||||
"golang.org/x/crypto/bcrypt"
|
||||
"html/template"
|
||||
"log"
|
||||
"net/smtp"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/jmoiron/sqlx"
|
||||
"golang.org/x/crypto/bcrypt"
|
||||
)
|
||||
|
||||
type templates struct {
|
||||
|
@ -195,7 +196,7 @@ func SaveUser(username string, d UserData) bool {
|
|||
|
||||
func Bump(username string, ip string) {
|
||||
username = strings.ToLower(username)
|
||||
q := fmt.Sprintf("update %s_auth set lastseen=CURRENT_TIMESTAMP, lastseenip=$2 where username = $1", c.TablePrefix)
|
||||
q := fmt.Sprintf("update %s_auth set lastseen=CURRENT_TIMESTAMP, lastseenip=$2 where username = $1 limit 1", c.TablePrefix)
|
||||
_, err := c.db.Exec(q, username, ip)
|
||||
if err != nil {
|
||||
log.Printf("scsusers.Bump: Error on user bump: %s : %s\n", username, err.Error())
|
||||
|
|
Loading…
Reference in New Issue