-
Notifications
You must be signed in to change notification settings - Fork 207
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
962d698
commit 9cb8091
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package femr.ui.controllers; | ||
|
||
import com.google.inject.Inject; | ||
import controllers.AssetsFinder; | ||
import femr.business.services.core.ISessionService; | ||
import femr.common.dtos.CurrentUser; | ||
import femr.ui.views.html.home.index; | ||
import femr.ui.views.html.sessions.create; | ||
import play.mvc.Controller; | ||
import play.mvc.Result; | ||
|
||
public class SettingsController extends Controller { | ||
private final AssetsFinder assetsFinder; | ||
private ISessionService sessionService; | ||
|
||
@Inject | ||
public SettingsController(AssetsFinder assetsFinder, ISessionService sessionService) { | ||
|
||
this.assetsFinder = assetsFinder; | ||
this.sessionService = sessionService; | ||
} | ||
|
||
public Result index() { | ||
CurrentUser currentUser = sessionService.retrieveCurrentUserSession(); | ||
|
||
if (currentUser != null) { | ||
return ok(index.render(currentUser, assetsFinder)); | ||
} | ||
|
||
return ok(create.render(null, 0, assetsFinder)); | ||
} | ||
} |