Package com.nevernote.domain

Examples of com.nevernote.domain.Users


   
    //Keeping track of user session and notes
    NotesService notesService = ctx.getBean("notesService", NotesService.class);
   
    //Pulls user session and confirms they are logged in
    Users u = (Users) session.getAttribute("userSession");
    if (u == null) {
      response.sendRedirect("Login.jsp");
    }
    if (!u.getEnabled()) {
      response.sendRedirect("Login.jsp");
    }

    String noteName = request.getParameter("delete");

    //Find the relative path of the notesRepo folder to append to note name for saving
    String relativeWebPath = "WEB-INF/notesRepo";
    String absoluteDiskPath = getServletContext().getRealPath(relativeWebPath);

    File file = new File(absoluteDiskPath + "/" + u.getId() + "/" + noteName);
    boolean success = file.delete();

    if (success) {
      //Update database with the note deletion
      Notes theNote = notesService.findOne(noteName);
View Full Code Here


    ctx.load("classpath:app-context.xml");
    ctx.refresh();

    UsersService us = ctx.getBean("usersService", UsersService.class);
   
    Users user = (Users) session.getAttribute("userSession");
    if (user == null){
      response.sendRedirect("Login.jsp");
    }
    if (!user.getEnabled()) {
      response.sendRedirect("Login.jsp");
    }
    if (!"root".equals(user.getId())) {
      response.sendRedirect("Login.jsp");
    }

    String userId = request.getParameter("disable");
    Users userToDisable = us.findById(userId);
    userToDisable.setEnabled(false);
    us.save(userToDisable.getId(), userToDisable);

    response.sendRedirect("AdminDashServlet");
  }
View Full Code Here

    ctx.load("classpath:app-context.xml");
    ctx.refresh();

    UsersService us = ctx.getBean("usersService", UsersService.class);
   
    Users user = (Users) session.getAttribute("userSession");
    if (user == null){
      response.sendRedirect("Login.jsp");
    }
    if (!user.getEnabled()) {
      response.sendRedirect("Login.jsp");
    }
    if (!"root".equals(user.getId())) {
      response.sendRedirect("Login.jsp");
    }

    //Test that we got the user
    System.out.println("********Users object passed from Login**************");
    System.out.println(user.getId());
    System.out.println("********************");
   
    // Obtain Collection of all Users
    List<Users> users = new ArrayList<Users>();
   
View Full Code Here

    ctx.load("classpath:app-context.xml");
    ctx.refresh();

    UsersService us = ctx.getBean("usersService", UsersService.class);
   
    Users user = (Users) session.getAttribute("userSession");
    if (user == null){
      response.sendRedirect("Login.jsp");
    }
    if (!user.getEnabled()) {
      response.sendRedirect("Login.jsp");
    }
    if (!"root".equals(user.getId())) {
      response.sendRedirect("Login.jsp");
    }

    String userId = request.getParameter("enable");
    Users userToEnable = us.findById(userId);
    userToEnable.setEnabled(true);
    us.save(userToEnable.getId(), userToEnable);

    response.sendRedirect("AdminDashServlet");
  }
View Full Code Here

TOP

Related Classes of com.nevernote.domain.Users

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.