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
9dbe5b04
Commit
9dbe5b04
authored
Mar 22, 2014
by
Stephane Glondu
Browse files
Put all arguments of Web_election.make in a record
parent
a75e9b72
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/web/registration.ml
View file @
9dbe5b04
...
...
@@ -142,12 +142,10 @@ let process_datadir dir =
)
in
let
featured
=
item
.
datadir_featured
in
let
election
=
Web_election
.
make
raw_election
metadata
~
featured
~
params_fname
~
public_keys_fname
in
let
election
=
Web_election
.(
make
{
raw_election
;
metadata
;
featured
;
params_fname
;
public_keys_fname
;
})
in
let
module
X
=
(
val
election
:
WEB_ELECTION
)
in
X
.
B
.
inject_creds
public_creds
>>
return
election
...
...
src/web/web_election.ml
View file @
9dbe5b04
...
...
@@ -28,6 +28,14 @@ open Serializable_t
open
Web_serializable_t
open
Web_common
type
config
=
{
raw_election
:
string
;
metadata
:
metadata
;
featured
:
bool
;
params_fname
:
string
;
public_keys_fname
:
string
;
}
let
can_read
m
user
=
match
m
.
e_readers
with
|
None
->
false
...
...
@@ -44,7 +52,7 @@ let can_vote m user =
|
None
->
false
(* voters must log in *)
|
Some
u
->
check_acl
(
Some
acls
)
u
.
user_user
let
make
raw_election
metadata
~
featured
~
params_fname
~
public_keys_fname
=
let
make
{
raw_election
;
metadata
;
featured
;
params_fname
;
public_keys_fname
}
=
let
e_fingerprint
=
sha256_b64
raw_election
in
let
wrapped_params
=
Serializable_j
.
params_of_string
...
...
src/web/web_election.mli
View file @
9dbe5b04
...
...
@@ -24,10 +24,12 @@ open Serializable_t
open
Web_serializable_t
open
Web_signatures
val
make
:
string
->
metadata
->
featured
:
bool
->
params_fname
:
string
->
public_keys_fname
:
string
->
(
module
WEB_ELECTION
)
type
config
=
{
raw_election
:
string
;
metadata
:
metadata
;
featured
:
bool
;
params_fname
:
string
;
public_keys_fname
:
string
;
}
val
make
:
config
->
(
module
WEB_ELECTION
)
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