source: EWD/r/KBANDemo.m@ 1226

Last change on this file since 1226 was 1212, checked in by Sam Habiel, 13 years ago

Added some of the lost functionality

File size: 2.7 KB
RevLine 
[1212]1KBANDemo ; Test to demo EWD ; 8/2/11 1:53pm
[1202]2 ;;
3login(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))
[1208]14 i DUZ'>0 s error="Not a valid login"
[1202]15 i error="" d ; everything is okay; save symtab crap
16 . d mergeArrayToSession^%zewdAPI(.DUZ,"DUZ",sessid)
17 . d mergeArrayToSession^%zewdAPI(.IO,"IO",sessid)
18 . d setSessionValue^%zewdAPI("U","^",sessid)
19 q error
20EXIT D:$G(DUZ) LOGOUT^XUSRB
21 Q error
[1212]22DisplayUserCharacteristics(sessid)
23 D FillSymTab(sessid)
24 d clearTextArea^%zewdAPI("display",sessid)
25 ; d appendToTextArea^%zewdAPI("display","blha blha",sessid)
26 N ZTQUEUED,ORHFS,ORSUB,ROOT,ORIO,ORHANDLE,ORWINDEV
27 N IOM,IOSL,IOST,IOF,IOT,IOS,POP
28 S (ORSUB,ROOT)="ORDATA",ORIO="OR WINDOWS HFS",ORTEXT=$NA(^TMP(ORSUB,$J,1)),ORHANDLE="ORWRP"
29 S ORHFS=$$HFS^ORWRP(),ORWINDEV=1 ;Flag for printing to windows device
30 D HFSOPEN^ORWRP(ORHANDLE,ORHFS,"W")
31 I POP D Q
32 . I $D(ROOT) D SETITEM^ORWRP(.ROOT,"ERROR: Unable to open HFS file")
33 D IOVAR^ORWRP(.ORIO,,,"P-WINHFS80")
34 N $ETRAP,$ESTACK
35 S $ETRAP="D ERR^ORWRP Q"
36 U IO
37 D ^XQUSR
38 D HFSCLOSE^ORWRP(ORHANDLE,ORHFS)
39 N txt M txt=@ORTEXT
40 D mergeToTextArea^%zewdAPI("display",.txt,sessid)
41 Q ""
[1208]42SignonTxt(sessid) ;
43 S U="^"
44 D setSessionValue^%zewdAPI("signontxt","Welcome to Wonderful Veldt of EWD")
45 Q ""
[1202]46getUsernames(sessid)
47 d clearList^%zewdAPI("user",sessid)
48 n sam
49 d LIST^DIC(200,"","@;.01","PKU","*","","","","","","sam")
50 n i s i=0
51 f s i=$o(sam("DILIST",i)) q:i="" d
52 . n entry s entry=sam("DILIST",i,0)
53 . d appendToList^%zewdAPI("user",$p(entry,U,2),$p(entry,U),sessid)
54 quit ""
55getInfo(sessid)
[1208]56 S ^KBANSAM=1
[1202]57 n DUZ s DUZ=$$getSessionValue^%zewdAPI("user",sessid)
[1208]58 n Name s Name=$$GET1^DIQ(200,DUZ_",",.01)
[1202]59 n officePhone s officePhone=$$GET1^DIQ(200,DUZ,"OFFICE PHONE")
60 d setSessionValue^%zewdAPI("Name",Name,sessid)
61 d setSessionValue^%zewdAPI("officePhone",officePhone,sessid)
62 quit ""
63savePhones(sessid)
64 quit ""
65CVC(sessid) ; Change verify code
66 ; get stored session values for DUZ, IO, and U
67 d FillSymTab(sessid)
68 n VC1,VC2,VC3
69 s VC1=$$getPasswordValue^%zewdAPI("vc1",sessid)
70 s VC2=$$getPasswordValue^%zewdAPI("vc2",sessid)
71 s VC3=$$getPasswordValue^%zewdAPI("vc3",sessid)
72 n eVC1,eVC2,eVC3
73 s eVC1=$$ENCRYP^XUSRB1(VC1)
74 s eVC2=$$ENCRYP^XUSRB1(VC2)
75 s eVC3=$$ENCRYP^XUSRB1(VC3)
76 n vcString s vcString=eVC1_U_eVC2_U_eVC3
77 n ret
78 d CVC^XUSRB(.ret,vcString)
79 i ret(0)=0 q ""
80 i ret(0)>0 q ret(1)
81FillSymTab(id) ; Fill symbol table
82 d mergeArrayFromSession^%zewdAPI(.DUZ,"DUZ",id)
83 d mergeArrayFromSession^%zewdAPI(.IO,"IO",id)
84 s U=$$getSessionValue^%zewdAPI("U",id)
85 quit
Note: See TracBrowser for help on using the repository browser.