liquid_feedback_frontend
annotate app/main/index/_action/update_password.lua @ 3:768faea1096d
Version alpha4
Members interested in an issue or supporting an initiative have a weight information attached. Browsing the members causing that weight is possible.
Initiatives may provide a link to an external discussion platform
Direct link on every initiative page to create an alternative initiative
Bugfix: No error when clicking "neutral", when "neutral" is currently selected
Members interested in an issue or supporting an initiative have a weight information attached. Browsing the members causing that weight is possible.
Initiatives may provide a link to an external discussion platform
Direct link on every initiative page to create an alternative initiative
Bugfix: No error when clicking "neutral", when "neutral" is currently selected
| author | bsw |
|---|---|
| date | Mon Nov 30 12:00:00 2009 +0100 (2009-11-30) |
| parents | 3bfb2fcf7ab9 |
| children |
| rev | line source |
|---|---|
| bsw/jbe@0 | 1 local old_password = param.get("old_password") |
| bsw/jbe@0 | 2 local new_password1 = param.get("new_password1") |
| bsw/jbe@0 | 3 local new_password2 = param.get("new_password2") |
| bsw/jbe@0 | 4 |
| bsw/jbe@0 | 5 if not Member:by_login_and_password(app.session.member.login, old_password) then |
| bsw/jbe@0 | 6 slot.put_into("error", _"Old password is wrong") |
| bsw/jbe@0 | 7 return false |
| bsw/jbe@0 | 8 end |
| bsw/jbe@0 | 9 |
| bsw/jbe@0 | 10 if new_password1 ~= new_password2 then |
| bsw/jbe@0 | 11 slot.put_into("error", _"New passwords does not match.") |
| bsw/jbe@0 | 12 return false |
| bsw/jbe@0 | 13 end |
| bsw/jbe@0 | 14 |
| bsw/jbe@0 | 15 if #new_password1 < 8 then |
| bsw/jbe@0 | 16 slot.put_into("error", _"New passwords is too short.") |
| bsw/jbe@0 | 17 return false |
| bsw/jbe@0 | 18 end |
| bsw/jbe@0 | 19 |
| bsw/jbe@0 | 20 app.session.member:set_password(new_password1) |
| bsw/jbe@0 | 21 app.session.member:save() |
| bsw/jbe@0 | 22 |
| bsw/jbe@0 | 23 slot.put_into("notice", _"Your password has been updated successfully") |