Commit ac30e664 authored by Marc Duez's avatar Marc Duez

server : redirect to user info after registering

parent 5490f4ac
......@@ -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")
......
......@@ -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
......
......@@ -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():
......
......@@ -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', 'index')
auth.settings.login_next = URL('patient', 'index')
auth.settings.logged_url = URL('user', 'info')
auth.settings.login_next = URL('user', 'info')
## if you need to use OpenID, Facebook, MySpace, Twitter, Linkedin, etc.
## register with janrain.com, write your domain:api_key in private/janrain.key
......
......@@ -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">
......
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