Examples of UserInfo


Examples of bluffinmuffin.data.UserInfo

            public void createUserCommandReceived(CreateUserCommand c)
            {
                final boolean ok = !DataManager.Persistance.isUsernameExist(c.getUsername()) && !DataManager.Persistance.isDisplayNameExist(c.getDisplayName());
                if (ok)
                {
                    DataManager.Persistance.register(new UserInfo(c.getUsername(), c.getPassword(), c.getEmail(), c.getDisplayName(), 7500));
                }
                sendMessage(c.encodeResponse(ok));
            }
           
            @Override
            public void checkUserExistCommandReceived(CheckUserExistCommand command)
            {
                sendMessage(command.encodeResponse(DataManager.Persistance.isUsernameExist(command.getUsername())));
            }
           
            @Override
            public void checkDisplayExistCommandReceived(CheckDisplayExistCommand command)
            {
                sendMessage(command.encodeResponse(m_lobby.isNameUsed(command.getDisplayName()) || DataManager.Persistance.isDisplayNameExist(command.getDisplayName())));
            }
           
            @Override
            public void authenticateUserCommandReceived(AuthenticateUserCommand command)
            {
                final UserInfo u = DataManager.Persistance.authenticate(command.getUsername(), command.getPassword());
                if (u != null)
                {
                    m_playerName = u.getDisplayName();
                }
                sendMessage(command.encodeResponse(u != null));
            }
           
            @Override
            public void getUserCommandReceived(GetUserCommand command)
            {
                final UserInfo u = DataManager.Persistance.get(command.getUsername());
                sendMessage(command.encodeResponse(u.getEmail(), u.getDisplayName(), u.getTotalMoney()));
            }
        });
       
    }
View Full Code Here

Examples of br.com.caelum.vraptor.mydvds.interceptor.UserInfo

  public void setUp() throws Exception {
    mockery = new Mockery();

    dao = mockery.mock(DvdDao.class);

    userInfo = new UserInfo();
    userInfo.login(new User());

    result = new MockResult();
    Validator validator = new MockValidator();
View Full Code Here

Examples of ch.inftec.ju.db.auth.AuthenticationEditorViewModel.UserInfo

    this.authVm.refresh();
   
    // Read / modify the one existing user
   
    Assert.assertEquals(1, this.authVm.getUserInfos().size());
    UserInfo u1 = this.authVm.getUserInfos().get(0);
    Assert.assertEquals("user1", u1.getName());
   
    TestUtils.assertCollectionEquals(this.authVm.getUserInfos(), u1);
    Assert.assertEquals(3, u1.getRoles().size());   
    Assert.assertFalse(u1.hasChanged());
   
    MemoryBooleanProperty p1 = u1.getRoles().get("role1");
    Assert.assertTrue(p1.get());
    Assert.assertFalse(p1.hasChanged());
    Assert.assertFalse(this.authVm.hasRolesChanged());

    p1.set(false);
    Assert.assertTrue(p1.hasChanged());
    Assert.assertTrue(u1.hasChanged());
    Assert.assertTrue(this.authVm.hasRolesChanged());
   
    MemoryBooleanProperty p2 = u1.getRoles().get("newRole");
    p2.set(true);
   
    this.authVm.save();
    Assert.assertFalse(this.authVm.hasRolesChanged());
   
    UserInfo u1New = this.authVm.getUserInfos().get(0);
    Assert.assertFalse(u1New.getRoles().get("role1").get());
    Assert.assertTrue(u1New.getRoles().get("newRole").get());
  }
View Full Code Here

Examples of clips.login.UserInfo

            return super.addNewPage(pageToAdd, afterPage);
        }

        @Override
        protected String makeTitle() throws ClipsException {
            UserInfo user = UserInfo.get();
            String spec = "";
            DirectoryCollaboratorItem collaborator = user.getCollaborator();
            DirectoryCollaboratorFunctions dcf = DirectoryLocator.getDirectory(DirectoryCollaboratorFunctions.class);
            Selector<DirectoryCollaboratorFunctionsItem> s = dcf.getFilteredItems(collaborator);
            if (s.size() == 0) {
                spec = "";
            } else {
                int i = 0;
                spec += s.get(i).getSpeciality();
                for (i = 1; i < s.size(); i++) {
                    String title = s.get(i).getSpeciality().getTitle();
                    if (spec.indexOf(title) < 0) {
                        spec += ", " + title;
                    }
                }
            }
            return user.getCollaborator().getLpu().getTitle() + ", " + user.getUserName() + (user.isSuperUser() ? " [СУПЕР-ПОЛЬЗОВАТЕЛЬ] " : " [" + spec + "]");
        }
View Full Code Here

