Package userManagement

Examples of userManagement.User


            HttpSession session = request.getSession();
            dbManager db = new dbManager();
            String date = db.getDBtime();
            db.releaseConnection();
            session.setAttribute("date", date);
            User doctor = (User) request.getSession().getAttribute("loggedUser");//recupero il profilo del medico
           
            String[] patientsList = request.getParameterValues(checkboxname);//recupero gli id passati per POST
           
            htmlPage += "<div class=\"container\">";
            htmlPage += "<div class=\"header\">";
View Full Code Here


           
            HttpSession session = request.getSession();
            String pdfName = session.getId()+".pdf";//il nome del pdf sarà <IDsessione>.pdf
            String realPath =getServletContext().getRealPath(File.separator+"logged"+File.separator+"doctorFiles"+File.separator+"PDFs"+File.separator+pdfName);
            String virtualPath = "PDFs/" + pdfName;
            User doctor = (User) request.getSession().getAttribute("loggedUser");//recupero il profilo del medico
                              
            LinkedList <Paziente> chosenPatients = (LinkedList<Paziente>)session.getAttribute("chosenPatients");
              
            for(Paziente p : chosenPatients){
                dbManager db = new dbManager();
                db.doVaccinate(doctor.getId(),p.getId());
                db.releaseConnection();
            }
           
            String date = (String)request.getSession().getAttribute("date");
            String signature = doctor.getName()+" "+doctor.getSurname();

            pdfCreator.createLetters(realPath, chosenPatients, signature, date);
            htmlCode += "<div class=\"container\">";
            htmlCode += "<div class=\"header\">";
            htmlCode += "<p class=\"headerInfo\"><a href=\"" + Macro.BASE + "\" target=\"_self\">Torna alla Home</a><BR>";
