Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1272699
  • 博文数量: 287
  • 博客积分: 11000
  • 博客等级: 上将
  • 技术积分: 3833
  • 用 户 组: 普通用户
  • 注册时间: 2007-08-16 08:43
文章分类
文章存档

2013年(15)

2012年(17)

2011年(17)

2010年(135)

2009年(85)

2008年(18)

分类: 系统运维

2010-06-05 09:01:28

Get Profile Handle
I am developing

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

阅读(797) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~