Exemplo n.º 1
0
 public String process() {
   if (!this.loggedIn) {
     try {
       this.loggedIn =
           this.authenticateObject.check(new AuthenticateDTO(this.login, this.password));
     } catch (EJBException ejbex) {
       this.loggedIn = false;
       System.out.println(ejbex.toString());
     }
   } else {
     this.loggedIn = false;
   }
   if (this.loggedIn) {
     ((HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest())
         .getSession(true);
     this.cartObject.initialize();
   } else {
     FacesContext facesContext = FacesContext.getCurrentInstance();
     ExternalContext externalContext = facesContext.getExternalContext();
     Locale loc = externalContext.getRequestLocale();
     externalContext.invalidateSession();
     facesContext.getViewRoot().setLocale(loc);
     if (this.cartObject != null) {
       this.cartObject.setClientId(null);
       this.cartObject.setMerchandiseId(null);
       this.cartObject.setAmount(null);
       this.cartObject.destroy();
     }
     this.currencyObject.setLocalizationLocale(loc);
   }
   return null;
 }
Exemplo n.º 2
0
 public void clientData(String _id) {
   Object[] objects = null;
   try {
     objects = this.authenticateObject.testification(_id);
   } catch (EJBException ejbex) {
     System.out.println(ejbex.toString());
   }
   if (objects != null) {
     this.login = objects[0].toString().trim();
     this.forename = (objects[1] == null) ? "" : objects[1].toString().trim();
     this.email = objects[2].toString().trim();
   }
 }
Exemplo n.º 3
0
 public Integer clientIdentification() {
   if (this.loggedIn) {
     try {
       this.clientIdentification =
           this.authenticateObject.identification(new AuthenticateDTO(this.login, this.password));
     } catch (EJBException ejbex) {
       this.loggedIn = false;
       this.clientIdentification = null;
       System.out.println(ejbex.toString());
     }
     return this.clientIdentification;
   }
   return null;
 }