[1284] | 1 | KBANDemo ; Test to demo EWD
|
---|
| 2 | ;;
|
---|
| 3 | login(sessid)
|
---|
| 4 | n error s error=""
|
---|
| 5 | n un,pw
|
---|
| 6 | s un=$$getTextValue^%zewdAPI("username",sessid)
|
---|
| 7 | s pw=$$getPasswordValue^%zewdAPI("password",sessid)
|
---|
| 8 | s %ZIS="0H",IOP="NULL"
|
---|
| 9 | d ^%ZIS
|
---|
| 10 | i POP s error="Programming error" d ^%ZTER g EXIT
|
---|
| 11 | d SETUP^XUSRB() ; Set-up for GUI signon
|
---|
| 12 | n RETURN
|
---|
| 13 | D VALIDAV^XUSRB(.RETURN,$$ENCRYP^XUSRB1(un_";"_pw))
|
---|
| 14 | n DUZ s DUZ=RETURN(0)
|
---|
| 15 | i DUZ'>0 s error="No a valid login"
|
---|
| 16 | i error="" d ; everything is okay; save symtab crap
|
---|
| 17 | . d mergeArrayToSession^%zewdAPI(.DUZ,"DUZ",sessid)
|
---|
| 18 | . d mergeArrayToSession^%zewdAPI(.IO,"IO",sessid)
|
---|
| 19 | . d setSessionValue^%zewdAPI("U","^",sessid)
|
---|
| 20 | q error
|
---|
| 21 | EXIT D:$G(DUZ) LOGOUT^XUSRB
|
---|
| 22 | Q error
|
---|
| 23 | getUsernames(sessid)
|
---|
| 24 | d clearList^%zewdAPI("user",sessid)
|
---|
| 25 | n sam
|
---|
| 26 | d LIST^DIC(200,"","@;.01","PKU","*","","","","","","sam")
|
---|
| 27 | n i s i=0
|
---|
| 28 | f s i=$o(sam("DILIST",i)) q:i="" d
|
---|
| 29 | . n entry s entry=sam("DILIST",i,0)
|
---|
| 30 | . d appendToList^%zewdAPI("user",$p(entry,U,2),$p(entry,U),sessid)
|
---|
| 31 | quit ""
|
---|
| 32 | getInfo(sessid)
|
---|
| 33 | n DUZ s DUZ=$$getSessionValue^%zewdAPI("user",sessid)
|
---|
| 34 | n Name s Name=$$GET1^DIQ(200,DUZ,.01)
|
---|
| 35 | n officePhone s officePhone=$$GET1^DIQ(200,DUZ,"OFFICE PHONE")
|
---|
| 36 | d setSessionValue^%zewdAPI("Name",Name,sessid)
|
---|
| 37 | d setSessionValue^%zewdAPI("officePhone",officePhone,sessid)
|
---|
| 38 | quit ""
|
---|
| 39 | savePhones(sessid)
|
---|
| 40 | quit ""
|
---|
| 41 | CVC(sessid)
|
---|
| 42 | ; get stored session values for DUZ, IO, and U
|
---|
| 43 | d FillSymTab(sessid)
|
---|
| 44 | n VC1,VC2,VC3
|
---|
| 45 | s VC1=$$getPasswordValue^%zewdAPI("vc1",sessid)
|
---|
| 46 | s VC2=$$getPasswordValue^%zewdAPI("vc2",sessid)
|
---|
| 47 | s VC3=$$getPasswordValue^%zewdAPI("vc3",sessid)
|
---|
| 48 | n eVC1,eVC2,eVC3
|
---|
| 49 | s eVC1=$$ENCRYP^XUSRB1(VC1)
|
---|
| 50 | s eVC2=$$ENCRYP^XUSRB1(VC2)
|
---|
| 51 | s eVC3=$$ENCRYP^XUSRB1(VC3)
|
---|
| 52 | n vcString s vcString=eVC1_U_eVC2_U_eVC3
|
---|
| 53 | n ret
|
---|
| 54 | d CVC^XUSRB(.ret,vcString)
|
---|
| 55 | i ret(0)=0 q ""
|
---|
| 56 | i ret(0)>0 q ret(1)
|
---|
| 57 | FillSymTab(id) ; Fill symbol table
|
---|
| 58 | d mergeArrayFromSession^%zewdAPI(.DUZ,"DUZ",id)
|
---|
| 59 | d mergeArrayFromSession^%zewdAPI(.IO,"IO",id)
|
---|
| 60 | s U=$$getSessionValue^%zewdAPI("U",id)
|
---|
| 61 | quit
|
---|