Commit ed012045 by Bogdan Ungureanu

Fix log

parent 77b8c753
...@@ -118,13 +118,13 @@ ...@@ -118,13 +118,13 @@
), ),
start: new google.maps.Marker({ start: new google.maps.Marker({
position: loc, position: loc,
title: path.Time + " speed "+ path.Speed + "km/h", title: path.Time ,
icon: "http://www.google.com/mapfiles/dd-start.png", icon: "http://www.google.com/mapfiles/dd-start.png",
map: map, map: map,
}), }),
end: new google.maps.Marker({ end: new google.maps.Marker({
position: loc, position: loc,
title: path.Time + " speed "+ path.Speed + "km/h", title: path.Time,
icon: "http://www.google.com/mapfiles/dd-end.png", icon: "http://www.google.com/mapfiles/dd-end.png",
map: map, map: map,
}), }),
...@@ -145,7 +145,7 @@ ...@@ -145,7 +145,7 @@
route.poly.getPath().push(loc); route.poly.getPath().push(loc);
route.end.setPosition(loc); route.end.setPosition(loc);
route.end.setTitle(path.Time + " speed "+ path.Speed + "km/h"); route.end.setTitle(path.Time);
bounds.extend(loc); bounds.extend(loc);
/* Debuf /* Debuf
......
...@@ -20,7 +20,6 @@ type ( ...@@ -20,7 +20,6 @@ type (
func doLogin(username, password string) (*Session, bool) { func doLogin(username, password string) (*Session, bool) {
user := &User{} user := &User{}
server.db.Where("name = ? and password = ?", username, password).First(&user) server.db.Where("name = ? and password = ?", username, password).First(&user)
log.Printf("db : %x ", user)
if user.Id == 0 { if user.Id == 0 {
return nil, false return nil, false
} else { } else {
...@@ -33,7 +32,7 @@ func doLogin(username, password string) (*Session, bool) { ...@@ -33,7 +32,7 @@ func doLogin(username, password string) (*Session, bool) {
func AuthHandler(next httpd.Handler) httpd.Handler { func AuthHandler(next httpd.Handler) httpd.Handler {
return httpd.HandlerFunc(func(c *httpd.Context) { return httpd.HandlerFunc(func(c *httpd.Context) {
log.Printf("USER auth handler requested !") //log.Printf("USER auth handler requested !")
s, err := c.Request.Cookie(sidname) s, err := c.Request.Cookie(sidname)
if err != nil { if err != nil {
...@@ -66,6 +65,7 @@ func AuthHandler(next httpd.Handler) httpd.Handler { ...@@ -66,6 +65,7 @@ func AuthHandler(next httpd.Handler) httpd.Handler {
// Store the session // Store the session
ses.Data = sdata ses.Data = sdata
session.Set(ses) session.Set(ses)
log.Infof("User %s logged in %s!", usr, ses.Id())
c.Redirect("/", 302) c.Redirect("/", 302)
return return
} }
...@@ -187,11 +187,10 @@ func trackHandler(c *httpd.Context) { ...@@ -187,11 +187,10 @@ func trackHandler(c *httpd.Context) {
// Logout // Logout
func logoutPage(c *httpd.Context) { func logoutPage(c *httpd.Context) {
sess := c.Session.(*session.Session) sess := c.Session.(*session.Session)
log.Printf("logging out from sid %s", sess.Id())
sess.Data = nil sess.Data = nil
session.Set(sess) session.Set(sess)
log.Printf("logging out from sid %s", sess.Id())
c.Redirect("/login", 302) c.Redirect("/login", 302)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment