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
273a2f11
Commit
273a2f11
authored
Dec 20, 2012
by
Stephane Glondu
Browse files
Dummy login/logout
parent
e92099e2
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/helios_registration.ml
View file @
273a2f11
...
...
@@ -53,10 +53,20 @@ let () = Eliom_registration.Html5.register
(
fun
()
()
->
(* FIXME *)
let
service
=
Helios_services
.
perform_login
()
in
let
()
=
Eliom_registration
.
Html5
.
register
let
()
=
Eliom_registration
.
Redirection
.
register
~
service
~
scope
:
Eliom_common
.
session
(
fun
()
(
username
,
admin_p
)
->
return
(
Helios_templates
.
not_implemented
"Login"
))
(
fun
()
(
user_name
,
admin_p
)
->
let
user_type
=
"dummy"
in
Eliom_reference
.
set
user
(
Some
(
admin_p
,
Helios_templates
.({
user_name
;
user_type
})))
>>
return
Helios_services
.
home
)
in
return
(
Helios_templates
.
dummy_login
~
service
))
let
()
=
Eliom_registration
.
Redirection
.
register
~
service
:
Helios_services
.
logout
(
fun
()
()
->
Eliom_state
.
discard
~
scope
:
Eliom_common
.
session
()
>>
return
Helios_services
.
home
)
src/helios_services.ml
View file @
273a2f11
...
...
@@ -32,6 +32,11 @@ let login = service
~
get_params
:
unit
()
let
logout
=
service
~
path
:
[
"logout"
]
~
get_params
:
unit
()
let
perform_login
()
=
Eliom_service
.
post_coservice
~
csrf_safe
:
true
...
...
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