Skip to content

Commit

Permalink
Fixing the email verification
Browse files Browse the repository at this point in the history
  • Loading branch information
Joony committed Jul 27, 2009
1 parent ba70d81 commit f4c932c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
Binary file modified ebin/db_users.beam
Binary file not shown.
20 changes: 14 additions & 6 deletions src/db_users.erl
Expand Up @@ -162,12 +162,20 @@ get_email_address(Username) ->

verify_email(Code) ->
% get the username from the verification_codes table
[VerificationCodesEmail] = mnesia:read(verification_codes_email, Code, write),
Username = VerificationCodesEmail#verification_codes_email.username,
io:format("1: ~s~n", [Code]),
F = fun() ->
[VerificationLevels] = mnesia:read(verification_levels, Username, write),
VerificationLevelsUpdate = VerificationLevels#verification_levels{verified_email=true},
mnesia:write(VerificationLevelsUpdate)
mnesia:read(verification_codes_email, Code, write)
end,
mnesia:transaction(F).
{atomic, [VerificationCodesEmailRow]} = mnesia:transaction(F),
io:fwrite("2: ~w~n", [VerificationCodesEmailRow]),
Username = VerificationCodesEmailRow#verification_codes_email.username,
io:format("Name is: ~s~n", [Username]).


% F = fun() ->
% [VerificationLevels] = mnesia:read(verification_levels, Username, write),
% VerificationLevelsUpdate = VerificationLevels#verification_levels{verified_email=true},
% mnesia:write(VerificationLevelsUpdate)
% end,
% mnesia:transaction(F).

0 comments on commit f4c932c

Please sign in to comment.