Examples of User


Examples of org.ldv.sio.getap.app.User

   *
   *
   */
  @RequestMapping(value = "index", method = RequestMethod.GET)
  public void index(Model model) {
    User me = UtilSession.getUserInSession();

    model.addAttribute("listdctaps", manager.getAllDVCTAPByProfInterv(me));
    Long id = me.getId();
    model.addAttribute("etat0", manager.getAllDVCTAPByEtat(0, id));
    model.addAttribute("etat1", manager.getAllDVCTAPByEtat(1, id));
    model.addAttribute("etat2", manager.getAllDVCTAPByEtat(2, id));
    model.addAttribute("etat4", manager.getAllDVCTAPByEtat(4, id));
    model.addAttribute("etat8", manager.getAllDVCTAPByEtat(8, id));
View Full Code Here

Examples of org.lealone.dbobject.User

        if (openNew) {
            database = null;
        } else {
            database = DATABASES.get(name);
        }
        User user = null;
        boolean opened = false;
        if (database == null) {
            if (ifExists && !Database.exists(name)) {
                throw DbException.get(ErrorCode.DATABASE_NOT_FOUND_1, name);
            }
            database = createDatabase();
            database.init(ci, cipher);
            opened = true;
            if (database.getAllUsers().size() == 0) {
                // users is the last thing we add, so if no user is around,
                // the database is new (or not initialized correctly)
                user = new User(database, database.allocateObjectId(), ci.getUserName(), false);
                user.setAdmin(true);
                user.setUserPasswordHash(ci.getUserPasswordHash());
                database.setMasterUser(user);
            }
            DATABASES.put(name, database);
        }
        synchronized (database) {
            if (opened) {
                // start the thread when already synchronizing on the database
                // otherwise a deadlock can occur when the writer thread
                // opens a new database (as in recovery testing)
                database.opened();
            }
            if (database.isClosing()) {
                return null;
            }
            if (user == null) {
                if (database.validateFilePasswordHash(cipher, ci.getFilePasswordHash())) {
                    user = database.findUser(ci.getUserName());
                    if (user != null) {
                        if (!user.validateUserPasswordHash(ci.getUserPasswordHash())) {
                            user = null;
                        }
                    }
                }
                if (opened && (user == null || !user.isAdmin())) {
                    // reset - because the user is not an admin, and has no
                    // right to listen to exceptions
                    database.setEventListener(null);
                }
            }
View Full Code Here

Examples of org.libreplan.business.users.entities.User

            }
        }
    }

    private static Locale getUserLocale() {
        User user = UserUtil.getUserFromSession();
        if (user != null) {
            return user.getApplicationLanguage().getLocale();
        }
        return null;
    }
View Full Code Here

Examples of org.makersoft.shards.domain.User

  }

  @Test
  @SuppressWarnings("unchecked")
  public void testObject() throws Exception {
    User user = new User();
    user.setId("id");
    user.setUsername("makersoft");
    user.setPassword("password");
    user.setAge(20);

    Object obj = ParameterUtil.resolve(user, shardId);
    Assert.assertTrue(obj instanceof Map);

    Map<String, Object> map = (Map<String, Object>) obj;
    Assert.assertEquals(PREFIX_VALUE, map.get(PREFIX));
    Assert.assertEquals(SUFFIX_VALUE, map.get(SUFFIX));

    Assert.assertEquals(user.getId(), map.get("id"));
    Assert.assertEquals(user.getUsername(), map.get("username"));
    Assert.assertEquals(user.getPassword(), map.get("password"));
    Assert.assertEquals(user.getAge(), map.get("age"));
  }
View Full Code Here

Examples of org.mapache.business.user.User

                                   user.getUserID(), e);
        }
    }

    public synchronized User findUserById(int userNumber) throws DAOException {
        User user = null;
        PreparedStatement stmt;
        try {
            stmt =
MySQLDAOFactory.createConnection().prepareStatement(FIND_USER);
            stmt.setInt(1, userNumber);
View Full Code Here

Examples of org.monjo.example.User

 
 
  @Test
  public void shouldNotUseRef2() throws Exception{
    User user = new User();
    user.setName("NewCategory");

    AnotherPojo anotherPojo = PojoBuilder.createAnotherPojo(user);
   
    Monjo<ObjectId, AnotherPojo> monjoComplex = new Monjo<ObjectId, AnotherPojo>(getMongoDB(), AnotherPojo.class);
View Full Code Here

Examples of org.multibit.mbm.client.domain.model.model.User

   * Provides the default client HMAC authentication settings (not a Customer)
   */
  protected User setUpClientHmacAuthenticator() {

    Role clientRole = DatabaseLoader.buildClientRole();
    User storeClient = DatabaseLoader.buildStoreClient(clientRole);

    return setUpHmacAuthenticator(storeClient);
  }
View Full Code Here

Examples of org.mvel2.tests.core.res.User

    ParserContext ctx = new ParserContext();
    ctx.addPackageImport("org.mvel2.tests.core.res");

    ExpressionCompiler compiler = new ExpressionCompiler("[ new User('Bobba', 'Feta') ]");
    List list = (List) executeExpression(compiler.compile(ctx));
    User user = (User) list.get(0);
    assertEquals("Bobba",
        user.getFirstName());
  }
View Full Code Here

Examples of org.mybatis.spring.sample.domain.User

    this.fooService = fooService;
  }

  @Test
  public final void testFooService() {
    User user = this.fooService.doSomeBusinessStuff("u1");
    assertNotNull(user);
    assertEquals("Pocoyo", user.getName());
  }
View Full Code Here

Examples of org.myphotodiary.model.User

    HttpSession session = req.getSession(false);
    if (session == null) {
      throw new AuthenticationException("No user session");
    }
    // Check that user is properly authenticated
    User user = (User) session.getAttribute(Configuration.userAttribute);
    if (user == null) {
      throw new AuthenticationException("No authenticated user");
    }
    if (path == null) {
      throw new AuthenticationException("Invalid resource path");
    }

    // Check if that directory path is indexed
    Directory directory;
    boolean closeEm = false;
    if (em == null) {
      em = ModelFactory.getEntityManager();
      closeEm = true;
    }
    try {
      try {
        directory = em
            .createQuery(
                "select directory from Directory directory where directory.path = ?1",
                Directory.class).setParameter(1, path)
            .getSingleResult();
      } catch (NoResultException ex) {
        // non indexed directories are public (to allow navigation)
        return;
      }

      // Refresh user and roles assignment
      List<RoleAssignment> roles;
      try {
        user = em.find(User.class, user.getUserName());
        roles = user.getRoleAssignments();
      } catch (NoResultException ex) {
        // User is no longer registered,
        throw new AuthenticationException("Unknown user");
      }

      // Check if directory group can be accessed by this user
      for (RoleAssignment roleAssignment : roles) {
        if (!roleAssignment.getGroupName().equals(directory.getGroup().getGroupName())) {
          continue;
        }
        Role.isPermitted(roleAssignment.getRole(), action);
        return;
      }
    } finally {
      if (closeEm) {
        // Close method managed EntityManager
        em.close();
      }
    }

    throw new AuthenticationException("Unauthorized user " + user.getUserName() + " for path " + path);
  }
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.