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/XUS.m@ 952

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

initial load of FOIAVistA 6/30/08 version

File size: 5.5 KB
Line 
1XUS ;SFISC/STAFF - SIGNON ;2/13/07 14:44
2 ;;8.0;KERNEL;**16,26,49,59,149,180,265,337,419,434**;Jul 10, 1995;Build 6
3 ;Sign-on message numbers are 30810.51 to 30810.99
4 S U="^" D INTRO^XUS1A()
5 K K ^XUTL("ZISPARAM",$I)
6 S U="^",XQXFLG("GUI")="^"
7 W ! S $Y=0 D SET1(1) I POP S XUM=3 G NO ;Sets DUZ("LANG")
8 S XUSTMP(51)=$$EZBLD^DIALOG(30810.51),XUSTMP(52)=$$EZBLD^DIALOG(30810.52)
9 W !!,"Volume set: ",$P(XUENV,U,4)," UCI: ",XUCI," Device: ",$I W:$S('$D(IO("ZIO")):0,1:$I'=IO("ZIO")) " (",IO("ZIO"),")" W !
10RESTART ;
11 S XUM=$$SET2 G:XUM NO
12 I $P(XU1,U,2)]"" S XUM=$$DEVPAS() I XUM G H:XUM<0,NO
13 ;S PGM=$P(XOPT,U,8),XUA=$P(PGM,"[",1) I XUA]"" X XUEON G NEXT^XUS1
14A S (XUSER(0),XUSER(1),XQUR)=""
15 ;Check for locked IP/device.
16 I $$LKCHECK^XUSTZIP() S XUM=7,XUFAC=$P(XOPT,U,2),XUHALT=1 G NO
17 ;Auto Sign-on check
18 S X=$$AUTOXUS^XUS1B() I X>0 S DUZ=X D USER(DUZ) W !!,">> Auto Sign-on: ",$P(XUSER(0),U)," <<<",! G B
19 X XUEOFF S AV=$$ASKAV() X XUEON I AV="^;^" G H ;Get out
20 I AV["MAIL-BOX",AV[";XMR" S (XUA,PGM)="XMR",XMCHAN=$P($P(AV,";")," ",2),DUZ=.5 G XMR^XUSCLEAN
21 S XQUR=$P(AV,";",3)
22 S DUZ=$$CHECKAV(AV) K AV
23 S XUM=$$UVALID() G:XUM NO
24B K XUF,%1 S XUF=0 X XUEON
25 I DUZ D USER^XUS1 G:XUM NO
26 I DUZ D SEC^XUS3:($D(^%ZIS(1,XUDEV,"TIME"))!$D(^(95))) G:XUM NO
27 G NO:'DUZ
28 S DTIME=$P(XOPT,U,10),X=$S(DUZ("BUF"):"",1:"NO-")_"TYPE-AHEAD" X:$D(^%ZOSF(X)) ^(X)
29 D TT^XUS3:$G(XUTT)
30 D CLRFAC^XUS3($G(IO("IP")))
31PGM ;
32 S Y=+$G(^%ZIS(1,XUDEV,201)) I Y>0,$$CHK S XQY=Y G OK
33 S Y=+$G(^VA(200,DUZ,201)) I Y>0,$$CHK S XQY=Y G OK
34 I $D(DUZ("ASH")) S Y=$O(^DIC(19,"B","XU NOP MENU",0)) I Y>0 S XQY=Y G OK ;rwf 403
35 S XUM=16
36 G NO
37 ;
38OK D CHEK^XQ83
39 S (XUA,PGM)="XQ"
40 G NEXT^XUS1
41 ;
42CHK() ;Check that option exeist and LOCK
43 I $D(^DIC(19,Y,0)),$S($P(^(0),U,6)="":1,1:$D(^XUSEC($P(^(0),U,6),DUZ))) Q 1
44 Q 0
45 ;
46LC S X=$$UP(X)
47 Q
48UP(%) Q $TR(%,"abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ")
49 ;
50FAC ;Failed access
51 S:'DUZ XUF(.1)=$E(%1)
52 S:XUF=2 XUF(.2)=XUF(.2)+1,XUF(XUF(.2))=%1 S %1="" Q
53 Q
54NO ;Tell why didn't get on
55 S X=$$NO^XUS3() G RESTART:'X ;fall into exit
56H ;Exit point for all applications
57C ;CLOSE
58 G ^XUSCLEAN
59 ;
60ON X ^%ZOSF("EON") Q
61 ;
62ASKAV(PRE) ;Ask and return Access;Verify code, Turn off echo before calling
63 N X,Y S PRE=$G(PRE)
64 F W !,PRE,XUSTMP(51) S X=$$ACCEPT S:X="^" X="^;^" Q:$L(X)
65 S X=$TR(X,$C(9),";") ;Convert TAB to ; to match GUI.
66 I $P(X," ")="MAIL-BOX" S X=X_";XMR"
67 I $E(X,1,7)="~~TOK~~" Q X ;Use CCOW token
68 I '$L($P(X,";",2)) W !,PRE,XUSTMP(52) S Y=$$ACCEPT S:Y="^" X="^;" S $P(X,";",2)=Y
69 Q X
70 ;
71 ;Timeout used by XUSTZ call.
72ACCEPT(TO) ;Read A/V and echo '*' char.
73 ;Have the Read write to flush the buffer on some systems
74 N C,A,E K DUOUT S A="",TO=$G(TO,60),E=0
75 F D Q:E
76 . R "",*C:TO S:('$T) DUOUT=1 S:('$T)!(C=94) A="^"
77 . I (A="^")!(C=13)!($L(A)>60) S E=1 Q
78 . I C=127 Q:'$L(A) S A=$E(A,1,$L(A)-1) W $C(8,32,8) Q
79 . S A=A_$C(C) W *42
80 . Q
81 Q A
82 ;
83CHECKAV(X1) ;Check A/V code return DUZ or Zero. (Called from XUSRB)
84 N %,%1,X,Y,IEN,DA,DIK
85 S IEN=0
86 ;Start CCOW
87 I $E(X1,1,7)="~~TOK~~" D Q:IEN>0 IEN
88 . I $E(X1,8,9)="~1" S IEN=$$CHKASH^XUSRB4($E(X1,8,255))
89 . I $E(X1,8,9)="~2" S IEN=$$CHKCCOW^XUSRB4($E(X1,8,255))
90 . Q
91 ;End CCOW
92 S X1=$$UP(X1) S:X1[":" XUTT=1,X1=$TR(X1,":")
93 S X=$P(X1,";") Q:X="^" -1 S:XUF %1="Access: "_X
94 Q:X'?1.20ANP 0
95 S X=$$EN^XUSHSH(X) I '$D(^VA(200,"A",X)) D LBAV Q 0
96 S %1="",IEN=$O(^VA(200,"A",X,0)),XUF(.3)=IEN D USER(IEN)
97 S X=$P(X1,";",2) S:XUF %1="Verify: "_X S X=$$EN^XUSHSH(X)
98 I $P(XUSER(1),"^",2)'=X D LBAV Q 0
99 I $G(XUFAC(1)) S DIK="^XUSEC(4,",DA=XUFAC(1) D ^DIK
100 Q IEN
101LBAV ;Log Bad AV
102 D:XUF FAC
103 I IEN S X=$P($G(^VA(200,IEN,1.1)),U,2)+1,$P(^(1.1),"^",2)=X
104 Q
105 ;
106USER(IX) ;Build XUSER
107 S XUSER(0)=$G(^VA(200,+IX,0)),XUSER(1)=$G(^(.1)),XUSER(1.1)=$G(^(1.1))
108 Q
109 ;
110XUVOL ;Setup XUENV, XUCI,XQVOL,XUVOL
111 S U="^" D GETENV^%ZOSV S XUENV=Y,XUCI=$P(Y,U,1),XQVOL=$P(Y,U,2)
112 S X=$O(^XTV(8989.3,1,4,"B",XQVOL,0)),XUVOL=$S(X>0:^XTV(8989.3,1,4,X,0),1:XQVOL_"^y^1")
113 Q
114 ;
115XOPT ;Setup initial XOPT
116 S XOPT=$S($D(^XTV(8989.3,1,"XUS")):^("XUS"),1:"")
117 F I=2:1:15 I $P(XOPT,U,I)="" S $P(XOPT,U,I)=$P("^5^900^1^1^^^^1^300^^^^N^90",U,I)
118 Q
119 ;
120SET1(FLAG) ;Setup parameters (also called from XUSRB)
121 N %
122 S U="^",XUEON=^%ZOSF("EON"),XUEOFF=^("EOFF")
123 D XUVOL,XOPT S DUZ("LANG")=$P(XOPT,U,7) ;S:$P(XUVOL,U,6)="y" XRTL=XUCI_","_XQVOL
124 K ^XUTL("XQ",$J) S XUF=0,XUDEV=0,DUZ=0,DUZ(0)="@",IOS=0,ION=""
125 I FLAG S %ZIS="L",IOP="HOME" D ^%ZIS Q:POP
126 S XUDEV=IOS,XUIOP=ION
127 D GETFAC^XUS3($G(IO("IP")))
128 S %=$P(XOPT,U,14)
129 I "N"'[% D
130 . S XUF=(%["R")+1,XUF(.1)="",XUF(.2)=0,XUF(.3)=0
131 . I %["D" S:$D(^XTV(8989.3,1,4.33,"B",XUDEV))[0 XUF=0
132 S DILOCKTM=+$G(^DD("DILOCKTM"),1) ;p434 IA#4909
133 Q
134SET2() ;EF. Return error code (also called from XUSRB)
135 N %,X
136 S XUNOW=$$HTFM^XLFDT($H),DT=$P(XUNOW,".")
137 K DUZ,XUSER
138 S (DUZ,DUZ(2))=0,(DUZ(0),DUZ("AG"),XUSER(0),XUSER(1),XUTT,%UCI)=""
139 S %=$$INHIBIT^XUSRB() I %>0 Q %
140 S X=$G(^%ZIS(1,XUDEV,"XUS")),XU1=$G(^(1))
141 I $L(X) F I=1:1:15 I $L($P(X,U,I)) S $P(XOPT,U,I)=$P(X,U,I)
142 S DTIME=600
143 I '$P(XOPT,U,11),$D(^%ZIS(1,XUDEV,90)),^(90)>2800000,^(90)'>DT Q 8
144 Q 0
145 ;
146UVALID() ;EF. Is it valid for this user to sign on?
147 I DUZ'>0 Q 4
148 I $P(XUSER(1.1),U,5),$P(XUSER(1.1),U,5)>XUNOW S XUM(0)=$$FMTE^XLFDT($P(XUSER(1.1),U,5),"2PM") Q 18 ;User locked until
149 I $P(XUSER(0),U,11),$P(XUSER(0),U,11)'>DT Q 11 ;Access Terminated
150 I $D(DUZ("ASH")) Q 0 ;If auto handle, Allow to sign-on p434
151 I $P(XUSER(0),U,7) Q 5 ;Disuser flag set
152 I '$L($P(XUSER(1),U,2)) Q 21 ;p419, p434
153 Q 0
154 ;
155DEVPAS() ;EF. Ask device password
156 X XUEOFF W !,"DEVICE PASSWORD: " R X:60 X XUEON
157 S X=$E(X,1,30) S:'$T X="^" D LC Q:X["^" -1 I $P(XU1,U,2)'=X S:XUF %1="Device: "_X D:XUF FAC Q 6
158 Q 0
159 ;
Note: See TracBrowser for help on using the repository browser.