Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
belenios
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
belenios
belenios
Commits
6ffd350d
Commit
6ffd350d
authored
Jun 04, 2018
by
Stephane Glondu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix password regeneration when explicit usernames are used
parent
9a940c5a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
+14
-3
src/web/web_site.ml
src/web/web_site.ml
+14
-3
No files found.
src/web/web_site.ml
View file @
6ffd350d
...
...
@@ -620,6 +620,17 @@ let () =
(
fun
(
uuid
,
()
)
()
->
T
.
regenpwd
uuid
()
>>=
Html5
.
send
)
let
find_user_id
uuid
user
=
let
uuid_s
=
raw_string_of_uuid
uuid
in
let
db
=
Lwt_io
.
lines_of_file
(
!
spool_dir
/
uuid_s
/
"voters.txt"
)
in
let
%
lwt
db
=
Lwt_stream
.
to_list
db
in
let
rec
loop
=
function
|
[]
->
Lwt
.
fail
Not_found
|
id
::
xs
->
let
_
,
login
=
split_identity
id
in
if
login
=
user
then
return
id
else
loop
xs
in
loop
db
let
()
=
Any
.
register
~
service
:
election_regenpwd_post
(
fun
(
uuid
,
()
)
user
->
...
...
@@ -636,13 +647,13 @@ let () =
in
let
service
=
preapply
election_admin
(
uuid
,
()
)
in
(
try
%
lwt
let
%
lwt
_
=
Ocsipersist
.
find
table
user
in
let
%
lwt
id
=
find_user_id
uuid
user
in
let
langs
=
get_languages
metadata
.
e_languages
in
let
%
lwt
x
=
generate_password
metadata
langs
title
url
user
in
let
%
lwt
x
=
generate_password
metadata
langs
title
url
id
in
Ocsipersist
.
add
table
user
x
>>
dump_passwords
(
!
spool_dir
/
raw_string_of_uuid
uuid
)
table
>>
T
.
generic_page
~
title
:
"Success"
~
service
(
"A new password has been mailed to "
^
user
^
"."
)
()
(
"A new password has been mailed to "
^
id
^
"."
)
()
>>=
Html5
.
send
with
Not_found
->
T
.
generic_page
~
title
:
"Error"
~
service
...
...
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