liquid_feedback_frontend
view app/main/member/_action/update_password.lua @ 1413:3dbfac432576
Fixed endless loop while sending notification when not issue is created yet
| author | bsw | 
|---|---|
| date | Sun Aug 26 13:38:14 2018 +0200 (2018-08-26) | 
| parents | 32cc544d5a5b | 
| children | 
 line source
     1 if app.session.member.role then
     2   return execute.view { module = "index", view = "403" }
     3 end
     5 local old_password = param.get("old_password")
     6 local new_password1 = param.get("new_password1")
     7 local new_password2 = param.get("new_password2")
     9 if not Member:by_login_and_password(app.session.member.login, old_password) then
    10   slot.put_into("error", _"Old password is wrong")
    11   return false
    12 end
    14 if new_password1 ~= new_password2 then
    15   slot.put_into("error", _"New passwords does not match.")
    16   return false
    17 end
    19 if #new_password1 < 8 then
    20   slot.put_into("error", _"New passwords is too short.")
    21   return false
    22 end
    24 app.session.member:set_password(new_password1)
    25 app.session.member:save()
    27 slot.put_into("notice", _"Your password has been updated successfully")
