Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gpsd
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
Bogdan Ungureanu
gpsd
Commits
ed012045
Commit
ed012045
authored
Aug 05, 2015
by
Bogdan Ungureanu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix log
parent
77b8c753
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
7 deletions
+6
-7
index.html
public_html/views/index.html
+3
-3
server_http.go
server_http.go
+3
-4
No files found.
public_html/views/index.html
View file @
ed012045
...
...
@@ -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
...
...
server_http.go
View file @
ed012045
...
...
@@ -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
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment