Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
vidjil
vidjil
Commits
54d0caaf
Commit
54d0caaf
authored
Dec 01, 2014
by
Marc Duez
Browse files
database.js / server : handle custom redirection after login // handle absolute path call
parent
df1c65ce
Changes
2
Hide whitespace changes
Inline
Side-by-side
browser/js/database.js
View file @
54d0caaf
...
...
@@ -44,6 +44,9 @@ Database.prototype = {
}
var
url
=
self
.
db_address
+
page
+
arg
if
(
page
.
substr
(
0
,
4
).
toLowerCase
()
==
"
http
"
)
{
url
=
page
+
arg
}
this
.
callUrl
(
url
)
},
...
...
@@ -183,7 +186,18 @@ Database.prototype = {
if
(
status
===
"
timeout
"
)
{
myConsole
.
flash
(
myConsole
.
msg
.
database_timeout
,
2
)
}
else
{
self
.
call
(
"
patient/index
"
)
var
nexts
=
$
(
'
#login_form
'
).
attr
(
'
action
'
).
split
(
"
&
"
)
var
next
=
"
patient/index
"
for
(
var
i
=
0
;
i
<
nexts
.
length
;
i
++
){
var
index
=
nexts
[
i
].
indexOf
(
"
_next
"
)
if
(
index
!=
-
1
){
next
=
nexts
[
i
].
substr
(
index
)
next
=
next
.
replace
(
"
_next=
"
,
""
)
next
=
decodeURIComponent
(
next
)
}
}
console
.
log
(
next
)
self
.
call
(
next
)
}
}
});
...
...
server/web2py/applications/vidjil/controllers/patient.py
View file @
54d0caaf
...
...
@@ -23,7 +23,10 @@ def info():
## return patient list
def
index
():
if
not
auth
.
user
:
res
=
{
"redirect"
:
"default/user/login"
}
res
=
{
"redirect"
:
URL
(
'default'
,
'user'
,
args
=
'login'
,
scheme
=
True
,
host
=
True
,
vars
=
dict
(
_next
=
URL
(
'patient'
,
'index'
,
scheme
=
True
,
host
=
True
)))
}
return
gluon
.
contrib
.
simplejson
.
dumps
(
res
,
separators
=
(
','
,
':'
))
log
.
debug
(
'patient list'
)
...
...
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