Package fr.ippon.tatami.domain

Examples of fr.ippon.tatami.domain.User


        if (firstName == null && lastName == null) {
            // if we haven't first nor last name, we use fullName as last name to begin with :
            lastName = fullName;
        }

        User user = new User();
        // Note : The email could change... and the OpenId not
        // moreover an OpenId account could potentially be associated with several email addresses
        // so we store it for future use case :
        user.setOpenIdUrl(token.getName());

        user.setLogin(login);
        user.setFirstName(firstName);
        user.setLastName(lastName);
        userService.createUser(user);

        return userDetailsService.getTatamiUserDetails(login, user.getPassword());
    }
View Full Code Here


    @Override
    public UserDetails loadUserByUsername(final String login) throws UsernameNotFoundException {
        log.debug("Authenticating {} with Cassandra", login);
        String lowercaseLogin = login.toLowerCase();
        User userFromCassandra = userService.getUserByLogin(lowercaseLogin);
        if (userFromCassandra == null) {
            throw new UsernameNotFoundException("User " + lowercaseLogin + " was not found in Cassandra");
        }
        else if ( userFromCassandra.getActivated() != null && userFromCassandra.getActivated() == false ) {
            throw new UsernameNotFoundException("User " + lowercaseLogin + " is deactivated. Contact administrator for further details." );
        }
        return getTatamiUserDetails(lowercaseLogin, userFromCassandra.getPassword());
    }
View Full Code Here

    @RequestMapping(value = "/rest/tatamibot/configurations",
            method = RequestMethod.GET,
            produces = "application/json")
    @ResponseBody
    public Collection<TatamibotConfiguration> getConfigurations() {
        User currentUser = authenticationService.getCurrentUser();
        return tatamibotConfigurationRepository.findTatamibotConfigurationsByDomain(currentUser.getDomain());
    }
View Full Code Here

    /**
     * Common code for all "GET" requests.
     */
    private ModelAndView basicModelAndView() {
        ModelAndView mv = new ModelAndView();
        User currentUser = authenticationService.getCurrentUser();
        User user = userService.getUserByLogin(currentUser.getLogin());
        mv.addObject("user", user);
        return mv;
    }
View Full Code Here

            log.error("Internal Error while authenticating " + authentication.getName() + " with LDAP", iase);
            throw iase;
        }

        //Automatically create LDAP users in Tatami
        User user = userService.getUserByLogin(login);
        if (user == null) {
            user = new User();
            user.setLogin(login);
            userService.createUser(user);
        } else {
            // ensure that this user has access to its domain if it has been created before
            domainRepository.updateUserInDomain(user.getDomain(), user.getLogin());
        }

        // The real authentication object uses the login, and not the username
        org.springframework.security.core.userdetails.User realUser = userDetailsService.getTatamiUserDetails(login,
                authentication.getCredentials().toString());
View Full Code Here

            method = RequestMethod.GET,
            produces = "application/json")
    @Timed
    @ResponseBody
    public Collection<UserDTO> getFriends(@PathVariable String username, HttpServletResponse response) {
        User user = userService.getUserByUsername(username);
        if (user == null) {
            response.setStatus(HttpServletResponse.SC_NOT_FOUND);
            return null;
        }
        Collection<User> friends = friendshipService.getFriendsForUser(username);
View Full Code Here

            method = RequestMethod.GET,
            produces = "application/json")
    @Timed
    @ResponseBody
    public Collection<UserDTO> getFollowers(@PathVariable String username, HttpServletResponse response) {
        User user = userService.getUserByUsername(username);
        if (user == null) {
            response.setStatus(HttpServletResponse.SC_NOT_FOUND);
            return null;
        }
        Collection<User> friends = friendshipService.getFollowersForUser(username);
View Full Code Here

            method = RequestMethod.GET,
            produces = "application/json")
    @ResponseBody
    @Timed
    public Tag lookupTag(@RequestParam("tag_name") String tagname) {
        User currentUser = authenticationService.getCurrentUser();
        Collection<String> followedTags = userTagRepository.findTags(currentUser.getLogin());
        Tag tag = new Tag();
        tag.setName(tagname);
        if (followedTags.contains(tagname)) {
            tag.setFollowed(true);
        }
View Full Code Here

            method = RequestMethod.GET,
            produces = "application/json")
    @ResponseBody
    @Timed
    public Collection<Tag> getFollowedTags() {
        User currentUser = authenticationService.getCurrentUser();
        Collection<String> followedTags = userTagRepository.findTags(currentUser.getLogin());
        Collection<Tag> tags = new ArrayList<Tag>();
        for (String followedTag : followedTags) {
            Tag tag = new Tag();
            tag.setName(followedTag);
            tag.setFollowed(true);
View Full Code Here

    }

    @RequestMapping(value = {"/", "/home/**", "/home", "/home/"}, method = RequestMethod.GET)
    public ModelAndView home(@RequestParam(required = false) String ios) {
        ModelAndView mv = new ModelAndView("home");
        User currentUser = authenticationService.getCurrentUser();
        mv.addObject("user", currentUser);
        if (ios == null) {
            mv.addObject("ios", false);
        } else {
            mv.addObject("ios", true);
View Full Code Here

TOP

Related Classes of fr.ippon.tatami.domain.User

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.