Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
belenios
belenios
Commits
2e80497e
Commit
2e80497e
authored
Mar 23, 2015
by
Stephane Glondu
Browse files
Move call to Auth.configure and simplify structure of Web_election
parent
6cde86d2
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/web/web_election.ml
View file @
2e80497e
...
...
@@ -32,18 +32,13 @@ open Web_services
let
(
/
)
=
Filename
.
concat
module
type
REGISTRATION
=
sig
module
W
:
WEB_ELECTION
module
Register
(
X
:
EMPTY
)
:
EMPTY
end
module
type
REGISTRABLE
=
sig
module
W
:
sig
include
ELECTION_DATA
include
WEB_PARAMS
module
E
:
ELECTION
with
type
elt
=
G
.
t
end
module
Register
(
X
:
EMPTY
)
:
REGISTRA
TION
module
Register
(
X
:
EMPTY
)
:
WEB_ELEC
TION
end
module
Make
(
D
:
ELECTION_DATA
)
(
P
:
WEB_PARAMS
)
:
REGISTRABLE
=
struct
...
...
@@ -55,7 +50,7 @@ module Make (D : ELECTION_DATA) (P : WEB_PARAMS) : REGISTRABLE = struct
module
E
=
Election
.
MakeElection
(
G
)(
M
)
end
module
Register
(
X
:
EMPTY
)
:
REGISTRA
TION
=
struct
module
Register
(
X
:
EMPTY
)
:
WEB_ELEC
TION
=
struct
let
uuid
=
Uuidm
.
to_string
D
.
election
.
e_params
.
e_uuid
let
base_path
=
[
"elections"
;
uuid
]
...
...
@@ -72,8 +67,8 @@ module Make (D : ELECTION_DATA) (P : WEB_PARAMS) : REGISTRABLE = struct
end
module
Auth
=
Web_auth
.
Make
(
N
)
let
()
=
Auth
.
configure
N
.
auth_config
module
W
=
struct
include
W
module
B
:
WEB_BALLOT_BOX
=
struct
...
...
@@ -254,17 +249,6 @@ module Make (D : ELECTION_DATA) (P : WEB_PARAMS) : REGISTRABLE = struct
end
module
Auth
=
Auth
end
module
Register
(
X
:
EMPTY
)
:
EMPTY
=
struct
let
()
=
Auth
.
configure
N
.
auth_config
end
end
end
src/web/web_election.mli
View file @
2e80497e
...
...
@@ -25,18 +25,13 @@ open Signatures
open
Web_serializable_t
open
Web_signatures
module
type
REGISTRATION
=
sig
module
W
:
WEB_ELECTION
module
Register
(
X
:
EMPTY
)
:
EMPTY
end
module
type
REGISTRABLE
=
sig
module
W
:
sig
include
ELECTION_DATA
include
WEB_PARAMS
module
E
:
ELECTION
with
type
elt
=
G
.
t
end
module
Register
(
X
:
EMPTY
)
:
REGISTRA
TION
module
Register
(
X
:
EMPTY
)
:
WEB_ELEC
TION
end
module
Make
(
D
:
ELECTION_DATA
)
(
P
:
WEB_PARAMS
)
:
REGISTRABLE
src/web/web_site.ml
View file @
2e80497e
...
...
@@ -91,9 +91,7 @@ let register_election params web_params =
let
module
R
=
Web_election
.
Make
(
D
)
(
P
)
in
(
module
R
:
Web_election
.
REGISTRABLE
)
,
fun
()
->
(* starting from here, we do side-effects on the running server *)
let
module
R
=
R
.
Register
(
struct
end
)
in
let
module
W
=
R
.
W
in
let
module
X
:
EMPTY
=
R
.
Register
(
T
)
in
let
module
W
=
R
.
Register
(
struct
end
)
in
let
election
=
(
module
W
:
WEB_ELECTION
)
in
election_table
:=
SMap
.
add
uuid
election
!
election_table
;
election
...
...
Write
Preview
Markdown
is supported
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