全部博文(287)
分类: 系统运维
2010-06-05 09:01:28
I am developing a web front end using ASP on W2K. I would like the user to sign in using AS/400 UserId and PWD. Is there a way I can pass those to an API which will verify on the AS/400 and confirm if the userid and pwd is correct ?? **** copy of QUSEC error code data structure from QSYSINC/QRPGLESRC D/Copy QSYSINC/QRPGLESRC,QUSEC * C Call 'QSYGETPH' C Parm WKUser C Parm WKPassword C Parm ProfileHandle C Parm QUSEC * C If QUSBAVL > 0 C Eval Error = *ON C Endif * Call with userprofile and password. If it is valid (QUSBAVL = 0) then it returns with a 12 byte profile handle which can be used to set the server job to run as the user or just ignored. If it is invalid the QUSEC data structure will contain error information which is explained in the system API manual
The API with CLLE: V5R3:
PGM PARM(&Usr &Pwd &Error)
*/ DCL &Usr *CHAR LEN(10)
DCL &Pwd *CHAR LEN(10)
DCL &Err *CHAR LEN(1024)
DCL &PwdLen *INT Len(4) VALUE(10)
DCL &PwdCcsid *INT Len(4) VALUE(0)
/* job CCSID */
DCL VAR(&ERROR) TYPE(*CHAR) LEN(5)
DCL VAR(&PH) TYPE(*CHAR) LEN(12) CHGVAR VAR(&ERROR) VALUE(' ') */
CALL PGM(QSYGETPH) PARM(&USR &PWD &PH &ERR &PwdLen &PwdCcsid)
MONMSG MSGID(CPF22E2 CPF22E3 CPF22E4 CPF22E5 + CPF2203 CPF2204)
EXEC(DO) CHGVAR VAR(&ERROR) VALUE('Error')
ENDDO
RETURN
ENDPGM
Prior to V5R3:
DCL &PwdLen *CHAR Len(4)
DCL &PwdCcsid *CHAR Len(4) CHGVAR %BIN(&PwdLen) 10 CHGVAR %BIN(&PwdCcsid) 37
/* CCSID 37 */
Thanks to Bryan Yates, Pete Helgren and Barbara Morris