Examples of com.baasbox.service.sociallogin.UserInfo

    SocialLoginService sc = SocialLoginService.by(socialNetwork,appcode);
    Token t =extractOAuthTokensFromRequest(request());
    if(t==null){
      return badRequest(String.format("Both %s and %s should be specified as query parameters or in the json body",OAUTH_TOKEN,OAUTH_SECRET));
    }
    UserInfo result=null;
    try {
      if(sc.validationRequest(t.getToken())){
        result = sc.getUserInfo(t);
      }else{
        return badRequest("Provided token is not valid");
      }
    } catch (BaasBoxSocialException e1) {
      return badRequest(e1.getError());
    }catch (BaasBoxSocialTokenValidationException e2) {
      return badRequest("Unable to validate provided token");
    }
    if (Logger.isDebugEnabled()) Logger.debug("UserInfo received: " + result.toString());
    result.setFrom(socialNetwork);
    result.setToken(t.getToken());
    //Setting token as secret for one-token only social networks
    result.setSecret(t.getSecret()!=null && StringUtils.isNotEmpty(t.getSecret())?t.getSecret():t.getToken());
    UserDao userDao = UserDao.getInstance();
    ODocument existingUser =  null;
    try{
      existingUser = userDao.getBySocialUserId(result);
    }catch(SqlInjectionException sie){
      return internalServerError(sie.getMessage());
    }

    if(existingUser!=null){
      String username = null;
      try {
        username = UserService.getUsernameByProfile(existingUser);
        if(username==null){
          throw new InvalidModelException("username for profile is null");
        }
      } catch (InvalidModelException e) {
        internalServerError("unable to login with "+socialNetwork+" : "+e.getMessage());
      }
     
      String password = generateUserPassword(username, (Date)existingUser.field(UserDao.USER_SIGNUP_DATE));
     
      ImmutableMap<SessionKeys, ? extends Object> sessionObject = SessionTokenProvider.getSessionTokenProvider().setSession(appcode,username, password);
      response().setHeader(SessionKeys.TOKEN.toString(), (String) sessionObject.get(SessionKeys.TOKEN));
      ObjectNode on = Json.newObject();
      if(existingUser!=null){
        on = (ObjectNode)Json.parse( User.prepareResponseToJson(existingUser));
      }
      on.put(SessionKeys.TOKEN.toString(), (String) sessionObject.get(SessionKeys.TOKEN));
      return ok(on);
    }else{
      if (Logger.isDebugEnabled()) Logger.debug("User does not exists with tokens...trying to create");
      String username = UUID.randomUUID().toString();
      Date signupDate = new Date();
      try{
        String password = generateUserPassword(username, signupDate);
        JsonNode privateData = null;
        if(result.getAdditionalData()!=null && !result.getAdditionalData().isEmpty()){
          privateData = Json.toJson(result.getAdditionalData());
        }
        UserService.signUp(username, password, signupDate, null, privateData, null, null,true);
        ODocument profile=UserService.getUserProfilebyUsername(username);
        UserService.addSocialLoginTokens(profile,result);
        ImmutableMap<SessionKeys, ? extends Object> sessionObject = SessionTokenProvider.getSessionTokenProvider().setSession(appcode, username, password);
View Full Code Here

Examples of com.cloud.bridge.service.UserInfo

    public Properties getStartupProperties() {
        return properties;
    }

    public UserInfo getUserInfo(String accessKey) {
        UserInfo info = new UserInfo();
        Transaction txn = Transaction.open(Transaction.AWSAPI_DB);
        try {
            txn.start();
            UserCredentialsVO cloudKeys = ucDao.getByAccessKey( accessKey );
            if ( null == cloudKeys ) {
                logger.debug( accessKey + " is not defined in the S3 service - call SetUserKeys" );
                return null;
            } else {
                info.setAccessKey( accessKey );
                info.setSecretKey( cloudKeys.getSecretKey());
                info.setCanonicalUserId(accessKey);
                info.setDescription( "S3 REST request" );
                return info;
            }
        }finally {
            txn.commit();
        }
View Full Code Here

Examples of com.datasalt.pangool.examples.topnhashtags.Beans.UserInfo

      tweet.setCreated_at(SimpleTweet.dateFormat.format(new Date(date)));
      tweet.setEntities(new Entities());
      tweet.getEntities().setHashtags(new ArrayList<HashTag>());
      tweet.getEntities().getHashtags().add(new HashTag());
      tweet.getEntities().getHashtags().get(0).setText(hashTag);
      tweet.setUser(new UserInfo());
      tweet.getUser().setLocation(location);
      writer.write(mapper.writeValueAsString(tweet) + "\n");
    }
   
    writer.close();
View Full Code Here

Examples of com.firefun.QX.Bean.UserInfo

    Result rst = new Result("ffdb");

    HttpSession session = request.getSession();
    Object obj = session.getAttribute("se_files" + ywid);
    // 获取用户信息
    UserInfo userinfo = (UserInfo) session.getAttribute("userInfo");
    String userid = userinfo.getUserID();
    String dwid = userinfo.getDwid();
    sql = "select sjdwid from sys_dept where dwid='" + dwid + "'";
    rst.EQuery(sql);
    String sjdwid = rst.getString(0, "sjdwid");

    if (obj != null) {
View Full Code Here

Examples of com.fitbit.api.common.model.user.UserInfo

    public ScaleUser(JSONObject jsonObject) throws JSONException {
        userId = jsonObject.getString("userId");
        scaleUserName = jsonObject.getString("scaleUserName");
        bodyType = BodyType.valueOf(jsonObject.getString("bodyType"));
        userInfo = new UserInfo(jsonObject.getJSONObject("userInfo"), false);
    }
View Full Code Here

Examples of com.force.sdk.qa.util.UserInfo

        cleanSchema();
    }
   
    @BeforeClass
    public void loadPersistenceUnit() throws Exception {
        UserInfo info = BaseJPAFTest.getDefaultUserInfoFromContext();
        ForceConnectorConfig cc = new ForceConnectorConfig();
        cc.setUsername(info.getUserName());
        cc.setPassword(info.getPassword());
        cc.setAuthEndpoint(info.getServerEndpoint());
        BaseJPAFTest.populateTestContext(getTestName(), info);
    }
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.