I have a screen where I have a field to input a User ID,
I need to validate that the user who is entering the user profile (of some other user) is authorized to the user profile or not.
If not authorized, the process will be sent a message saying the user isn't authorized when the profile is accessed. If the message arrives, display it for the user. What exactly is the problem with that?
This would normally be a problem when the *PGM is running under adopted authority. But why adopt authority if the user already has authority? And if the user doesn't have authority, why use adopted authority if the program isn't going to proceed with the operation? And if it proceeds with the operation, then why check user authority?
A full description of the actual problem can help in determining which way the problem should be fixed. There are a number of possibilities that could be used for different reasons.
Tom
Use the CHKOBJ command and monitor for the messages;
Here is what you can monitor for:
*ESCAPE Messages
CPF9801 Object &2 in library &3 not found.
CPF9802 Not authorized to object &2 in &3.
CPF9810 Library &1 not found.
CPF9815 Member &5 file &2 in library &3 not found.
CPF9820 Not authorized to use library &1.
CPF9830 Cannot assign library &1.
CPF9899 Error occurred during processing of command.
I use QSYGETPH API to check user and password
---
DWkUser S 10A inz('FLANARY')
DWKPassword S 10A inz('HOGWASH')
DProfileHandle S 12A
DPassWordLength S 10i 0 inz(10)
DCCSID S 10i 0 inz(37)
D*
DQUSEC DS
D* Qus EC
D QUSBPRV 1 4B 0
D* Bytes Provided
D QUSBAVL 5 8B 0
D* Bytes Available
D QUSEI 9 15
D* Exception Id
D QUSERVED 16 16
D* Reserved
D ERRC0100 17 274 Varying
D*
d error S n
--------
C eval WKuser=w$user
C eval WkPassword=w$passw
*...Check user and password
C Call 'QSYGETPH'
C Parm WKUser
C Parm WKPassword
C Parm ProfileHandle
C Parm QUSEC
C Parm PasswordLength
C Parm CCSID
*...Se password errata
C If QUSBAVL > 0
C eval outmsg='Error'
C else
*...
C eval outuser =w$user
C eval outmsg ='OK'
C Endif
*...
---
depe
Oh, sorry, is not your question ... QSYGETPH api check if user and password entered in a form are correct ... for example if you have always a session opened used by different users and don't want to signoff everytime. Sorry
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!
Discuss This Question: 4  Replies