liquid_feedback_frontend
diff model/member.lua @ 1074:aefef1556d55
Removed usage of hstore from LDAP support
| author | bsw |
|---|---|
| date | Tue Jul 22 22:17:37 2014 +0200 (2014-07-22) |
| parents | 58f48a8a202a |
| children | c80ac323dee7 |
line diff
1.1 --- a/model/member.lua Fri Jul 18 23:13:19 2014 +0200 1.2 +++ b/model/member.lua Tue Jul 22 22:17:37 2014 +0200 1.3 @@ -278,7 +278,7 @@ 1.4 1.5 local members = Member:new_selector() 1.6 :add_where{ "authority = ?", authority } 1.7 - :add_field("authority_data->'uid' as authority_data_uid") 1.8 + :add_field("authority_uid") 1.9 :exec() 1.10 1.11 return members 1.12 @@ -415,12 +415,12 @@ 1.13 -- Get login name from LDAP entry 1.14 if ldap_entry then 1.15 uid = config.ldap.member.uid_map(ldap_entry) 1.16 - selector:add_where{'"authority" = ? AND "authority_data"->\'uid\' = ?', "ldap", uid } 1.17 + selector:add_where{'"authority" = ? AND "authority_uid" = ?', "ldap", uid } 1.18 1.19 -- or build it from the login 1.20 else 1.21 login = config.ldap.member.login_normalizer(login) 1.22 - selector:add_where{'"authority" = ? AND "authority_data"->\'login\' = ?', "ldap", login } 1.23 + selector:add_where{'"authority" = ? AND "authority_uid" = ?', "ldap", login } 1.24 end 1.25 1.26 local member = selector:exec() 1.27 @@ -489,10 +489,8 @@ 1.28 end 1.29 end 1.30 -- TODO change this when SQL layers supports hstore 1.31 - member.authority_data = encode.pg_hstore{ 1.32 - uid = uid, 1.33 - login = ldap_login 1.34 - } 1.35 + member.authority_uid = uid 1.36 + member.authority_login = ldap_login 1.37 member.activated = "now" 1.38 member.last_activity = "now" 1.39 if config.ldap.member.cache_passwords then