54. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 3/24/2017 5:17:19 PM Eastern Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.

54.1 Files compared

# Location File Last Modified
1 MHV_2017.2.0.0 Code In Flight.zip\National Portal\mhv_user\mhv-usermgmt-portal-portlet\src\main\java\gov\va\med\mhv\usermgmt\web\controller ChangePasswordController.java Fri Sep 16 15:30:26 2016 UTC
2 MHV_2017.2.0.0 Code In Flight.zip\National Portal\mhv_user\mhv-usermgmt-portal-portlet\src\main\java\gov\va\med\mhv\usermgmt\web\controller ChangePasswordController.java Fri Mar 24 20:45:49 2017 UTC

54.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 2 272
Changed 1 2
Inserted 0 0
Removed 0 0

54.3 Comparison options

Whitespace
Character case Differences in character case are significant
Line endings Differences in line endings (CR and LF characters) are ignored
CR/LF characters Not shown in the comparison detail

54.4 Active regular expressions

No regular expressions were active.

54.5 Comparison detail

  1   /**
  2    * 
  3    */
  4   package go v.va.med.m hv.usermgm t.web.cont roller;
  5  
  6   import gov .va.med.mh v.common.a pi.dto.Use rProfileDT O;
  7   import gov .va.med.mh v.common.a pi.excepti on.MHVExce ption;
  8   import gov .va.med.mh v.usermgmt .web.formb ean.Change Password;
  9  
  10   import jav a.io.IOExc eption;
  11   import jav a.io.Seria lizable;
  12  
  13   import jav ax.faces.a pplication .FacesMess age;
  14   import jav ax.faces.b ean.Manage dBean;
  15   import jav ax.faces.c ontext.Fac esContext;
  16   import jav ax.portlet .PortletRe quest;
  17   import jav ax.portlet .PortletSe ssion;
  18  
  19   import org .springfra mework.bea ns.factory .annotatio n.Autowire d;
  20   import org .springfra mework.con text.annot ation.Scop e;
  21   import org .springfra mework.ste reotype.Co mponent;
  22   import org .springfra mework.web .context.W ebApplicat ionContext ;
  23  
  24   import com .liferay.p ortal.kern el.log.Log ;
  25   import com .liferay.p ortal.kern el.log.Log FactoryUti l;
  26   /**
  27    * @author  
P II
  28    * 
  29    */
  30   @ManagedBe an
  31   @Component
  32   @Scope(Web Applicatio nContext.S COPE_REQUE ST)
  33   public cla ss ChangeP asswordCon troller ex tends Abst ractContro ller imple ments
  34                    Seri alizable {
  35  
  36           pr ivate stat ic final l ong serial VersionUID  = -919187 5686222494 443L;
  37  
  38           st atic Log l ogger = Lo gFactoryUt il
  39                             .getLo g(ChangePa sswordCont roller.cla ss);
  40  
  41           @A utowired
  42           pr ivate Chan gePassword  changePas sword;
  43  
  44           pr ivate Stri ng success Message =  null;
  45  
  46           pu blic Chang ePassword  getChangeP assword()  {
  47                    retu rn changeP assword;
  48           }
  49  
  50           pu blic Strin g getSucce ssMessage( ) {
  51                    retu rn success Message;
  52           }
  53  
  54           pu blic void  authorize( ) throws I OException  {
  55  
  56                    logg er.info("= =======ins ide author ize()===== ======= ") ;
  57  
  58                    Port letRequest  request =  (PortletR equest) Fa cesContext
  59                                      .getCurr entInstanc e().getExt ernalConte xt().getRe quest();
  60  
  61                    if ( request.ge tUserPrinc ipal() ==  null) {
  62                             FacesC ontext con text = Fac esContext. getCurrent Instance() ;
  63                             contex t.getAppli cation().g etNavigati onHandler( )
  64                                               .handleNav igation(co ntext, nul l, "uanuth orized.xht ml");
  65                    } el se {
  66                             Portle tSession s ession = r equest.get PortletSes sion();
  67                             String  userid =  (String) s ession.get Attribute(
  68                                               "LIFERAY_S HARED_user id", Portl etSession. APPLICATIO N_SCOPE);
  69  
  70                             // TOD O: add a m ethod to g et userId/ Password
  71                             //getU serProfile (userid);
  72                    }
  73           }
  74  
  75           pu blic Strin g updatePa ssword() {
  76                    Face sContext c ontext = F acesContex t.getCurre ntInstance ();
  77  
  78                    logg er.info("= =======ins ide update Password() ========== == ");
  79  
  80                    Port letRequest  request =  (PortletR equest) Fa cesContext
  81                                      .getCurr entInstanc e().getExt ernalConte xt().getRe quest();
  82                    Port letSession  session =  request.g etPortletS ession();
  83  
  84                    logg er.debug(" EmergencyC ontactList Controller  - loadMod el");
  85  
  86                    logg er.debug(" EmergencyC ontactList Controller  - Gson cr eated");
  87                    Stri ng userid  = (String)  session.g etAttribut e("LIFERAY _SHARED_us erid",
  88                                      PortletS ession.APP LICATION_S COPE);
  89                    User ProfileDTO  userProfi le = getUs erProfile( userid);
  90                    user Profile.se tPassword( this.chang ePassword. getNewPass word());
  91  
  92  
  93                    user Profile.se tConfPassw ord(this.c hangePassw ord.getCon firmNewPas sword());
  94                    user Profile.se tOldPasswo rd(this.ch angePasswo rd.getCurr entPasswor d());
  95                    vali datePasswo rd(userPro file,true) ;
  96                    
  97                    if(  FacesConte xt.getCurr entInstanc e().getMes sageList() .size() >  0 ) {
  98                             
  99                             contex t.getAppli cation().g etNavigati onHandler( ).
  100                    hand leNavigati on(context , null, "/ views/acco unt/change Password.x html");
  101                             return  null;
  102                    }
  103                    
  104  
  105                    try  {
  106                             // /us erpassword /changepas sword
  107                             logger .debug("Ch angePasswo rdControll er - saveC ontactActi on - get W ebClient") ;
  108                             
  109                             this.u serMgmtSer vice.chang ePassword( userProfil e,Boolean. FALSE);
  110                             
  111                             logger .debug("Ch angePasswo rdControll er - saveC ontactActi on - succe ss");
  112                             this.s uccessMess age = "suc cess";
  113                             FacesC ontext.get CurrentIns tance().ad dMessage(
  114                                      null, ne w FacesMes sage(Faces Message.SE VERITY_INF O, 
  115                                      "Your pa ssword has  been chan ged succes fully.", " SUCCESS")) ;
  116                    } ca tch (MHVEx ception e)  {
  117                             super. processErr orMessages (e);
  118                             return  null;
  119                    } ca tch (Excep tion e) {
  120                             this.s uccessMess age = "fai lure";
  121                             logger .debug("Ch angePasswo rdControll er - saveC ontactActi on - fail" );
  122                             logger .debug("Ch angePasswo rdControll er - excep tion "
  123                                               + e.getMes sage());
  124                             
  125                             logger .error(e);
  126                             
  127                    }
  128  
  129                    logg er.info("s uccessMess age : " +  successMes sage);
  130  
  131                    cont ext.getApp lication() .getNaviga tionHandle r().
  132           ha ndleNaviga tion(conte xt, null,  "/views/ac count/chan gePassword .xhtml");
  133                    
  134                    retu rn null;
  135           }
  136  
  137   }