Produced by Araxis Merge on 1/19/2019 1:19:24 PM Eastern Standard 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.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | VIRP_Build_6_Dec_2018_CG.zip\Registries VIRP Web Site | Site.Master.cs | Thu Jan 17 17:39:54 2019 UTC |
| 2 | VIRP_Build_6_Dec_2018_CG.zip\Registries VIRP Web Site | Site.Master.cs | Sat Jan 19 18:05:39 2019 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 596 |
| Changed | 1 | 8 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| 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 |
No regular expressions were active.
| 1 | using Syst em; | |
| 2 | using Syst em.Collect ions.Gener ic; | |
| 3 | using Syst em.Linq; | |
| 4 | using Syst em.Web; | |
| 5 | using Syst em.Web.Sec urity; | |
| 6 | using Syst em.Web.UI; | |
| 7 | using Syst em.Web.UI. WebControl s; | |
| 8 | using VIRP _WEB.BaseC ode; | |
| 9 | using VIRP _WEB.SoaSe rvices; | |
| 10 | using Anti XssEnc = M icrosoft.S ecurity.Ap plication; | |
| 11 | ||
| 12 | namespace VIRP_WEB | |
| 13 | { | |
| 14 | public partial c lass SiteM aster : Ma sterPage | |
| 15 | { | |
| 16 | pr ivate cons t string A ntiXsrfTok enKey = "_ _AntiXsrfT oken"; | |
| 17 | pr ivate cons t string A ntiXsrfUse rNameKey = "__AntiXs rfUserName "; | |
| 18 | pr ivate stri ng antiXsr fTokenValu e; | |
| 19 | ||
| 20 | pr ivate Appl icationSes sion appli cationSess ion; | |
| 21 | pr ivate User Session us erSession; | |
| 22 | ||
| 23 | pr otected Ap plicationS ession App licationSe ssion | |
| 24 | { | |
| 25 | get | |
| 26 | { | |
| 27 | if ( Applicatio n["Applica tionSessio n"] != nul l) | |
| 28 | { | |
| 29 | applicatio nSession = (Applicat ionSession )Applicati on["Applic ationSessi on"]; | |
| 30 | } | |
| 31 | ||
| 32 | if ( applicatio nSession = = null) ap plicationS ession = n ew Applica tionSessio n(); | |
| 33 | ||
| 34 | retu rn applica tionSessio n; | |
| 35 | } | |
| 36 | set | |
| 37 | { | |
| 38 | appl icationSes sion = val ue; | |
| 39 | } | |
| 40 | } | |
| 41 | ||
| 42 | pr otected Us erSession UserSessio n | |
| 43 | { | |
| 44 | get | |
| 45 | { | |
| 46 | if ( Session["U serSession "] != null ) | |
| 47 | { | |
| 48 | userSessio n = (UserS ession)Ses sion["User Session"]; | |
| 49 | } | |
| 50 | ||
| 51 | if ( userSessio n == null) userSessi on = new U serSession (); | |
| 52 | ||
| 53 | retu rn userSes sion; | |
| 54 | } | |
| 55 | set | |
| 56 | { | |
| 57 | user Session = value; | |
| 58 | } | |
| 59 | } | |
| 60 | ||
| 61 | pr otected vo id Page_In it(object sender, Ev entArgs e) | |
| 62 | { | |
| 63 | // The c ode below helps to p rotect aga inst XSRF attacks | |
| 64 | var requ estCookie = Request. Cookies[An tiXsrfToke nKey]; | |
| 65 | Guid req uestCookie GuidValue; | |
| 66 | if (requ estCookie != null && Guid.TryP arse(reque stCookie.V alue, out requestCoo kieGuidVal ue)) | |
| 67 | { | |
| 68 | // U se the Ant i-XSRF tok en from th e cookie | |
| 69 | anti XsrfTokenV alue = req uestCookie .Value; | |
| 70 | Page .ViewState UserKey = antiXsrfTo kenValue; | |
| 71 | } | |
| 72 | else | |
| 73 | { | |
| 74 | // G enerate a new Anti-X SRF token and save t o the cook ie | |
| 75 | anti XsrfTokenV alue = Gui d.NewGuid( ).ToString ("N"); | |
| 76 | Page .ViewState UserKey = antiXsrfTo kenValue; | |
| 77 | ||
| 78 | var responseCo okie = new HttpCooki e(AntiXsrf TokenKey) | |
| 79 | { | |
| 80 | HttpOnly = true, | |
| 81 | Value = an tiXsrfToke nValue | |
| 82 | }; | |
| 83 | if ( FormsAuthe ntication. RequireSSL && Reques t.IsSecure Connection ) | |
| 84 | { | |
| 85 | responseCo okie.Secur e = true; | |
| 86 | } | |
| 87 | Resp onse.Cooki es.Set(res ponseCooki e); | |
| 88 | } | |
| 89 | ||
| 90 | Page.Pre Load += Ma ster_Page_ PreLoad; | |
| 91 | } | |
| 92 | ||
| 93 | pr otected vo id Master_ Page_PreLo ad(object sender, Ev entArgs e) | |
| 94 | { | |
| 95 | if (!IsP ostBack) | |
| 96 | { | |
| 97 | // S et Anti-XS RF token | |
| 98 | View State[Anti XsrfTokenK ey] = Page .ViewState UserKey; | |
| 99 | View State[Anti XsrfUserNa meKey] = C ontext.Use r.Identity .Name ?? S tring.Empt y; | |
| 100 | } | |
| 101 | else | |
| 102 | { | |
| 103 | // V alidate th e Anti-XSR F token | |
| 104 | if ( (string)Vi ewState[An tiXsrfToke nKey] != a ntiXsrfTok enValue | |
| 105 | || (string )ViewState [AntiXsrfU serNameKey ] != (Cont ext.User.I dentity.Na me ?? Stri ng.Empty)) | |
| 106 | { | |
| 107 | throw new InvalidOpe rationExce ption("Val idation of Anti-XSRF token fai led."); | |
| 108 | } | |
| 109 | } | |
| 110 | } | |
| 111 | ||
| 112 | pr otected vo id Page_Lo ad(object sender, Ev entArgs e) | |
| 113 | { | |
| 114 | try | |
| 115 | { | |
| 116 | if ( !Page.IsPo stBack) | |
| 117 | { | |
| 118 | mnuLeftMen u.MenuItem DataBound += MnuLeft Menu_MenuI temDataBou nd; | |
| 119 | ||
| 120 | BuildMenu( ); | |
| 121 | ||
| 122 | string bui ldVersion = ServiceI nterfaceMa nager.GET_ VERSION(); | |
| 123 | ||
| 124 | lblVersion .Text = "V IRP Versio n: " + Ant iXssEnc.En coder.Html Encode(bui ldVersion) ; | |
| 125 | ||
| 126 | //if (Serv iceInterfa ceManager. USER_ROLES _GET_BY_RE GISTRYID_U SERNAME_SE T_READONLY (HttpConte xt.Current .User.Iden tity.Name, UserSessi on.Current RegistryId )) | |
| 127 | //{ | |
| 128 | // mnuT opMenu.Ite ms[2].Sele ctable = f alse; | |
| 129 | // mnuT opMenu.Ite ms[3].Sele ctable = f alse; | |
| 130 | //} | |
| 131 | } | |
| 132 | } | |
| 133 | catch (E xception e x) | |
| 134 | { | |
| 135 | Serv iceInterfa ceManager. LogError(e x.Message, String.Fo rmat("{0}. {1}", Syst em.Reflect ion.Method Base.GetCu rrentMetho d().Declar ingType.Fu llName, Sy stem.Refle ction.Meth odBase.Get CurrentMet hod().Name ), HttpCon text.Curre nt.User.Id entity.Nam e, 0); | |
| 136 | thro w ex; | |
| 137 | } | |
| 138 | } | |
| 139 | ||
| 140 | pu blic void BuildMenu( ) | |
| 141 | { | |
| 142 | try | |
| 143 | { | |
| 144 | stri ng path = "~" + Requ est.Url.Ab solutePath ; | |
| 145 | CrsM enu crsMen u = Servic eInterface Manager.ST D_MENU_ITE MS_GET_MEN U(HttpCont ext.Curren t.User.Ide ntity.Name , UserSess ion.Curren tRegistryI d, path); | |
| 146 | ||
| 147 | if ( crsMenu != null) | |
| 148 | { | |
| 149 | System.Xml .Serializa tion.XmlSe rializer w riter = ne w System.X ml.Seriali zation.Xml Serializer (typeof(Cr sMenu)); | |
| 150 | System.IO. StringWrit er stream = new Syst em.IO.Stri ngWriter() ; | |
| 151 | writer.Ser ialize(str eam, crsMe nu); | |
| 152 | ||
| 153 | string xml = stream. ToString() ; | |
| 154 | ||
| 155 | stream.Clo se(); | |
| 156 | ||
| 157 | dsLeftMenu .Data = xm l; | |
| 158 | } | |
| 159 | else | |
| 160 | dsLeftMenu .Data = "< CrsMenu></ CrsMenu>"; | |
| 161 | } | |
| 162 | catch (E xception e x) | |
| 163 | { | |
| 164 | Serv iceInterfa ceManager. LogError(e x.Message, String.Fo rmat("{0}. {1}", Syst em.Reflect ion.Method Base.GetCu rrentMetho d().Declar ingType.Fu llName, Sy stem.Refle ction.Meth odBase.Get CurrentMet hod().Name ), HttpCon text.Curre nt.User.Id entity.Nam e, 0); | |
| 165 | thro w ex; | |
| 166 | } | |
| 167 | } | |
| 168 | ||
| 169 | pr otected vo id ListReg istries_Da taBound(ob ject sende r, EventAr gs e) | |
| 170 | { | |
| 171 | ServiceI nterfaceMa nager.LogI nformation ("POSTBACK _EVENT", S tring.Form at("{0}.{1 }", System .Reflectio n.MethodBa se.GetCurr entMethod( ).Declarin gType.Full Name, Syst em.Reflect ion.Method Base.GetCu rrentMetho d().Name), HttpConte xt.Current .User.Iden tity.Name, UserSessi on.Current RegistryId ); | |
| 172 | ||
| 173 | try | |
| 174 | { | |
| 175 | list Registries .Items.Ins ert(0, new ListItem( "Select... ", "0")); | |
| 176 | } | |
| 177 | catch (E xception e x) | |
| 178 | { | |
| 179 | Serv iceInterfa ceManager. LogError(e x.Message, String.Fo rmat("{0}. {1}", Syst em.Reflect ion.Method Base.GetCu rrentMetho d().Declar ingType.Fu llName, Sy stem.Refle ction.Meth odBase.Get CurrentMet hod().Name ), HttpCon text.Curre nt.User.Id entity.Nam e, UserSes sion.Curre ntRegistry Id); | |
| 180 | thro w ex; | |
| 181 | } | |
| 182 | } | |
| 183 | ||
| 184 | pr otected vo id ListReg istries_Se lectedInde xChanged(o bject send er, EventA rgs e) | |
| 185 | { | |
| 186 | ServiceI nterfaceMa nager.LogI nformation ("POSTBACK _EVENT", S tring.Form at("{0}.{1 }", System .Reflectio n.MethodBa se.GetCurr entMethod( ).Declarin gType.Full Name, Syst em.Reflect ion.Method Base.GetCu rrentMetho d().Name), HttpConte xt.Current .User.Iden tity.Name, UserSessi on.Current RegistryId ); | |
| 187 | ||
| 188 | try | |
| 189 | { | |
| 190 | int id = 0; | |
| 191 | int. TryParse(l istRegistr ies.Select edValue, o ut id); | |
| 192 | ||
| 193 | if ( id > 0) | |
| 194 | { | |
| 195 | UserSessio n.CurrentR egistryId = id; | |
| 196 | if (listRe gistries.S electedIte m.ToString () == "Emb edded Frag ment Regis try") | |
| 197 | { | |
| 198 | Respon se.Redirec t("~/Custo m/EFR/Refe rrals/Refe rrals.aspx ?statusId= 4", false) ; | |
| 199 | } | |
| 200 | else | |
| 201 | { | |
| 202 | Respon se.Redirec t("~/Commo n/Default. aspx?id=" + UserSess ion.Curren tRegistryI d, false); | |
| 203 | } | |
| 204 | } | |
| 205 | else | |
| 206 | { | |
| 207 | UserSessio n.CurrentR egistryId = 0; | |
| 208 | } | |
| 209 | } | |
| 210 | catch (E xception e x) | |
| 211 | { | |
| 212 | Serv iceInterfa ceManager. LogError(e x.Message, String.Fo rmat("{0}. {1}", Syst em.Reflect ion.Method Base.GetCu rrentMetho d().Declar ingType.Fu llName, Sy stem.Refle ction.Meth odBase.Get CurrentMet hod().Name ), HttpCon text.Curre nt.User.Id entity.Nam e, UserSes sion.Curre ntRegistry Id); | |
| 213 | thro w ex; | |
| 214 | } | |
| 215 | } | |
| 216 | ||
| 217 | pr otected vo id DsRegis tries_Sele cting(obje ct sender, ObjectDat aSourceSel ectingEven tArgs e) | |
| 218 | { | |
| 219 | ServiceI nterfaceMa nager.LogI nformation ("POSTBACK _EVENT", S tring.Form at("{0}.{1 }", System .Reflectio n.MethodBa se.GetCurr entMethod( ).Declarin gType.Full Name, Syst em.Reflect ion.Method Base.GetCu rrentMetho d().Name), HttpConte xt.Current .User.Iden tity.Name, UserSessi on.Current RegistryId ); | |
| 220 | ||
| 221 | try | |
| 222 | { | |
| 223 | e.In putParamet ers.Clear( ); | |
| 224 | e.In putParamet ers.Add("C URRENT_USE R", HttpCo ntext.Curr ent.User.I dentity.Na me); | |
| 225 | e.In putParamet ers.Add("C URRENT_REG ISTRY_ID", 0); | |
| 226 | } | |
| 227 | catch (E xception e x) | |
| 228 | { | |
| 229 | Serv iceInterfa ceManager. LogError(e x.Message, String.Fo rmat("{0}. {1}", Syst em.Reflect ion.Method Base.GetCu rrentMetho d().Declar ingType.Fu llName, Sy stem.Refle ction.Meth odBase.Get CurrentMet hod().Name ), HttpCon text.Curre nt.User.Id entity.Nam e, UserSes sion.Curre ntRegistry Id); | |
| 230 | thro w ex; | |
| 231 | } | |
| 232 | } | |
| 233 | ||
| 234 | pr ivate void MnuLeftMe nu_MenuIte mDataBound (object se nder, Menu EventArgs e) | |
| 235 | { | |
| 236 | string[] disableMe nus = new string[] { | |
| 237 | "Coho rt Criteri a", "Frame work Data" , "User-De fined Fiel ds", "Work Streams", "Activiti es" | |
| 238 | }; | |
| 239 | bool sel ectable = UserSessio n.CurrentR egistryId > 0; | |
| 240 | foreach (var mnu i n mnuLeftM enu.Items) | |
| 241 | { | |
| 242 | Menu Item mnuIt em = (Menu Item)mnu; | |
| 243 | if ( disableMen us.ToList( ).FindInde x(x => x.E quals(mnuI tem.Text)) > -1) | |
| 244 | { | |
| 245 | mnuItem.Se lectable = selectabl e; | |
| 246 | } | |
| 247 | } | |
| 248 | } | |
| 249 | ||
| 250 | pr otected vo id LinkSSO iLogout_Cl ick(object sender, E ventArgs e ) | |
| 251 | { | |
| 252 | ServiceI nterfaceMa nager.LogI nformation ("POSTBACK _EVENT", S tring.Form at("{0}.{1 }", System .Reflectio n.MethodBa se.GetCurr entMethod( ).Declarin gType.Full Name, Syst em.Reflect ion.Method Base.GetCu rrentMetho d().Name), HttpConte xt.Current .User.Iden tity.Name, UserSessi on.Current RegistryId ); | |
| 253 | ||
| 254 | try | |
| 255 | { | |
| 256 | stri ng logout = "~/Logou t.aspx"; | |
| 257 | ||
| 258 | AppS ettings se ttings = S erviceInte rfaceManag er.APPSETT INGS_GET(H ttpContext .Current.U ser.Identi ty.Name, U serSession .CurrentRe gistryId); | |
| 259 | if ( settings ! = null) | |
| 260 | { | |
| 261 | string str Tremp = Ge tValidLogo utUrl(sett ings.SSOiL ogoutUrl); | |
| 262 | if (!strin g.IsNullOr Empty(strT remp)) | |
| 263 | logout = strTrem p; | |
| 264 | } | |
| 265 | ||
| 266 | Sess ion.Clear( ); | |
| 267 | Sess ion.Abando n(); | |
| 268 | Resp onse.Redir ect(logout , false); | |
| 269 | } | |
| 270 | catch (E xception e x) | |
| 271 | { | |
| 272 | Serv iceInterfa ceManager. LogError(e x.Message, String.Fo rmat("{0}. {1}", Syst em.Reflect ion.Method Base.GetCu rrentMetho d().Declar ingType.Fu llName, Sy stem.Refle ction.Meth odBase.Get CurrentMet hod().Name ), HttpCon text.Curre nt.User.Id entity.Nam e, UserSes sion.Curre ntRegistry Id); | |
| 273 | thro w ex; | |
| 274 | } | |
| 275 | } | |
| 276 | ||
| 277 | pr ivate stri ng GetVali dLogoutUrl (string lo gout) | |
| 278 | { | |
| 279 | string s trReturn = string.Em pty; | |
| 280 | ||
| 281 | if (!str ing.IsNull OrEmpty(lo gout)) | |
| 282 | { | |
| 283 | logo ut = logou t.Replace( "&amp; ", "&").Re place("&am p;", "&"). Replace("a mp;", "&") ; | |
| 284 | string str PRD = "htt ps:// DNS . URL /centrallo gin/centra llanding.a spx?appid= VIRP&targe t=https:// vaww.virp. registries .aac.va.go v/"; | |
| 285 | string str PPD = "htt ps:// DNS . URL /centrallo gin/centra llanding.a spx?appid= VIRP&targe t=https:// DNS . URL /"; | |
| 286 | string str SQA = "htt ps:// DNS . URL /centrallo gin/centra llanding.a spx?appid= VIRP&targe t=https:// DNS . URL /"; | |
| 287 | string str DEV = "htt ps:// DNS . URL /centrallo gin/centra llanding.a spx?appid= VIRP&targe t=https:// DNS . URL /"; | |
| 288 | ||
| 289 | if ( logout.ToL ower() == strPRD.ToL ower()) | |
| 290 | strReturn = strPRD; | |
| 291 | else if (logou t.ToLower( ) == strPP D.ToLower( )) | |
| 292 | strReturn = strPPD; | |
| 293 | else if (logou t.ToLower( ) == strSQ A.ToLower( )) | |
| 294 | strReturn = strSQA; | |
| 295 | else if (logou t.ToLower( ) == strDE V.ToLower( )) | |
| 296 | strReturn = strDEV; | |
| 297 | } | |
| 298 | ||
| 299 | return s trReturn; | |
| 300 | } | |
| 301 | } | |
| 302 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.