add checkbox reading to dialog & login
This commit is contained in:
@@ -83,7 +83,9 @@ func Login(ctxt ui.AmContext) (string, any, error) {
|
|||||||
return dlg.RenderError(ctxt, uerr.Error())
|
return dlg.RenderError(ctxt, uerr.Error())
|
||||||
}
|
}
|
||||||
ctxt.ReplaceUser(user)
|
ctxt.ReplaceUser(user)
|
||||||
// TODO: cookie set if required
|
if dlg.Field("saveme").IsChecked() {
|
||||||
|
// TODO: cookie set
|
||||||
|
}
|
||||||
// TODO: bounce to E-mail verify if we can do so
|
// TODO: bounce to E-mail verify if we can do so
|
||||||
return "redirect", target, nil
|
return "redirect", target, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,6 +87,14 @@ func (fld *DialogItem) DateValues() []int {
|
|||||||
return rc
|
return rc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// IsChecked returns true if a dialog checkbox is checked.
|
||||||
|
func (fld *DialogItem) IsChecked() bool {
|
||||||
|
if fld.Type == "checkbox" {
|
||||||
|
return len(fld.Value) > 0
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
/* Field returns a pointer to a dialog's field, given its name.
|
/* Field returns a pointer to a dialog's field, given its name.
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* name - The name of the field to find.
|
* name - The name of the field to find.
|
||||||
|
|||||||
Reference in New Issue
Block a user