liquid_feedback_frontend
diff app/main/index/_action/register.lua @ 6:8d91bccab0bf
Version beta2
Possibility to browse voters of a closed issue
Registration with invite code
Email confirmation and password recovery
Download function (for database dumps) added
Critical bug solved, which made it impossible to select your opinion on other peoples suggestions
Catching error, when trying to set an opinion on a suggestion which has been meanwhile deleted
Fixed wrong sorting order for "supporters" or "potential supporters"
Added format info for birthday (Error when entering dates in wrong format is NOT fixed in this release)
Strip space characters from certain fields and ensure they contain at least 3 characters
Showing grade in opinion/list as clear text instead of integer value
More information on initiative is displayed while voting
Colored notification box shown on pages of issues or initiatives which are currently in voting state
Changed default filter for issues to "Open"
Back link on suggestion page
Some optical changes
Removed wrong space character in LICENSE file
Possibility to browse voters of a closed issue
Registration with invite code
Email confirmation and password recovery
Download function (for database dumps) added
Critical bug solved, which made it impossible to select your opinion on other peoples suggestions
Catching error, when trying to set an opinion on a suggestion which has been meanwhile deleted
Fixed wrong sorting order for "supporters" or "potential supporters"
Added format info for birthday (Error when entering dates in wrong format is NOT fixed in this release)
Strip space characters from certain fields and ensure they contain at least 3 characters
Showing grade in opinion/list as clear text instead of integer value
More information on initiative is displayed while voting
Colored notification box shown on pages of issues or initiatives which are currently in voting state
Changed default filter for issues to "Open"
Back link on suggestion page
Some optical changes
Removed wrong space character in LICENSE file
| author | bsw/jbe |
|---|---|
| date | Sat Jan 02 12:00:00 2010 +0100 (2010-01-02) |
| parents | afd9f769c7ae |
| children | 26c8177ef348 |
line diff
1.1 --- a/app/main/index/_action/register.lua Fri Dec 25 12:00:00 2009 +0100 1.2 +++ b/app/main/index/_action/register.lua Sat Jan 02 12:00:00 2010 +0100 1.3 @@ -10,10 +10,20 @@ 1.4 return false 1.5 end 1.6 1.7 -local name = param.get("name") 1.8 +local notify_email = param.get("notify_email") 1.9 1.10 -if invite_code and not name then 1.11 - slot.put_into("notice", _"Invite code valid!") 1.12 +if invite_code and not notify_email then 1.13 + request.redirect{ 1.14 + mode = "redirect", 1.15 + module = "index", 1.16 + view = "register", 1.17 + params = { code = invite_code.code } 1.18 + } 1.19 + return false 1.20 +end 1.21 + 1.22 +if #notify_email < 5 then 1.23 + slot.put_into("error", _"Email address too short!") 1.24 request.redirect{ 1.25 mode = "redirect", 1.26 module = "index", 1.27 @@ -23,13 +33,47 @@ 1.28 return false 1.29 end 1.30 1.31 +local name = param.get("name") 1.32 + 1.33 +if notify_email and not name then 1.34 + request.redirect{ 1.35 + mode = "redirect", 1.36 + module = "index", 1.37 + view = "register", 1.38 + params = { 1.39 + code = invite_code.code, 1.40 + notify_email = notify_email 1.41 + } 1.42 + } 1.43 + return false 1.44 +end 1.45 + 1.46 +name = util.trim(name) 1.47 + 1.48 +if #name < 3 then 1.49 + slot.put_into("error", _"This username is too short!") 1.50 + request.redirect{ 1.51 + mode = "redirect", 1.52 + module = "index", 1.53 + view = "register", 1.54 + params = { 1.55 + code = invite_code.code, 1.56 + notify_email = notify_email 1.57 + } 1.58 + } 1.59 + return false 1.60 +end 1.61 + 1.62 if Member:by_name(name) then 1.63 slot.put_into("error", _"This name is already taken, please choose another one!") 1.64 request.redirect{ 1.65 mode = "redirect", 1.66 module = "index", 1.67 view = "register", 1.68 - params = { code = invite_code.code } 1.69 + params = { 1.70 + code = invite_code.code, 1.71 + notify_email = notify_email 1.72 + } 1.73 } 1.74 return false 1.75 end 1.76 @@ -37,13 +81,30 @@ 1.77 local login = param.get("login") 1.78 1.79 if name and not login then 1.80 - slot.put_into("notice", _"Name is available") 1.81 request.redirect{ 1.82 mode = "redirect", 1.83 module = "index", 1.84 view = "register", 1.85 params = { 1.86 code = invite_code.code, 1.87 + notify_email = notify_email, 1.88 + name = name 1.89 + } 1.90 + } 1.91 + return false 1.92 +end 1.93 + 1.94 +login = util.trim(login) 1.95 + 1.96 +if #login < 3 then 1.97 + slot.put_into("error", _"This login is too short!") 1.98 + request.redirect{ 1.99 + mode = "redirect", 1.100 + module = "index", 1.101 + view = "register", 1.102 + params = { 1.103 + code = invite_code.code, 1.104 + notify_email = notify_email, 1.105 name = name 1.106 } 1.107 } 1.108 @@ -58,23 +119,57 @@ 1.109 view = "register", 1.110 params = { 1.111 code = invite_code.code, 1.112 + notify_email = notify_email, 1.113 name = name 1.114 } 1.115 } 1.116 return false 1.117 end 1.118 1.119 +local use_terms_accepted = param.get("use_terms_accepted", atom.boolean) 1.120 + 1.121 +if login and use_terms_accepted == nil then 1.122 + request.redirect{ 1.123 + mode = "redirect", 1.124 + module = "index", 1.125 + view = "register", 1.126 + params = { 1.127 + code = invite_code.code, 1.128 + notify_email = notify_email, 1.129 + name = name, 1.130 + login = login 1.131 + } 1.132 + } 1.133 + return false 1.134 +end 1.135 + 1.136 +if use_terms_accepted ~= true then 1.137 + slot.put_into("error", _"You have to accept the terms of use to complete registration.") 1.138 + request.redirect{ 1.139 + mode = "redirect", 1.140 + module = "index", 1.141 + view = "register", 1.142 + params = { 1.143 + code = invite_code.code, 1.144 + notify_email = notify_email, 1.145 + name = name, 1.146 + login = login 1.147 + } 1.148 + } 1.149 + return false 1.150 +end 1.151 + 1.152 local password1 = param.get("password1") 1.153 local password2 = param.get("password2") 1.154 1.155 if login and not password1 then 1.156 - slot.put_into("notice", _"Login is available") 1.157 request.redirect{ 1.158 mode = "redirect", 1.159 module = "index", 1.160 view = "register", 1.161 params = { 1.162 code = invite_code.code, 1.163 + notify_email = notify_email, 1.164 name = name, 1.165 login = login 1.166 } 1.167 @@ -90,6 +185,7 @@ 1.168 view = "register", 1.169 params = { 1.170 code = invite_code.code, 1.171 + notify_email = notify_email, 1.172 name = name, 1.173 login = login 1.174 } 1.175 @@ -105,6 +201,7 @@ 1.176 view = "register", 1.177 params = { 1.178 code = invite_code.code, 1.179 + notify_email = notify_email, 1.180 name = name, 1.181 login = login 1.182 } 1.183 @@ -116,6 +213,24 @@ 1.184 1.185 member.login = login 1.186 member.name = name 1.187 + 1.188 +local success = member:set_notify_email(notify_email) 1.189 +if not success then 1.190 + slot.put_into("error", _"Can't send confirmation email") 1.191 + request.redirect{ 1.192 + mode = "redirect", 1.193 + module = "index", 1.194 + view = "register", 1.195 + params = { 1.196 + code = invite_code.code, 1.197 + notify_email = notify_email, 1.198 + name = name, 1.199 + login = login 1.200 + } 1.201 + } 1.202 + return 1.203 +end 1.204 + 1.205 member:set_password(password1) 1.206 member:save() 1.207 1.208 @@ -125,8 +240,8 @@ 1.209 1.210 slot.put_into("notice", _"You've successfully registered and you can login now with your login and password!") 1.211 1.212 - request.redirect{ 1.213 - mode = "redirect", 1.214 - module = "index", 1.215 - view = "login", 1.216 - } 1.217 +request.redirect{ 1.218 + mode = "redirect", 1.219 + module = "index", 1.220 + view = "login", 1.221 +}