Commit ed012045 by Bogdan Ungureanu

Fix log

parent 77b8c753
......@@ -118,13 +118,13 @@
),
start: new google.maps.Marker({
position: loc,
title: path.Time + " speed "+ path.Speed + "km/h",
title: path.Time ,
icon: "http://www.google.com/mapfiles/dd-start.png",
map: map,
}),
end: new google.maps.Marker({
position: loc,
title: path.Time + " speed "+ path.Speed + "km/h",
title: path.Time,
icon: "http://www.google.com/mapfiles/dd-end.png",
map: map,
}),
......@@ -145,7 +145,7 @@
route.poly.getPath().push(loc);
route.end.setPosition(loc);
route.end.setTitle(path.Time + " speed "+ path.Speed + "km/h");
route.end.setTitle(path.Time);
bounds.extend(loc);
/* Debuf
......
......@@ -20,7 +20,6 @@ type (
func doLogin(username, password string) (*Session, bool) {
user := &User{}
server.db.Where("name = ? and password = ?", username, password).First(&user)
log.Printf("db : %x ", user)
if user.Id == 0 {
return nil, false
} else {
......@@ -33,7 +32,7 @@ func doLogin(username, password string) (*Session, bool) {
func AuthHandler(next httpd.Handler) httpd.Handler {
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)
if err != nil {
......@@ -66,6 +65,7 @@ func AuthHandler(next httpd.Handler) httpd.Handler {
// Store the session
ses.Data = sdata
session.Set(ses)
log.Infof("User %s logged in %s!", usr, ses.Id())
c.Redirect("/", 302)
return
}
......@@ -187,11 +187,10 @@ func trackHandler(c *httpd.Context) {
// Logout
func logoutPage(c *httpd.Context) {
sess := c.Session.(*session.Session)
log.Printf("logging out from sid %s", sess.Id())
sess.Data = nil
session.Set(sess)
log.Printf("logging out from sid %s", sess.Id())
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