Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: XUSKAAJ

XUSKAAJ.m

Go to the documentation of this file.
  1. XUSKAAJ ;;12/15/15 08:54;08/24/2006
  1. ;;8.0;KERNEL;**329,430,659**;Jul 10, 1995;Build 22
  1. ;Per VA Directive 6402, this routine should not be modified.
  1. ;;
  1. QUIT
  1. ;
  1. ; ------------------------------------------------------------------------
  1. ; SSO/UC KAAJEE RPCs
  1. ; ------------------------------------------------------------------------
  1. ;
  1. USERINFO(RET,CLIENTIP,SERVERNM) ; called by XUS KAAJEE GET USER INFO rpc
  1. ;
  1. ; INPUT:
  1. ; CLIENTIP is IP address of the client workstation, used for logging (signon log) and IP blocking (failed access attempts).
  1. ; SERVERNM is Identifying name for the calling application or server, used for logging (signon log).
  1. ; OUTPUT:
  1. ; Result(0) is the users DUZ.
  1. ; Result(1) is the user name from the .01 field.
  1. ; Result(2) is the users full name from the name standard file.
  1. ; Result(3) is the FAMILY (LAST) NAME
  1. ; Result(4) is the GIVEN (FIRST) NAME
  1. ; Result(5) is the MIDDLE NAME
  1. ; Result(6) is the PREFIX
  1. ; Result(7) is the SUFFIX
  1. ; Result(8) is the DEGREE
  1. ; Result(9) is station # of the division that the user is working in.
  1. ; Result(10) is the station # of the parent facility for the login division
  1. ; Result(11) is the station # from the KSP site parameters, the parent "computer system"
  1. ; Result(12) is the signon log entry IEN
  1. ; Result(13) = # of permissible divisions
  1. ; Result(14-n) are the permissible divisions for user login, in the format:
  1. ; IEN of file 4^Station Name^Station Number^default? (1 or 0)
  1. ;
  1. N I,XUNC,XUNC1,XUKERR,XUKRET,XUDIVS,XUKI,XULINE,XUPARENT,XUDIVLIN,XUKDEF
  1. ;
  1. ; initialize return array
  1. S RET(0)=DUZ
  1. F I=1:1:13 S RET(I)=""
  1. ;
  1. ; get ptr to Name Components file
  1. D GETS^DIQ(200,DUZ_",","10.1","I","XUNC","XUKERR")
  1. I '$D(XUKERR) D
  1. .S XUNC=XUNC(200,DUZ_",",10.1,"I")
  1. .; get name components
  1. .D GETS^DIQ(20,XUNC_",","1:6","","XUNC1","XUKERR")
  1. .I '$D(XUKERR) D
  1. ..S RET(3)=XUNC1(20,XUNC_",",1) S:'$L(RET(3)) RET(3)="^"
  1. ..S RET(4)=XUNC1(20,XUNC_",",2) S:'$L(RET(4)) RET(4)="^"
  1. ..S RET(5)=XUNC1(20,XUNC_",",3) S:'$L(RET(5)) RET(5)="^"
  1. ..S RET(6)=XUNC1(20,XUNC_",",4) S:'$L(RET(6)) RET(6)="^"
  1. ..S RET(7)=XUNC1(20,XUNC_",",5) S:'$L(RET(7)) RET(7)="^"
  1. ..S RET(8)=XUNC1(20,XUNC_",",6) S:'$L(RET(8)) RET(8)="^"
  1. ;
  1. ; get .01 New Person name, Name components name, and login division info
  1. D USERINFO^XUSRB2(.XUKRET)
  1. S RET(1)=XUKRET(1) S:'$L(RET(1)) RET(1)="^"
  1. S RET(2)=XUKRET(2) S:'$L(RET(2)) RET(2)="^"
  1. S RET(9)=$P(XUKRET(3),U,3) S:'$L(RET(9)) RET(9)="0"
  1. ;
  1. ; get parent facility station#
  1. S XUPARENT=$$PRNT^XUAF4(RET(9))
  1. S RET(10)=$S(($P(XUPARENT,U)<1):XUPARENT,1:$$STA^XUAF4($P(XUPARENT,U)))
  1. S:'$L(RET(10)) RET(10)="^"
  1. ;
  1. ; get the computer system station#
  1. S RET(11)=$$STA^XUAF4($$KSP^XUPARAM("INST"))
  1. S:'$L(RET(11)) RET(11)="0"
  1. ;
  1. ; make signon log entry, get IEN
  1. S RET(12)=$$SIGNLOG^XUSKAAJ(CLIENTIP,SERVERNM)
  1. ;
  1. ; get permitted divisions
  1. S XUDIVLIN=13 ; return array subscript counter for division start point
  1. D DIVGET^XUSRB2(.XUDIVS,DUZ)
  1. I '+XUDIVS(0) S RET(XUDIVLIN)=1,RET(XUDIVLIN+1)=XUKRET(3)_"^1" ; only 1 division, so use login division.
  1. I +XUDIVS(0) S RET(XUDIVLIN)=+XUDIVS(0) D
  1. .S XUKDEF=$O(^VA(200,DUZ,2,"AX1",1,"")) ; default division if any. Should only be 1.
  1. .S XUKI=0,XULINE=XUDIVLIN F S XUKI=$O(XUDIVS(XUKI)) Q:XUKI']"" D
  1. ..S XULINE=XULINE+1,RET(XULINE)=XUDIVS(XUKI)
  1. ..S $P(RET(XULINE),U,4)=$S($P(XUDIVS(XUKI),U)=XUKDEF:1,1:0)
  1. ;
  1. Q
  1. ;
  1. SIGNOFF(RET,DA) ; kill entry in sign-on log. Called by XUS KAAJEE LOGOUT rpc.
  1. D LOUT^XUSCLEAN(DA)
  1. S RET=1 Q
  1. ;
  1. SIGNLOG(CLIENTIP,SERVERNM) ; make a signon log entry for KAAJEE user
  1. ; todo: expand size of server name field?
  1. N XP1,XPIP,XPCLNM,Y
  1. S:$D(IO("IP")) XPIP=IO("IP") S IO("IP")=CLIENTIP
  1. S:$D(IO("CLNM")) XPCLNM=IO("CLNM") S IO("CLNM")=$E(SERVERNM,1,20)
  1. ;
  1. D GETENV^%ZOSV
  1. S XP1=$$SLOG^XUS1($P(Y,U,2),,,$P(Y,U),$P(Y,U,3),"KAAJEE","")
  1. ;
  1. S:$D(XPIP) IO("IP")=XPIP
  1. S:$D(XPCLNM) IO("CLNM")=XPCLNM
  1. Q XP1
  1. ;