View Full Code Here

            String htmlOutro="</BODY></HTML>";
            htmlPage+=htmlIntro;
           
            HttpSession session = request.getSession();
           
            User loggedUser = (User) session.getAttribute("loggedUser");

            
                    htmlPage+="Benvenuto "/*+username*/+" queste sono le vaccinazioni che hai effettuato.<BR>";
                    htmlPage+="<TABLE>";
                    htmlPage+="<TR>";
                    htmlPage+="<TD>Medico</TD>";
                    htmlPage+="<TD>Data di vaccinazione</TD>";
                    htmlPage+="</TR>";
                   
                   
                    User paziente = loggedUser;
                    dbManager db = new dbManager();
                    ResultSet res = db.getPatientVaccinations(paziente.getId());
                    db.releaseConnection();
                    try{
                        if(res.first()){
                            while(!res.isAfterLast()){
                                int medId = res.getInt("doctor_id");
View Full Code Here

            ResultSet res = dbM.userMatches(usr, psw, isDoc);
            dbM.releaseConnection();
           
            if (res.first()){
                HttpSession session = request.getSession();
                User loggedUser = (User) session.getAttribute("loggedUser");
                if (loggedUser == null){
                    loggedUser = new User(res, isDoc);
                    session.setAttribute("loggedUser", loggedUser);
                   
                    htmlPage += "<div class=\"jump\">";
                    htmlPage += "<p class=\"jump\">Benvenuto " + ((loggedUser.getIsDoctor()) ? "Dr. " + loggedUser.getSurname() : loggedUser.getName()) + "<br/>";
                    htmlPage += "Verrai a breve reindirizzato alla tua pagina personale</p>";
                    htmlPage += "<p class=\"jump\"><a href=\"" + Macro.BASE + "logged/Welcome\">Oppure clicca qui per continuare...</a></p>";
                    htmlPage += "</div>";
                   
                    /*INIZIO SETTAGGIO COOKIE*/
                    String cookieName = loggedUser.getUsername();
                    Cookie cookie = null;
                    Cookie[] cookieArray = request.getCookies();

                    if (cookieArray!=null){

                        for(int i=0; i<cookieArray.length; i++) {

                            if (cookieArray[i].getName().equals(cookieName)) {
                                cookie = cookieArray[i];
                                break;
                            }
                        }
                        if(cookie==null){
                             Calendar cal = Calendar.getInstance();
                             String cookieValue = cal.getTime().toString();
                             int cookieExpire = 3600*24*7;//una settimana
                             loggedUser.setLastLogin(cookieValue);
                             cookie = new Cookie(cookieName, cookieValue);
                             cookie.setMaxAge(cookieExpire);

                             response.addCookie(cookie);
                        }

                        else{
                            String message = cookie.getValue();
                            loggedUser.setLastLogin(message);
                            Calendar cal = Calendar.getInstance();
                            String cookieValue = cal.getTime().toString();
                            cookie.setValue(cookieValue);
                           
                            response.addCookie(cookie);
View Full Code Here

                htmlPage += "<div class=\"container\">";
                htmlPage += "<div class=\"header\">";
                                
                    if(r1!=null && r2!=null){
                        if(r1.first()){
                            User p = new User(r1, false);
                            htmlPage += "<img id=\"welcomeImage\" src=\"" + Macro.BASE + "photo/"+p.getPicture()+"\" />";
                            htmlPage += "<p class=\"headerInfo\">Paziente: "+p.getName()+" "+p.getSurname()+"</p>";
                            htmlPage += "<p class=\"headerInfo\">Data di nascita: "+p.getBirthdate()+"<br />";
                            htmlPage += "Sesso: "+p.getGender()+"</p>";
                            htmlPage += "<p class=\"headerInfo\"><a href=\"" + Macro.BASE + "\" title=\"Home\">Torna alla Home</a></p>\n";
                        }
                       
                    htmlPage += "</div>"//div header end
                    htmlPage += "<div class=\"content\">";
View Full Code Here

                    + "</HEAD><BODY>";
            String htmlOutro = "</BODY></HTML>";
            htmlPage += htmlIntro;
           
            HttpSession session = request.getSession();
            User loggedUser = (User) session.getAttribute("loggedUser");
                           
                 /*INIZIO LINK AL PDF*/
                String pdfName = session.getId()+".pdf";
                String realPath = getServletContext().getRealPath(File.separator+"logged"+File.separator+"doctorFiles"+File.separator+"PDFs"+File.separator+pdfName);           
                String virtualPath ="doctorFiles/PDFs/"+pdfName;
                File pdf = new File(realPath);
               
                htmlPage += "<div class=\"container\">";
                htmlPage += "<div class=\"header\">";
                htmlPage += (loggedUser.getIsDoctor() ? "" : "<img id=\"welcomeImage\" src=\"" + Macro.BASE + "photo/"+loggedUser.getPicture()+"\" />");
                htmlPage += "<p class=\"headerInfo\">Sei loggato come: "+loggedUser.getName()+" "+loggedUser.getSurname()+"<br>";
                htmlPage += "Username: "+loggedUser.getUsername()+"</p>";
                htmlPage += "<p class=\"headerInfo\">Ultimo Login: "+loggedUser.getLastLogin()+"<br>";
                htmlPage += "<a href=\"" + Macro.BASE + "logged/Logout\"> Logout </a></p>";
                htmlPage += "</div>"//div header end
               
                htmlPage += "<div class=\"content\">";

                if (pdf.exists()){
                    htmlPage += "<p id=\"pdfLink\">";
                    htmlPage += "<img src=\"photo/pdf_ico.gif\" height=\"16px\" width=\"16px\"/>"
                            + "<a href=" + Macro.BASE + "logged/"+virtualPath+" id=\"pdfLink\" target=\"_blank\"> Lettere Ultima Vaccinazione</a>";
                    htmlPage += "</p>";
                }
               
                htmlPage += "<p class=\"headerInfo\">Menu</p>";
                htmlPage += "<p class=\"content\">";              
               
                if(loggedUser.getIsDoctor()){
                    htmlPage += "<a href=\"" + Macro.BASE + "logged/doctorFiles/Richiamo\"> Procedura richiamo paziente </a><BR>";
                    htmlPage += "<a href=\"" + Macro.BASE + "logged/doctorFiles/VisualizzaVaccinazioni\"> Visualizza pazienti richiamati </a><BR>";
                } else {
                    htmlPage += "<a href=\"" + Macro.BASE + "logged/patientFiles/VaccinazioniPaziente\"> Visualizza dettagli vaccinazioni </a><BR>";
                }
View Full Code Here

  static User user;

  @BeforeClass
  public static void setUpClass() throws Exception {
    user = new User("Test", "Tester", "Testerdetest", null, 0);
    Chat.getSingleton().getChatTabbedModel().setUser(user);
  }
View Full Code Here

  }
    }

    @Override
    public User readUser(String username) throws UserNotFoundException {
  User user = null;
  if(!userExists(username)) {
     user = ufr.readUser(username);
  }else{
      throw new UserNotFoundException(username);
  }
View Full Code Here

     * @param userName  The name of the user to be read.
     * @return  The user with the specified userName from the userFile. Null if
     * the user wasn't found.
     */
    public User readUser(String userName) {
  User user = null;            // Initialise user with null value
  ArrayList<User> users = getUserList();        // Get the list of users from the userFile
  if (users != null) {            // Check if the list was found
      for (User current : users) {        // Search the user
    if (current.getName().equals(userName)) {
        user = current;
View Full Code Here

           JOptionPane.ERROR_MESSAGE);
    } else {
      ArrayList<Friend> friends = abstractLoungeModel.getCurrentUser().getFriends();
     
      if (newPassword.length == 0 && retypePassword.length == 0) {
        user = new User(username, new String(password), alias, null, 0);       
      } else {
        user = new User(username, new String(newPassword), alias, null, 0);
      }
     
      user.getFriends().addAll(friends);
     
      userFileWriter.adjustUser(user);
View Full Code Here

TOP

Related Classes of userManagement.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.