Produced by Araxis Merge on 4/27/2018 3:29:38 PM Central 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.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | v2.0_Sprint_15_Build_5.zip\v2.0_Sprint_15_Build_5\Unredacted\ARS_Frontend\ars-app\src\app\login | login.component.ts | Tue Apr 24 14:46:10 2018 UTC |
| 2 | v2.0_Sprint_15_Build_5..zip\v2.0_Sprint_15_Build_5\Unredacted\ARS_Frontend\ars-app\src\app\login | login.component.ts | Thu Apr 26 16:48:34 2018 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 282 |
| Changed | 1 | 2 |
| 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 | import { C omponent, OnInit } f rom '@angu lar/core'; | |
| 2 | import { L ocation } from '@ang ular/commo n'; | |
| 3 | import { R outer, Act ivatedRout e } from ' @angular/r outer'; | |
| 4 | import { F ormBuilder , Validato rs, FormGr oup } from '@angular /forms'; | |
| 5 | import { A uthenticat ionService } from '. /login.ser vice'; | |
| 6 | import { D omSanitize r } from ' @angular/p latform-br owser'; | |
| 7 | import { S anitizer } from '@an gular/core /src/secur ity'; | |
| 8 | ||
| 9 | @Component ({ | |
| 10 | selector : 'app-log in', | |
| 11 | template Url: './lo gin.compon ent.html', | |
| 12 | styleUrl s: ['./log in.compone nt.scss'] | |
| 13 | }) | |
| 14 | export cla ss LoginCo mponent im plements O nInit { | |
| 15 | construc tor( | |
| 16 | privat e router: Router, | |
| 17 | privat e location : Location , | |
| 18 | privat e fb: Form Builder, | |
| 19 | privat e authenti cationServ ice: Authe nticationS ervice, | |
| 20 | privat e sanitize r: DomSani tizer, | |
| 21 | privat e activate dRoute: Ac tivatedRou te | |
| 22 | ) {} | |
| 23 | userName = ''; | |
| 24 | afterRed irectfromS so = false ; | |
| 25 | loginFor m: FormGro up; | |
| 26 | userInfo : any = {} ; | |
| 27 | errorMsg = ''; | |
| 28 | errorSta tus = fals e; | |
| 29 | safeUrl; | |
| 30 | sso; | |
| 31 | ssoUser; | |
| 32 | ngOnInit () { | |
| 33 | this.a ctivatedRo ute.params .subscribe (param => { | |
| 34 | this .ssoUser = encodeURI Component( param['use r']); | |
| 35 | //co nsole.log( 'ssoUser ' ,this.ssoU ser) | |
| 36 | if(t his.ssoUse r && this. ssoUser != = 'undefin ed'){ | |
| 37 | this .authentic ationServi ce.getUser Roles({get Ntname:thi s.ssoUser} ) | |
| 38 | .subscribe (data => { | |
| 39 | if (da ta.errorCo de) { | |
| 40 | this.e rrorMsg = data.messa ge; | |
| 41 | this.e rrorStatus = true; | |
| 42 | } | |
| 43 | this.use rInfo = da ta; | |
| 44 | this.err orMsg = '' ; | |
| 45 | this.err orStatus = false; | |
| 46 | this.red irect(); | |
| 47 | }); | |
| 48 | } | |
| 49 | }) | |
| 50 | this.authe nticationS ervice.sso ().subscri be(data => { | |
| 51 | this.sso = data; | |
| 52 | }) ; | |
| 53 | this.safeU rl = this. sanitizer. bypassSecu rityTrustU rl('https: // URL /Applicati onManager/ Authentica te/Post'); | |
| 54 | this.g etDropDown (); | |
| 55 | this.f ormInit(); | |
| 56 | } | |
| 57 | ||
| 58 | formInit () { | |
| 59 | this.l oginForm = this.fb.g roup({ | |
| 60 | user Name: [thi s.userName , Validato rs.require d] | |
| 61 | }); | |
| 62 | } | |
| 63 | ||
| 64 | getDropD own() { | |
| 65 | this.a uthenticat ionService .getDropDo wnInfo().s ubscribe(d ata => { | |
| 66 | this .userName = data; | |
| 67 | }); | |
| 68 | } | |
| 69 | ||
| 70 | accept() { | |
| 71 | const user = thi s.loginFor m.get('use rName').va lue; | |
| 72 | this.g etUsrInfo( user); | |
| 73 | } | |
| 74 | ||
| 75 | getUsrIn fo(userNam e) { | |
| 76 | this.e rrorMsg = ''; | |
| 77 | this.e rrorStatus = false; | |
| 78 | this.a uthenticat ionService | |
| 79 | .aut henticateA ndGetUserI nfo(userNa me) | |
| 80 | .sub scribe(dat a => { | |
| 81 | if (data.err orCode) { | |
| 82 | this.error Msg = data .message; | |
| 83 | this.error Status = t rue; | |
| 84 | } else { | |
| 85 | this.userI nfo = data ; | |
| 86 | this.redir ect(); | |
| 87 | } | |
| 88 | }); | |
| 89 | } | |
| 90 | ||
| 91 | redirect () { | |
| 92 | if (th is.userInf o.userRole s !== unde fined) { | |
| 93 | cons ole.log(th is.userInf o.userRole s); | |
| 94 | this .setSessio nValues(); | |
| 95 | if ( | |
| 96 | th is.userInf o.userRole s.some( | |
| 97 | data => da ta === 'AD MIN' || da ta === 'BA SE_USER' | |
| 98 | ) | |
| 99 | ) { | |
| 100 | th is.router. navigate([ 'search275 ']); | |
| 101 | } el se if (thi s.userInfo .userRoles .some(data => data = == 'EWV')) { | |
| 102 | th is.router. navigate([ 'ewvSearch ']); | |
| 103 | } el se { | |
| 104 | th is.router. navigate([ '/']); | |
| 105 | } | |
| 106 | } | |
| 107 | } | |
| 108 | ||
| 109 | setSessi onValues() { | |
| 110 | sessio nStorage.s etItem('us erInfo', J SON.string ify(this.u serInfo)); | |
| 111 | sessio nStorage.s etItem('ro le', this. userInfo.u serRoles.l ength.toSt ring()); | |
| 112 | sessio nStorage.s etItem('us erName', t his.userIn fo.userNam e); | |
| 113 | sessio nStorage.s etItem('la stLogin', this.userI nfo.lastLo gin); | |
| 114 | sessio nStorage.s etItem('us erRole', J SON.string ify(this.u serInfo.us erRoles)); | |
| 115 | ||
| 116 | sessio nStorage.s etItem( | |
| 117 | 'per missions', | |
| 118 | JSON .stringify (this.user Info.permi ssions) | |
| 119 | ); | |
| 120 | sessio nStorage.s etItem( | |
| 121 | 'add itionalInf ormationPe rmissions' , | |
| 122 | JSON .stringify (this.user Info.permi ssions.add itionalInf ormation) | |
| 123 | ); | |
| 124 | ||
| 125 | sessio nStorage.s etItem( | |
| 126 | 'loo kupPermiss ions', | |
| 127 | JSON .stringify (this.user Info.permi ssions.loo kup) | |
| 128 | ); | |
| 129 | sessio nStorage.s etItem( | |
| 130 | 'vie wSubmissio nPermissio ns', | |
| 131 | JSON .stringify (this.user Info.permi ssions.vie wSubmissio n) | |
| 132 | ); | |
| 133 | sessio nStorage.s etItem( | |
| 134 | 'adm inPermissi ons', | |
| 135 | JSON .stringify (this.user Info.permi ssions.adm in) | |
| 136 | ); | |
| 137 | sessio nStorage.s etItem( | |
| 138 | 'ewv Search', | |
| 139 | JSON .stringify (this.user Info.permi ssions.ewv Search) | |
| 140 | ); | |
| 141 | } | |
| 142 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.