liquid_feedback_frontend
diff app/main/index/_action/login.lua @ 1071:58f48a8a202a
Imported and merged LDAP patch
| author | bsw |
|---|---|
| date | Fri Jul 18 21:42:59 2014 +0200 (2014-07-18) |
| parents | 701a5cf6b067 |
| children | aefef1556d55 |
line diff
1.1 --- a/app/main/index/_action/login.lua Thu Jul 17 23:38:35 2014 +0200 1.2 +++ b/app/main/index/_action/login.lua Fri Jul 18 21:42:59 2014 +0200 1.3 @@ -1,7 +1,22 @@ 1.4 local login = param.get("login") 1.5 local password = param.get("password") 1.6 1.7 -local member = Member:by_login_and_password(login, password) 1.8 +local member, err, uid = Member:by_login_and_password(login, password) 1.9 + 1.10 +if err == "ldap_credentials_valid_but_no_member" then 1.11 + app.session.authority = "ldap" 1.12 + app.session.authority_data = encode.pg_hstore{ 1.13 + login = login, 1.14 + uid = uid 1.15 + } 1.16 + app.session:save() 1.17 + request.redirect{ 1.18 + module = "index", view = "register", params = { 1.19 + ldap_login = login 1.20 + } 1.21 + } 1.22 + return 1.23 +end 1.24 1.25 function do_etherpad_auth(member) 1.26 local result = net.curl(