1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12
3 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS Procedure
4 /*--------------------------------------------------------------------------
15 ------------------------------------------------------------------------*/
16 /* This .W file was created with the Progress UIB.
*/
17 /*----------------------------------------------------------------------*/
19 /* *************************** Definitions
************************** */
21 /* _UIB-CODE-BLOCK-END
*/
25 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
27 /* ******************** Preprocessor Definitions
******************** */
29 &Scoped-define PROCEDURE-TYPE Procedure
33 /* _UIB-PREPROCESSOR-BLOCK-END
*/
38 /* *********************** Procedure Settings
************************ */
40 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
41 /* Settings for
THIS-PROCEDURE
45 Add Fields to
: Neither
46 Other Settings
: CODE-ONLY
COMPILE
48 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
50 /* ************************* Create Window
************************** */
52 &ANALYZE-SUSPEND _CREATE-WINDOW
53 /* DESIGN Window definition
(used by the UIB
)
54 CREATE WINDOW Procedure
ASSIGN
57 /* END WINDOW DEFINITION
*/
64 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK Procedure
67 /* *************************** Main Block
*************************** */
69 RUN copy-user
( "Andrew", "amcmil" ).
71 /* _UIB-CODE-BLOCK-END
*/
75 /* ********************** Internal Procedures
*********************** */
77 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE copy-groups Procedure
78 PROCEDURE copy-groups
:
79 /*------------------------------------------------------------------------------
81 ------------------------------------------------------------------------------*/
82 DEF INPUT PARAMETER old-user
AS CHAR NO-UNDO.
83 DEF INPUT PARAMETER new-user
AS CHAR NO-UNDO.
85 DEF BUFFER NewUGM
FOR UsrGroupMember.
87 FOR EACH UsrGroupMember
WHERE UsrGroupMember.UserName
= old-user
88 AND UsrGroupMember.GroupName
<> "Everyone" NO-LOCK:
90 ASSIGN NewUGM.UserName
= new-user
91 newUGM.GroupName
= UsrGroupMember.GroupName .
96 /* _UIB-CODE-BLOCK-END
*/
100 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE copy-user Procedure
101 PROCEDURE copy-user
:
102 /*------------------------------------------------------------------------------
104 ------------------------------------------------------------------------------*/
105 DEF INPUT PARAMETER old-name
AS CHAR NO-UNDO.
106 DEF INPUT PARAMETER new-name
AS CHAR NO-UNDO.
108 DEF BUFFER old-u
FOR Usr.
110 FIND Usr
WHERE Usr.UserName
= new-name
NO-ERROR.
111 IF NOT AVAILABLE(Usr
) THEN DO:
112 FIND old-u
WHERE old-u.UserName
= old-name
NO-LOCK.
114 ASSIGN Usr.UserName
= new-name
115 Usr.PersonCode
= old-u.PersonCode
+ 1
116 Usr.Abbreviation
= old-u.Abbreviation
+ "X".
119 RUN copy-groups
( old-name
, new-name
).
123 /* _UIB-CODE-BLOCK-END
*/