Skip to content

Commit

Permalink
bugfix: password recovery procedure
Browse files Browse the repository at this point in the history
  • Loading branch information
kroc702 committed Jun 6, 2016
1 parent 0cea866 commit 89598da
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/com/fullmetalgalaxy/server/AccountServlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,7 @@ else if( isPassword )
{
// user ask for his password to be send on his email
String msg = "";
FmgDataStore ds = new FmgDataStore( false );
Query<EbAccount> query = ds.query( EbAccount.class ).filter( "m_email", params.get( "email" ) );
Query<EbAccount> query = FmgDataStore.dao().query( EbAccount.class ).filter( "m_email", params.get( "email" ) );
QueryResultIterator<EbAccount> it = query.iterator();
if( !it.hasNext() )
{
Expand All @@ -254,11 +253,14 @@ else if( account.getAuthProvider() != AuthProvider.Fmg )
new FmgMessage( "askPassword" ).sendEMail( account );

msg = "un email a été envoyé à " + account.getEmail();

FmgDataStore ds = new FmgDataStore( false );
account = ds.get( EbAccount.class, account.getId() );
account.setLastPasswordAsk( new Date() );
ds.put( account );
ds.close();
}
}
ds.close();

p_response.sendRedirect( "/password.jsp?msg="+msg );
return;
Expand Down

0 comments on commit 89598da

Please sign in to comment.