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
ac30e664
Commit
ac30e664
authored
Feb 06, 2015
by
Marc Duez
Browse files
server : redirect to user info after registering
parent
5490f4ac
Changes
5
Hide whitespace changes
Inline
Side-by-side
browser/js/database.js
View file @
ac30e664
...
...
@@ -192,6 +192,8 @@ Database.prototype = {
}
else
{
var
nexts
=
$
(
'
#login_form
'
).
attr
(
'
action
'
).
split
(
"
&
"
)
var
next
=
"
patient/index
"
if
(
$
(
'
#login_form
'
).
attr
(
'
action
'
).
indexOf
(
'
register
'
)
!=
-
1
)
next
=
"
user/info
"
var
args
=
{}
for
(
var
i
=
0
;
i
<
nexts
.
length
;
i
++
){
var
index
=
nexts
[
i
].
indexOf
(
"
_next
"
)
...
...
server/web2py/applications/vidjil/controllers/default.py
View file @
ac30e664
...
...
@@ -563,8 +563,12 @@ def user():
#restore admin session after register
session
.
auth
=
admin_auth
auth
.
user
=
session
.
auth
.
user
auth
.
settings
.
register_onaccept
=
post_register
#redirect to the last added user view
auth
.
settings
.
logged_url
=
URL
(
'user'
,
'info'
)
auth
.
settings
.
login_next
=
URL
(
'user'
,
'info'
)
return
dict
(
form
=
auth
.
register
())
#reject others
...
...
server/web2py/applications/vidjil/controllers/user.py
View file @
ac30e664
...
...
@@ -25,6 +25,8 @@ def index():
## return user information
## need ["id"]
def
info
():
if
"id"
not
in
request
.
vars
:
request
.
vars
[
"id"
]
=
db
().
select
(
db
.
auth_user
.
ALL
,
orderby
=~
db
.
auth_user
.
id
)[
0
].
id
return
dict
(
message
=
T
(
'user info'
))
def
rights
():
...
...
server/web2py/applications/vidjil/models/db.py
View file @
ac30e664
...
...
@@ -63,8 +63,8 @@ auth.settings.reset_password_requires_verification = True
# auth.settings.login_email_validate = False
auth
.
settings
.
expiration
=
3600
*
24
*
7
# one week
auth
.
settings
.
remember_me_form
=
False
auth
.
settings
.
logged_url
=
URL
(
'
patient
'
,
'in
dex
'
)
auth
.
settings
.
login_next
=
URL
(
'
patient
'
,
'in
dex
'
)
auth
.
settings
.
logged_url
=
URL
(
'
user
'
,
'in
fo
'
)
auth
.
settings
.
login_next
=
URL
(
'
user
'
,
'in
fo
'
)
## if you need to use OpenID, Facebook, MySpace, Twitter, Linkedin, etc.
## register with janrain.com, write your domain:api_key in private/janrain.key
...
...
server/web2py/applications/vidjil/views/user/info.html
View file @
ac30e664
...
...
@@ -15,7 +15,7 @@ query = db(
<div>
<div>
<h3>
{{=message}}
{{=id
}}
</h3>
<h3>
{{=message}}
{{=db.auth_user[id].first_name}} {{=db.auth_user[id].last_name
}}
</h3>
</div>
<div
class=
"db_block"
>
...
...
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