Commit 28bad477 authored by Stephane Glondu's avatar Stephane Glondu
Browse files

Rename "data" into "election_web" where appropriate

parent 5f7a82bc
......@@ -148,7 +148,7 @@ lwt election_table =
return (Web_common.SSet.mem (Web_common.string_of_user u) set)
)
in
let election_data = Web_common.({
let election_web = Web_common.({
fn_params;
fingerprint;
params;
......@@ -175,7 +175,7 @@ lwt election_table =
module P = P
module E = Election.MakeElection(P)(M)
module B = Web_common.MakeBallotBox(P)(E)
let data = election_data
let election_web = election_web
end in
X.B.inject_creds public_creds >>
let uuid = params.e_uuid in
......@@ -194,7 +194,7 @@ let get_election_by_uuid x =
let get_featured_elections () =
EMap.fold (fun uuid e res ->
let module X = (val e : Web_common.WEB_ELECTION) in
let e = X.data in
let e = X.election_web in
if e.Web_common.featured_p then e::res else res
) election_table [] |> return
......@@ -219,7 +219,7 @@ let if_eligible acl f uuid x =
lwt election = get_election_by_uuid uuid in
let module X = (val election : Web_common.WEB_ELECTION) in
lwt user = Eliom_reference.get Services.user in
lwt b = check_acl acl X.data user in
lwt b = check_acl acl X.election_web user in
if b then f uuid election user x else forbidden ()
let () =
......@@ -380,7 +380,7 @@ let () = Eliom_registration.File.register
(if_eligible can_read
(fun uuid election user () ->
let module X = (val election : Web_common.WEB_ELECTION) in
return X.data.Web_common.fn_params
return X.election_web.Web_common.fn_params
)
)
......@@ -390,7 +390,7 @@ let () = Eliom_registration.File.register
(if_eligible can_read
(fun uuid election user () ->
let module X = (val election : Web_common.WEB_ELECTION) in
return X.data.Web_common.fn_public_keys
return X.election_web.Web_common.fn_public_keys
)
)
......@@ -492,7 +492,7 @@ let do_cast election uuid () =
let module X = (val election : WEB_ELECTION) in
match_lwt Eliom_reference.get Services.user with
| Some user as u ->
lwt b = check_acl can_vote X.data u in
lwt b = check_acl can_vote X.election_web u in
if b then (
let record =
Web_common.string_of_user user,
......@@ -505,7 +505,7 @@ let do_cast election uuid () =
with Error e -> return (`Error e)
in
Eliom_reference.unset Services.ballot >>
Templates.do_cast_ballot ~auth_systems ~election:X.data ~result
Templates.do_cast_ballot ~auth_systems ~election:X.election_web ~result
) else forbidden ()
| None -> forbidden ()
end
......@@ -522,8 +522,8 @@ let ballot_received uuid election user =
(do_cast election)
in service
in
lwt can_vote = check_acl can_vote X.data user in
Templates.ballot_received ~auth_systems ~election:X.data ~confirm ~user ~can_vote
lwt can_vote = check_acl can_vote X.election_web user in
Templates.ballot_received ~auth_systems ~election:X.election_web ~confirm ~user ~can_vote
let () = Eliom_registration.Html5.register
......
......@@ -164,7 +164,7 @@ let make_button ~service contents =
let election_view ~auth_systems ~election ~user =
let module X = (val election : Web_common.WEB_ELECTION) in
let election = X.data in
let election = X.election_web in
let service = Services.(preapply_uuid election_raw election) in
lwt permissions =
let open Web_common in
......@@ -251,7 +251,7 @@ let election_view ~auth_systems ~election ~user =
let election_cast_raw ~election =
let module X = (val election : Web_common.WEB_ELECTION) in
let election = X.data in
let election = X.election_web in
let form_rawballot = post_form ~service:Services.election_cast_post
(fun (name, _) ->
[
......@@ -345,7 +345,7 @@ let do_cast_ballot ~election ~result =
let election_update_credential ~election =
let module X = (val election : Web_common.WEB_ELECTION) in
let election = X.data in
let election = X.election_web in
let form = post_form ~service:Services.election_update_credential
(fun (old, new_) ->
[
......
......@@ -26,7 +26,7 @@ type acl =
module SSet = Set.Make(String)
type election_data = {
type election_web = {
fn_params : string;
fingerprint : string;
params : ff_pubkey params;
......@@ -301,5 +301,5 @@ module type WEB_ELECTION = sig
module P : Signatures.ELECTION_PARAMS
module E : LWT_ELECTION
module B : WEB_BBOX
val data : election_data
val election_web : election_web
end
......@@ -17,7 +17,7 @@ type acl =
module SSet : Set.S with type elt = string
type election_data = {
type election_web = {
fn_params : string;
fingerprint : string;
params : ff_pubkey params;
......@@ -80,7 +80,7 @@ module type WEB_ELECTION = sig
module P : Signatures.ELECTION_PARAMS
module E : LWT_ELECTION
module B : WEB_BBOX
val data : election_data
val election_web : election_web
end
val open_security_log : string -> unit Lwt.t
......
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