display a message if the user has no email ... to reset password

This commit is contained in:
Jocelyn Fiat
2013-03-01 18:11:03 +01:00
parent 65d8665a64
commit c1d913e67d

View File

@@ -57,7 +57,7 @@ feature -- Execution
end
end
initialize_primary_tabs (u)
if fd /= Void and then fd.is_valid then
if fd /= Void and then fd.is_valid and then u /= Void then
across
fd as c
loop
@@ -67,7 +67,7 @@ feature -- Execution
end
b.append ("</li>")
end
if u /= Void and then attached u.email as l_mail_address then
if attached u.email as l_mail_address then
l_uuid := (create {UUID_GENERATOR}).generate_uuid
e := new_password_email (u, l_mail_address, l_uuid.out)
u.set_data_item ("new_password_extra", l_uuid.out)
@@ -75,6 +75,9 @@ feature -- Execution
service.mailer.safe_process_email (e)
add_success_message ("Further instructions have been sent to your e-mail address.")
set_redirection (url ("/user", Void))
else
add_success_message ("No email is associated with the requested account. Please contact the webmaster for help.")
set_redirection (url ("/user", Void))
end
set_main_content (b)
else