Commit 5a908f98 authored by Stephane Glondu's avatar Stephane Glondu
Browse files

Make the login-admin page and the login-dummy page distinct

parent d0dc81dd
......@@ -339,7 +339,7 @@ let () = Eliom_registration.Html5.register
) >>
Services.get ())
in
Templates.dummy_login ~auth_systems ~service
Templates.string_login ~auth_systems ~service ~kind:`Dummy
) else fail_http 404
)
......@@ -396,7 +396,7 @@ let () = Eliom_registration.Html5.register
) else forbidden ()
)
in
Templates.dummy_login ~auth_systems ~service
Templates.string_login ~auth_systems ~service ~kind:`Admin
)
let next_lf str i =
......
......@@ -153,14 +153,18 @@ let index ~auth_systems ~featured =
] in
base ~auth_systems ~title:site_title ~content
let dummy_login ~service =
let string_login ~kind ~service =
let title, field_name, input_type = match kind with
| `Dummy -> "Dummy login", "Username:", `Text
| `Admin -> "Admin login", "Admin password:", `Password
in
let form = post_form ~service
(fun name ->
[
tablex [tbody [
tr [
th [label ~a:[a_for name] [pcdata "Username:"]];
td [string_input ~a:[a_maxlength 50] ~input_type:`Text ~name ()];
th [label ~a:[a_for name] [pcdata field_name]];
td [string_input ~a:[a_maxlength 50] ~input_type ~name ()];
]]
];
div [
......@@ -169,10 +173,10 @@ let dummy_login ~service =
]) ()
in
let content = [
h1 [pcdata "Login"];
h1 [pcdata title];
form;
] in
base ~title:"Login" ~content
base ~title ~content
let password_login ~service =
let form = post_form ~service
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment