but_logout.enabled = app.user != null
end
- init
- do
- but_logout.observers.add self
- refresh
- end
+ init do refresh
redef fun on_event(event)
do
private var but_signup = new Button(parent=layout_register, text="Signup".t)
- init
- do
- for c in [but_login, but_signup] do
- c.observers.add self
- end
- end
-
redef fun on_event(event)
do
if debug then print "BenitluxWindow::on_event {event}"
if sender == but_login then
feedback "Logging in...".t
- (new LoginOrSignupAction(self, "rest/login?name={name}&pass={pass.pass_hash}")).start
+ (new LoginOrSignupAction(self, "rest/login?name={name.to_percent_encoding}&pass={pass.pass_hash}")).start
else if sender == but_signup then
if pass != txt_pass2.text then
feedback "Passwords do not match.".t
end
feedback "Signing up...".t
- (new LoginOrSignupAction(self, "rest/signup?name={name}&pass={pass.pass_hash}&email={email}")).start
+ (new LoginOrSignupAction(self, "rest/signup?name={name.to_percent_encoding}&pass={pass.pass_hash}&email={email.to_percent_encoding}")).start
end
end
end
init do affected_views.add_all([window.but_login, window.but_signup])
- redef fun on_load(res)
+ redef fun on_load(res, status)
do
if intercept_error(res) then return