source: FOIAVistA/trunk/r/KERNEL-XU-A4A7-USC-XG-XLF-XNOA-XPD-XQ-XVIR-ZI-ZOSF-ZOSV-ZT-ZU-%Z-XIP--XQAB--XUC--XUR--ZIN--ZTED/XUS2.m@ 1659

Last change on this file since 1659 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 6.3 KB
Line 
1XUS2 ;SF/RWF - TO CHECK OR RETURN USER ATTRIBUTES ;11/29/2006
2 ;;8.0;KERNEL;**59,180,313,419,437**;Jul 10, 1995;Build 2
3 Q
4 ;
5ACCED ; ACCESS CODE EDIT from DD
6 I "Nn"[$E(X,1) S X="" Q
7 I "Yy"'[$E(X,1) K X Q
8 N DIR,DIR0,XUAUTO,XUK
9 S XUAUTO=($P($G(^XTV(8989.3,1,3)),U,1)="y"),XUH=""
10AC1 D CLR,AAUTO:XUAUTO,AASK:'XUAUTO G OUT:$D(DIRUT) D REASK G OUT:$D(DIRUT),AC1:'XUK D CLR,AST(XUH)
11 G OUT
12 ;
13AASK ;Ask for Access code
14 N X,XUU,XUEX X ^%ZOSF("EOFF")
15 S XUEX=0
16 F D AASK1 Q:XUEX!($D(DIRUT))
17 Q
18 ;
19AASK1 ;
20 W "Enter a new ACCESS CODE <Hidden>: " D GET Q:$D(DIRUT)
21 I X="@" D DEL D:Y'=1 DIRUT S XUH="",XUEX=1 Q
22 I X[$C(34)!(X[";")!(X["^")!(X[":")!(X'?.UNP)!($L(X)>20)!($L(X)<6)!(X="MAIL-BOX") D CLR W $C(7),$$AVHLPTXT(1) D AHELP Q
23 I 'XUAUTO,((X?6.20A)!(X?6.20N)) D CLR W $C(7),$$AVHLPTXT(1),! Q
24 S XUU=X,X=$$EN^XUSHSH(X),XUH=X,XMB(1)=$O(^VA(200,"A",XUH,0)) I XMB(1),XMB(1)'=DA S XMB="XUS ACCESS CODE VIOLATION",XMB(1)=$P(^VA(200,XMB(1),0),"^"),XMDUN="Security" D ^XMB
25 I $D(^VA(200,"AOLD",XUH))!$D(^VA(200,"A",XUH)) D CLR W $C(7),"This has been used previously as an ACCESS CODE.",! Q
26 S XUEX=1 ;Now we can quit
27 Q
28 ;
29REASK S XUK=1 Q:XUH="" D CLR X ^%ZOSF("EOFF")
30 F XUK=3:-1:1 W "Please re-type the new code to show that I have it right: " D GET G:$D(DIRUT) DIRUT D ^XUSHSH Q:(XUH=X) D CLR W "This doesn't match. Try again!",!,$C(7)
31 S:XUH'=X XUK=0
32 Q
33 ;
34AST(XUH) ;Change ACCESS CODE and index.
35 W "OK, Access code has been changed!"
36 N FDA,IEN,ERR
37 S IEN=DA_","
38 S FDA(200,IEN,2)=XUH D FILE^DIE("","FDA","ERR")
39 W !,"The VERIFY CODE has been deleted as a security measure.",!,"You will need to enter a new VERIFY code so the user can sign-on.",$C(7)
40 D VST("",1)
41 I $D(^XMB(3.7,DA,0))[0 S Y=DA D NEW^XM ;Make sure has a Mailbox
42 Q
43 ;
44GET ;Get the user input and convert case.
45 S X=$$ACCEPT^XUS I (X["^")!('$L(X)) D DIRUT
46 S X=$$UP^XLFSTR(X)
47 Q
48 ;
49DIRUT S DIRUT=1
50 Q
51 ;
52CLR ;New line or Clear screenman area
53 I '$D(DDS) W ! Q
54 N DX,DY
55 D CLRMSG^DDS S DX=0,DY=DDSHBX+1 X IOXY
56 Q
57 ;
58NEWCODE D REASK I XUK W !,"OK, remember this code for next time!"
59 G OUT
60 ;
61CVC ;From XUS1
62 N DA,X
63 S DA=DUZ,X="Y"
64 W !,"You must change your VERIFY CODE at this time."
65 ;Fall into next code
66VERED ; VERIFY CODE EDIT From DD
67 N DIR,DIR0,XUAUTO
68 I "Nn"[$E(X,1) S X="" Q
69 I "Yy"'[$E(X,1) K X Q
70 S XUH="",XUAUTO=($P($G(^XTV(8989.3,1,3)),U,3)="y") S:DUZ=DA XUAUTO="n" ;Auto only for admin
71VC1 D CLR,VASK:'XUAUTO,VAUTO:XUAUTO G OUT:$D(DIRUT) D REASK G OUT:$D(DIRUT),VC1:'XUK D CLR,VST(XUH,1)
72 D CALL^XUSERP(DA,2)
73 G OUT
74 ;
75VASK ;Ask for Verify Code
76 N X,XUU X ^%ZOSF("EOFF") G:'$$CHKCUR() DIRUT D CLR
77VASK1 W "Enter a new VERIFY CODE: " D GET Q:$D(DIRUT)
78 I '$D(XUNC),(X="@") D DEL G:Y'=1 DIRUT S XUH="" Q
79 D CLR S XUU=X,X=$$EN^XUSHSH(X),XUH=X,Y=$$VCHK(XUU,XUH) I +Y W $C(7),$P(Y,U,2,9),! D:+Y=1 VHELP G VASK1
80 Q
81 ;
82VCHK(S,EC) ;Call with String and Encripted versions
83 ;Updated per VHA directive 6210 Strong Passwords
84 N PUNC,NA S PUNC="~`!@#$%&*()_-+=|\{}[]'<>,.?/"
85 S NA("FILE")=200,NA("FIELD")=.01,NA("IENS")=DA_",",NA=$$HLNAME^XLFNAME(.NA)
86 I ($L(S)<8)!($L(S)>20)!(S'?.UNP)!(S[";")!(S["^")!(S[":") Q "1^"_$$AVHLPTXT
87 I (S?8.20A)!(S?8.20N)!(S?8.20P)!(S?8.20AN)!(S?8.20AP)!(S?8.20NP) Q "2^VERIFY CODE must be a mix of alpha and numerics and punctuation."
88 I $D(^VA(200,DA,.1)),EC=$P(^(.1),U,2) Q "3^This code is the same as the current one."
89 I $D(^VA(200,DA,"VOLD",EC)) Q "4^This has been used previously as the VERIFY CODE."
90 I EC=$P(^VA(200,DA,0),U,3) Q "5^VERIFY CODE must be different than the ACCESS CODE."
91 I S[$P(NA,"^")!(S[$P(NA,"^",2)) Q "6^Name cannot be part of code."
92 Q 0
93 ;
94VST(XUH,%) ;
95 W:$L(XUH)&% !,"OK, Verify code has been changed!"
96 N FDA,IEN,ERR S IEN=DA_","
97 S:XUH="" XUH="@" ;11.2 get triggerd
98 S FDA(200,IEN,11)=XUH D FILE^DIE("","FDA","ERR")
99 I $D(ERR) D ^%ZTER
100 S:DA=DUZ DUZ("NEWCODE")=XUH Q
101 ;
102DEL ;
103 X ^%ZOSF("EON") W $C(7) S DIR(0)="Y",DIR("A")="Sure you want to delete" D ^DIR I Y'=1 W:$X>55 !?9 W $C(7)," <Nothing Deleted>"
104 Q
105 ;
106AAUTO ;Auto-get Access codes
107 N XUK,Y
108 X ^%ZOSF("EON") F XUK=1:1:3 D AGEN Q:(Y=1)!($D(DIRUT))
109 Q
110 ;
111AGEN ;Generate a ACCESS code
112 S XUU=$$AC^XUS4 S (X,XUH)=$$EN^XUSHSH(XUU) I $D(^VA(200,"A",X))!$D(^VA(200,"AOLD",X)) G AGEN
113 D CLR W "The new ACCESS CODE is: ",XUU," This is ",XUK," of 3 tries."
114 D YN
115 Q
116 ;
117AHELP S XUU=$$AC^XUS4 S X=$$EN^XUSHSH(XUU) I $D(^VA(200,"A",X))!$D(^VA(200,"AOLD",X)) G AHELP
118 W !,"Here is an example of an acceptable Access Code: ",XUU,!
119 Q
120 ;
121VHELP S XUU=$$VC^XUS4 S X=$$EN^XUSHSH(XUU) I ($P($G(^VA(200,DA,0)),U,3)=X)!$D(^VA(200,DA,"VOLD",X)) G VHELP
122 W !,"Here is an example of an acceptable Verify Code: ",XUU,!
123 Q
124 ;
125VAUTO ;Auto-get Access codes
126 N XUK
127 X ^%ZOSF("EON") F XUK=1:1:3 D VGEN Q:(Y=1)!($D(DIRUT))
128 Q
129 ;
130VGEN ;Generate a VERIFY code
131 S XUU=$$VC^XUS4 S (X,XUH)=$$EN^XUSHSH(XUU) I ($P($G(^VA(200,DA,0)),U,3)=X)!$D(^VA(200,DA,"VOLD",X)) G VGEN
132 D CLR W "The new VERIFY CODE is: ",XUU," This is ",XUK," of 3 tries."
133 D YN
134 Q
135YN ;Ask if want to keep
136 N DIR
137 S Y=1,DIR(0)="YA",DIR("A")=" Do you want to keep this one? ",DIR("B")="YES",DIR("?",1)="If you don't like this code, we can auto-generate another.",DIR("?")="Remember you only get 3 tries!"
138 S:XUK=3 DIR("A")="This is your final choice. "_DIR("A")
139 D ^DIR Q:(Y=1)!$D(DIRUT) I XUK=2 W !,"O.K. You'll have to keep the next one!",! H 2
140 I (XUK=3)&(Y'=1) W !,"Lets stop and you can try later." H 3 D DIRUT
141 D CLR
142 Q
143 ;
144OUT ;
145 K DUOUT S:$D(DIRUT) DUOUT=1
146 X ^%ZOSF("EON") W !
147 K DIR,DIRUT,XUKO,XUAUTO,XUU,XUH,XUK,XUI S X=""
148 Q
149 ;
150CHKCUR() ;Check user knows current code, Return 1 if OK to continue
151 Q:DA'=DUZ 1 ;Only ask user
152 Q:$P($G(^VA(200,DA,.1)),U,2)="" 1 ;Must have an old one
153 S XUK=0 D CLR
154CHK1 W "Please enter your CURRENT verify code: " D GET Q:$D(DIRUT) 0
155 I $P(^VA(200,DA,.1),U,2)=$$EN^XUSHSH(X) Q 1
156 D CLR W "Sorry that is not correct!",!
157 S XUK=XUK+1 G:XUK<3 CHK1
158 Q 0
159 ;
160BRCVC(XV1,XV2) ;Broker change VC, return 0 if good, '1^msg' if bad.
161 N XUU,XUH
162 Q:$G(DUZ)'>0 "1^Bad DUZ" S DA=DUZ,XUH=$$EN^XUSHSH(XV2)
163 I $P($G(^VA(200,DUZ,.1)),"^",2)'=$$EN^XUSHSH(XV1) Q "1^Sorry that isn't the correct current code"
164 S Y=$$VCHK(XV2,XUH) Q:Y Y
165 D VST(XUH,0),CALL^XUSERP(DA,2)
166 Q 0
167 ;
168AVHLPTXT(%) ;
169 Q "Enter "_$S($G(%):"6-20",1:"8-20")_" characters mixed alphanumeric and punctuation (except '^', ';', ':')."
170 ;
171 ;Left over code, Don't think it is called anymore.
172 G XUS2^XUVERIFY ;All check or return user attributes moved to XUVERIFY
173USER G USER^XUVERIFY
174EDIT G EDIT^XUVERIFY
Note: See TracBrowser for help on using the repository browser.