Examples of User


Examples of org.ops4j.pax.exam.sample2.model.User

    private UserService userService;

    @Test
    public void authenticateValidUser() {
        userService.register("bilbo", "Bilbo Baggins", "treasure");
        User user = userService.authenticate("bilbo", "treasure");
        assertThat(user, is(notNullValue()));
        assertThat(user.getId(), is("bilbo"));
        assertThat(user.getName(), is("Bilbo Baggins"));
        assertThat(user.getPassword(), is("treasure"));
    }
View Full Code Here

Examples of org.osforce.connect.entity.system.User

  }
 
  @RequestMapping(value="/login-action", method=RequestMethod.POST)
  public String doLoginAction(@Valid LoginBean loginBean, BindingResult result,
      Model model, HttpSession session, HttpServletResponse response) throws Exception {
    User user = userService.loginUser(loginBean.getUsername(), loginBean.getPassword());
    if(result.hasErrors() || user==null) {
      model.addAttribute(AttributeKeys.SHOW_ERRORS_KEY_READABLE, true);
      return "page:system/login";
    }
    //
    if(loginBean.getRememberMe()) {
      String username = CipherUtil.encrypt(user.getUsername(), KEY_FILE);
      Cookie cookie = new Cookie(AttributeKeys.REMEMBER_ME_KEY, username);
      cookie.setPath("/connect");
      response.addCookie(cookie);
    }
    session.setAttribute(AttributeKeys.USER_ID_KEY, user.getId());
    return String.format("redirect:/%s/profile", user.getProject().getUniqueId());
  }
View Full Code Here

Examples of org.osgi.service.useradmin.User

*/
public class PopupMessageAction implements MessageAction {
    public static final String NAME = "PopupMessageAction";

    public void handle(Event event) {
        final User user = (User) event.getProperty(USER);
        final String description = (String) event.getProperty(DESCRIPTION);
        final String shortDescription = (String) event.getProperty(SHORT_DESCRIPTION);

        Thread t = new Thread("Notification") {
            @Override
            public void run() {
                JOptionPane.showMessageDialog(null,
                    "<html><table><tr><td>To: </td><td>" + user.getName() + " " + (String) user.getProperties().get("email") + "</td></tr>" +
                    "<tr><td>Subject: </td><td>" + shortDescription + "</td></tr>" +
                    "<tr><td valign='top'>Message: </td><td>" + description.replaceAll("\n", "<p>")
                );
            }
        };
View Full Code Here

Examples of org.ozoneDB.core.User

        if (users.isEmpty()) {
            out.println( "No users found." );
        }
        else {
            for (DxIterator it = users.iterator(); it.next() != null;) {
                User user = (User)it.object();

                out.println( "user name: " + user.name() );
                out.println( "    id: " + user.id() );
            }
        }

    }
View Full Code Here

Examples of org.palo.viewapi.User

  private final XObject[] getUsers(AdministrationService adminSrv) {
    List<User> users = adminSrv.getUsers();
    XObject[] ret = new XObject[users.size()];
    for (int i = 0; i < ret.length; ++i) {
      User usr = users.get(i);     
      XUser xUser = (XUser) XConverter.createX(usr);
      ret[i] = xUser;
//      // accounts:
//      List<Account> accounts = adminSrv.getAccounts(usr);
//      xUser.setAccounts(WPaloAdminCache.getAccounts(accounts)); //XConverter.createAccounts(accounts, xUser));
View Full Code Here

Examples of org.pathways.openciss.model.User

public class UserService {
  public static EntityManager em;
 
  public static User getUser(int user_key) {
    User result = null;
    em =EMF.get().createEntityManager();
    try {
      result = em.find(User.class, user_key);
    }
    finally {em.close();}
View Full Code Here

Examples of org.pau.assetmanager.entities.User

public class PropertyBookPremiseTest extends GenericTest {

  @Test
  public void propertyPremiseTests() throws ParseException {
    // create a user
    User user = UsersBusiness.persistUserByUsernameAndPassword("new_user",
        "fake_password");
    Assert.assertArrayEquals(new Object[] { "new_user", "fake_password" },
        new Object[] { user.getUsername(), user.getPassword() });

    // create a client
    Client client = ClientsBusiness.addClientByClientName(user,
        "new_client");
    Assert.assertEquals("new_client", client.getName());
View Full Code Here

Examples of org.picketlink.idm.api.User

    public List<OpenIdProvider> getProviders() {
        return providers;
    }

    public void success(OpenIdPrincipal principal) {
        User user = new OpenIdUser(principal);
                       
        if (isIdentityManaged()) {
            // By default we set the status to FAILURE, if we manage to get to the end
            // of this method we get rewarded with a SUCCESS
            setStatus(AuthenticationStatus.FAILURE);       
View Full Code Here

Examples of org.picketlink.idm.model.User

        return grantConfiguration.revoke(roles);
    }

    @Override
    public User findByUsername(String username) throws RuntimeException {
        User user = identityManager.getUser(username);
        if (user == null) {
            throw new AeroGearSecurityException(HttpStatus.CREDENTIAL_NOT_FOUND);
        }
        return user;
    }
View Full Code Here

Examples of org.picketlink.idm.model.basic.User

    private void setup() {
        final IdentityManager identityManager = partitionManager.createIdentityManager();
        final RelationshipManager relationshipManager = partitionManager.createRelationshipManager();

        final User admin = new User( "admin" );
        final User director = new User( "director" );
        final User user = new User( "user" );
        final User guest = new User( "guest" );

        identityManager.add( admin );
        identityManager.add( director );
        identityManager.add( user );
        identityManager.add( guest );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.