this.characterDao = characterDao;
}
@Override
public LoginDto login(String requestUri, String locale) {
UserService userService = googleAppEngineServices.getUserService();
User googleUser = userService.getCurrentUser();
LoginDto loginDto = new LoginDto();
if (googleUser != null) {
lv.odylab.evemanage.domain.user.User user = ensureUserExists(googleUser);
loginDto.setLoggedIn(Boolean.TRUE);
loginDto.setUserID(user.getId());
loginDto.setEmailAddress(googleUser.getEmail());
loginDto.setNickname(googleUser.getNickname());
String logoutUrl = userService.createLogoutURL(requestUri);
loginDto.setLogoutUrl(createGwtLocaleAwareUrl(requestUri, logoutUrl, locale));
loginDto.setAdmin(userService.isUserAdmin());
loginDto.setRoles(user.getRoles());
} else {
loginDto.setLoggedIn(Boolean.FALSE);
String loginUrl = userService.createLoginURL(requestUri);
loginDto.setLoginUrl(createGwtLocaleAwareUrl(requestUri, loginUrl, locale));
}
if (isDevelopmentMode(requestUri)) {
loginDto.setRussianUrl("?gwt.codesvr=127.0.0.1:9997&locale=ru");
loginDto.setEnglishUrl("?gwt.codesvr=127.0.0.1:9997");