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

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

initial load of FOIAVistA 6/30/08 version

File size: 3.7 KB
Line 
1XUSKAAJ ;; kec/oak - KAAJEE Utilities ;08/24/2006
2 ;;8.0;KERNEL;**329,430**;Jul 10, 1995;Build 1
3 ;;
4 QUIT
5 ;
6 ; ------------------------------------------------------------------------
7 ; SSO/UC KAAJEE RPCs
8 ; ------------------------------------------------------------------------
9 ;
10USERINFO(RET,CLIENTIP,SERVERNM) ; called by XUS KAAJEE GET USER INFO rpc
11 ;
12 ; INPUT:
13 ; CLIENTIP is IP address of the client workstation, used for logging (signon log) and IP blocking (failed access attempts).
14 ; SERVERNM is Identifying name for the calling application or server, used for logging (signon log).
15 ; OUTPUT:
16 ; Result(0) is the users DUZ.
17 ; Result(1) is the user name from the .01 field.
18 ; Result(2) is the users full name from the name standard file.
19 ; Result(3) is the FAMILY (LAST) NAME
20 ; Result(4) is the GIVEN (FIRST) NAME
21 ; Result(5) is the MIDDLE NAME
22 ; Result(6) is the PREFIX
23 ; Result(7) is the SUFFIX
24 ; Result(8) is the DEGREE
25 ; Result(9) is station # of the division that the user is working in.
26 ; Result(10) is the station # of the parent facility for the login division
27 ; Result(11) is the station # from the KSP site parameters, the parent "computer system"
28 ; Result(12) is the signon log entry IEN
29 ; Result(13) = # of permissible divisions
30 ; Result(14-n) are the permissible divisions for user login, in the format:
31 ; IEN of file 4^Station Name^Station Number^default? (1 or 0)
32 ;
33 N XUNC,XUNC1,XUKERR,XUKRET,XUDIVS,XUKI,XULINE,XUPARENT,XUDIVLIN,XUKDEF
34 ;
35 ; initialize return array
36 S RET(0)=DUZ
37 F I=1:1:13 S RET(I)=""
38 ;
39 ; get ptr to Name Components file
40 D GETS^DIQ(200,DUZ_",","10.1","I","XUNC","XUKERR")
41 I '$D(XUKERR) D
42 .S XUNC=XUNC(200,DUZ_",",10.1,"I")
43 .; get name components
44 .D GETS^DIQ(20,XUNC_",","1:6","","XUNC1","XUKERR")
45 .I '$D(XUKERR) D
46 ..S RET(3)=XUNC1(20,XUNC_",",1) S:'$L(RET(3)) RET(3)="^"
47 ..S RET(4)=XUNC1(20,XUNC_",",2) S:'$L(RET(4)) RET(4)="^"
48 ..S RET(5)=XUNC1(20,XUNC_",",3) S:'$L(RET(5)) RET(5)="^"
49 ..S RET(6)=XUNC1(20,XUNC_",",4) S:'$L(RET(6)) RET(6)="^"
50 ..S RET(7)=XUNC1(20,XUNC_",",5) S:'$L(RET(7)) RET(7)="^"
51 ..S RET(8)=XUNC1(20,XUNC_",",6) S:'$L(RET(8)) RET(8)="^"
52 ;
53 ; get .01 New Person name, Name components name, and login division info
54 D USERINFO^XUSRB2(.XUKRET)
55 S RET(1)=XUKRET(1) S:'$L(RET(1)) RET(1)="^"
56 S RET(2)=XUKRET(2) S:'$L(RET(2)) RET(2)="^"
57 S RET(9)=$P(XUKRET(3),U,3) S:'$L(RET(9)) RET(9)="0"
58 ;
59 ; get parent facility station#
60 S XUPARENT=$$PRNT^XUAF4(RET(9))
61 S RET(10)=$S(($P(XUPARENT,U)<1):XUPARENT,1:$$STA^XUAF4($P(XUPARENT,U)))
62 S:'$L(RET(10)) RET(10)="^"
63 ;
64 ; get the computer system station#
65 S RET(11)=$$STA^XUAF4($$KSP^XUPARAM("INST"))
66 S:'$L(RET(11)) RET(11)="0"
67 ;
68 ; make signon log entry, get IEN
69 S RET(12)=$$SIGNLOG^XUSKAAJ(CLIENTIP,SERVERNM)
70 ;
71 ; get permitted divisions
72 S XUDIVLIN=13 ; return array subscript counter for division start point
73 D DIVGET^XUSRB2(.XUDIVS,DUZ)
74 I '+XUDIVS(0) S RET(XUDIVLIN)=1,RET(XUDIVLIN+1)=XUKRET(3)_"^1" ; only 1 division, so use login division.
75 I +XUDIVS(0) S RET(XUDIVLIN)=+XUDIVS(0) D
76 .S XUKDEF=$O(^VA(200,DUZ,2,"AX1",1,"")) ; default division if any. Should only be 1.
77 .S XUKI=0,XULINE=XUDIVLIN F S XUKI=$O(XUDIVS(XUKI)) Q:XUKI']"" D
78 ..S XULINE=XULINE+1,RET(XULINE)=XUDIVS(XUKI)
79 ..S $P(RET(XULINE),U,4)=$S($P(XUDIVS(XUKI),U)=XUKDEF:1,1:0)
80 ;
81 Q
82 ;
83SIGNOFF(RET,DA) ; kill entry in sign-on log. Called by XUS KAAJEE LOGOUT rpc.
84 D LOUT^XUSCLEAN(DA)
85 S RET=1 Q
86 ;
87SIGNLOG(CLIENTIP,SERVERNM) ; make a signon log entry for KAAJEE user
88 ; todo: expand size of server name field?
89 N XP1,XPIP,XPCLNM,Y
90 S:$D(IO("IP")) XPIP=IO("IP") S IO("IP")=CLIENTIP
91 S:$D(IO("CLNM")) XPCLNM=IO("CLNM") S IO("CLNM")=$E(SERVERNM,1,20)
92 ;
93 D GETENV^%ZOSV
94 S XP1=$$SLOG^XUS1($P(Y,U,2),,,$P(Y,U),$P(Y,U,3),"KAAJEE","")
95 ;
96 S:$D(XPIP) IO("IP")=XPIP
97 S:$D(XPCLNM) IO("CLNM")=XPCLNM
98 Q XP1
99 ;
Note: See TracBrowser for help on using the repository browser.