use of org.onebusaway.users.model.User in project onebusaway-application-modules by camsys.
the class CurrentUserServiceImpl method updateStopBookmark.
@Override
public void updateStopBookmark(int id, String name, List<String> stopIds, RouteFilter routeFilter) {
User user = _currentUserStrategy.getCurrentUser(false);
if (user == null)
return;
_userPropertiesService.updateStopBookmark(user, id, name, stopIds, routeFilter);
}
use of org.onebusaway.users.model.User in project onebusaway-application-modules by camsys.
the class CurrentUserServiceImpl method resetCurrentUser.
public void resetCurrentUser() {
User user = _currentUserStrategy.getCurrentUser(false);
if (user == null)
return;
_userService.resetUser(user);
_currentUserStrategy.clearCurrentUser();
}
use of org.onebusaway.users.model.User in project onebusaway-application-modules by camsys.
the class CurrentUserServiceImpl method handleAddAccount.
@Override
public IndexedUserDetails handleAddAccount(String type, String id, String credentials, boolean isAnonymous) {
User currentUser = _currentUserStrategy.getCurrentUser(false);
UserIndexKey key = new UserIndexKey(type, id);
UserIndex index = _userService.getUserIndexForId(key);
boolean exists = index != null;
// New user?
if (exists) {
if (currentUser != null) {
User existingUser = index.getUser();
_userService.mergeUsers(existingUser, currentUser);
}
} else {
if (currentUser != null)
index = _userService.addUserIndexToUser(currentUser, key, credentials);
else
index = _userService.getOrCreateUserForIndexKey(key, credentials, isAnonymous);
}
return new IndexedUserDetailsImpl(_authoritiesService, index);
}
use of org.onebusaway.users.model.User in project onebusaway-application-modules by camsys.
the class CurrentUserServiceImpl method clearDefaultLocation.
@Override
public void clearDefaultLocation() {
User user = _currentUserStrategy.getCurrentUser(false);
if (user == null)
return;
_userPropertiesService.clearDefaultLocation(user);
}
use of org.onebusaway.users.model.User in project onebusaway-application-modules by camsys.
the class CurrentUserServiceImpl method setRememberUserPreferencesEnabled.
@Override
public void setRememberUserPreferencesEnabled(boolean rememberPreferencesEnabled) {
User user = _currentUserStrategy.getCurrentUser(true);
if (user == null)
return;
_userPropertiesService.setRememberUserPreferencesEnabled(user, rememberPreferencesEnabled);
}
Aggregations