Commit 08b46184 authored by Stephane Glondu's avatar Stephane Glondu
Browse files

GC in serializable_compat.atd

parent 41433bd2
......@@ -135,24 +135,6 @@ type raw_result = int list <ocaml repr="array"> list <ocaml repr="array">
(** {1 Other basic datastructures} *)
type user = {
user_name <json name="name"> : string;
user_type <json name="type"> : string;
}
type randomness = {
randomness : string;
}
type signature = {
user : user;
?hash : string option;
} <ocaml field_prefix="sig_">
(** {1 Compound datastructures} *)
type 'a result = {
encrypted_tally : 'a encrypted_tally;
partial_decryptions : 'a partial_decryption list <ocaml repr="array">;
result : raw_result;
}
......@@ -2,6 +2,17 @@ open Lwt
open Util
open Serializable_compat_t
type user = {
user_name : string;
user_type : string;
}
type 'a result = {
encrypted_tally : 'a encrypted_tally;
partial_decryptions : 'a partial_decryption array;
result : raw_result;
}
type election_data = {
raw : string;
fingerprint : string;
......
open Serializable_compat_t
type user = {
user_name : string;
user_type : string;
}
type 'a result = {
encrypted_tally : 'a encrypted_tally;
partial_decryptions : 'a partial_decryption array;
result : raw_result;
}
type election_data = {
raw : string;
fingerprint : string;
......
......@@ -89,7 +89,7 @@ let () = Eliom_registration.Html5.register
(fun () user_name ->
let user_type = "dummy" in
Eliom_reference.set Services.user
(Some {user_name; user_type}) >>
Common.(Some {user_name; user_type}) >>
return Services.home)
in
Templates.dummy_login ~service)
......
......@@ -38,7 +38,7 @@ let auth_systems = [
let user = Eliom_reference.eref
~scope:Eliom_common.default_session_scope
(None : user option)
(None : Common.user option)
let uuid = Eliom_parameter.user_type
(fun x -> match Uuidm.of_string x with
......@@ -99,5 +99,5 @@ let get_randomness = service
let preapply_uuid s e = Eliom_service.preapply s e.Common.election.e_uuid
let is_eligible (uuid : Uuidm.t) (user : user) =
Lwt.return (String.startswith user.user_name "special-")
let is_eligible (uuid : Uuidm.t) (user : Common.user) =
Lwt.return (String.startswith user.Common.user_name "special-")
......@@ -11,11 +11,11 @@ let s x = Xml.uri_of_string ("/static/" ^ x)
let format_user u size = Services.([
img
~src:(Printf.ksprintf s "auth/login-icons/%s.png" u.user_type)
~src:(Printf.ksprintf s "auth/login-icons/%s.png" u.Common.user_type)
~a:[a_style "border:0;"; a_height size]
~alt:u.user_type ();
~alt:u.Common.user_type ();
pcdata " ";
pcdata u.user_name;
pcdata u.Common.user_name;
])
let base ~title ~header ~content =
......@@ -136,7 +136,7 @@ let format_election_result e r =
) answers
in
{ question; answers }
) (r.result : int array array) |>
) (r.Common.result : int array array) |>
Array.to_list
let format_one_election e =
......
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