Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
belenios
belenios
Commits
744ae2a8
Commit
744ae2a8
authored
Jun 20, 2013
by
Stephane Glondu
Browse files
Add records service
parent
337309a5
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/web/registration.ml
View file @
744ae2a8
...
...
@@ -253,6 +253,25 @@ let () = Eliom_registration.Streamlist.register
)
)
let
()
=
Eliom_registration
.
Streamlist
.
register
~
service
:
Services
.
election_records
(
if_eligible
can_read
(
fun
uuid
election
user
()
->
forbidden
()
>>
(* FIXME *)
let
module
X
=
(
val
election
:
Web_common
.
WEB_ELECTION
)
in
(* TODO: streaming *)
lwt
ballots
=
X
.
B
.
fold_records
(
fun
(
u
,
d
)
xs
->
let
x
=
Printf
.
sprintf
"%s %S
\n
"
(
Serializable_builtin_j
.
string_of_datetime
d
)
u
in
return
(
x
::
xs
)
)
[]
in
let
s
=
List
.
map
(
fun
b
()
->
return
(
Ocsigen_stream
.
of_string
b
)
)
ballots
in
return
(
s
,
"text/plain"
)
)
)
let
prng
=
Cryptokit
.
Random
.(
pseudo_rng
(
string
secure_rng
16
))
let
()
=
Eliom_registration
.
String
.
register
...
...
src/web/services.ml
View file @
744ae2a8
...
...
@@ -99,6 +99,11 @@ let election_ballots = service
~
get_params
:
uuid
()
let
election_records
=
service
~
path
:
[
"election"
;
"records"
]
~
get_params
:
uuid
()
let
election_cast_post
=
post_service
~
fallback
:
election_cast
~
post_params
:
(
string
"encrypted_vote"
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment