{
$internal-loggedin := false(),
let $form := (ancestor::form)[1]
return
loginFormPost := form($form, ({"L#AUSW": $username, "LPASSW": $password}, $form//input[@type="submit" and contains(@name, "LOGIN")]) )
}
{
$internal-loggedin := false(),
loginFormPost :=
let $form := (ancestor::form, //form)[1] (:Aalen has invalid html where the form is not an ancestor of the input:)
let $buttons := $form//input[@type="submit" and matches(@value, "Anmeld|Login")]
let $buttons := if ($buttons) then $buttons else "textButton=Anmeldung abschicken" (:vl:raise-internal("Anmeldebutton nicht gefunden"):)
return form($form, ({"$Textfield": $username, "$Textfield$0": $password}, $buttons[1]))
}
{ $internal-loggedin := false(), loginFormPost := form((ancestor::form, //form)[1], {"j_username": $username, "j_password": $password}), idpSystem := true() }
{error := inner-text()}