/*-------------------------------------------------------------------*/
/*                                                                   */
/*  Program . . : SEC108M                                            */
/*  Description : Work with Profile Security Attributes - Build cmd. */
/*  Author  . . : Carsten Flensburg                                  */
/*                                                                   */
/*                                                                   */
/*  Program function:  Compiles, creates and configures all the      */
/*                     Work with Profile Security Attributes         */
/*                     command objects.                              */
/*                                                                   */
/*                     This program expects a single parameter       */
/*                     specifying the library to contain the         */
/*                     command objects.                              */
/*                                                                   */
/*                     Object sources must exist in the respective   */
/*                     source type default source files in the       */
/*                     command object library.                       */
/*                                                                   */
/*                                                                   */
/*  Compile options:                                                 */
/*    CrtClPgm    Pgm( SEC108M )                                     */
/*                SrcFile( QCLSRC )                                  */
/*                SrcMbr( *PGM )                                     */
/*                                                                   */
/*-------------------------------------------------------------------*/
     Pgm    &UtlLib

     Dcl    &UtlLib         *Char     10

     MonMsg      CPF0000    *N        GoTo Error


     CrtMsgF     MsgF( &UtlLib/SEC108M )  Aut( *USE )

     AddMsgD     CBX0001                                        +
                 MsgF( &UtlLib/SEC108M )                        +
                 Msg( 'Display supplemental groups' )           +
                 SecLvl( *NONE )

     AddMsgD     CBX0002                                        +
                 MsgF( &UtlLib/SEC108M )                        +
                 Msg( 'Display special authority' )             +
                 SecLvl( *NONE )

     AddMsgD     CBX0003                                        +
                 MsgF( &UtlLib/SEC108M )                        +
                 Msg( 'Display user audit values' )             +
                 SecLvl( *NONE )

     AddMsgD     CBX0101                                        +
                 MsgF( &UtlLib/SEC108M )                        +
                 Msg( '&1 user profiles were selected.' )       +
                 SecLvl( *NONE )                                +
                 Fmt(( *BIN 4 ))

     AddMsgD     CBX1001                                        +
                 MsgF( &UtlLib/SEC108M )                        +
                 Msg( 'PWDTYP(*DFT) only allowed if default +
                       password table is updated.' )            +
                 SecLvl( '&N Cause . . . . . :   The specified +
                          password type of *DFT requires the default +
                          password table to be updated. +
                          &N Recovery  . . . :   Specify +
                          UPDDFTPWD(*YES) to allow the default +
                          password table to be updated, or change +
                          or remove the PWDTYP(*DFT) parameter.')


     CrtRpgMod   &UtlLib/SEC1081                 +
                 SrcFile( &UtlLib/QRPGLESRC )    +
                 SrcMbr( *Module )               +
                 DbgView( *LIST )

     CrtPgm      &UtlLib/SEC1081                 +
                 Module( &UtlLib/SEC1081 )       +
                 ActGrp( *NEW )

     CrtRpgMod   &UtlLib/SEC1082                 +
                 SrcFile( &UtlLib/QRPGLESRC )    +
                 SrcMbr( *Module )               +
                 DbgView( *LIST )

     CrtPgm      &UtlLib/SEC1082                 +
                 Module( &UtlLib/SEC1082 )       +
                 ActGrp( *CALLER )


     CrtRpgMod   &UtlLib/SEC108E                 +
                 SrcFile( &UtlLib/QRPGLESRC )    +
                 SrcMbr( *Module )               +
                 DbgView( *LIST )

     CrtPgm      &UtlLib/SEC108E                 +
                 Module( &UtlLib/SEC108E )       +
                 ActGrp( *CALLER )


     CrtPnlGrp   &UtlLib/SEC108H                 +
                 SrcFile( &UtlLib/QPNLSRC )      +
                 SrcMbr( *PNLGRP )

     CrtPnlGrp   &UtlLib/SEC108P                 +
                 SrcFile( &UtlLib/QPNLSRC )      +
                 SrcMbr( *PNLGRP )


     CrtCmd      Cmd( &UtlLib/WRKPRFSECA )                      +
                 Pgm( SEC1081 )                                 +
                 SrcFile( &UtlLib/QCMDSRC )                     +
                 SrcMbr( SEC108X )                              +
                 AlwLmtUsr( *NO )                               +
                 MsgF( SEC108M )                                +
                 HlpPnlGrp( SEC108H )                           +
                 HlpId( *CMD )                                  +
                 PrdLib( &UtlLib )                              +
                 Aut( *EXCLUDE )


     SndPgmMsg   Msg( 'Work with Profile Security Attributes'  *Bcat +
                      'cmd successfully created in library'    *Bcat +
                      &UtlLib                                  *Tcat +
                      '.' )                                          +
                 MsgType( *COMP )


     Call        QMHMOVPM    ( '    '                 +
                               '*COMP'                +
                               x'00000001'            +
                               '*PGMBDY'              +
                               x'00000001'            +
                               x'0000000800000000'    +
                             )

     RmvMsg      Clear( *ALL )

     Return

/*-- Error handling:  -----------------------------------------------*/
 Error:
     Call        QMHMOVPM    ( '    '                 +
                               '*DIAG'                +
                               x'00000001'            +
                               '*PGMBDY'              +
                               x'00000001'            +
                               x'0000000800000000'    +
                             )

     Call        QMHRSNEM    ( '    '                 +
                               x'0000000800000000'    +
                             )

 EndPgm:
     EndPgm
