6 Replies Latest reply on Mar 24, 2014 4:19 PM by philmodjunk

    Creating account in a multifile inviroment

    KimFritzbøger

      Title

      Creating account in a multifile inviroment

      Post

           Is it possible to "copy" an account from a file to another file fx in a script

           Matcing privelige sets in all files but if the administrator wants to create a new account it is only in the main file - how to in a script copy this account to the other files in the solution

            

           Kim

        • 1. Re: Creating account in a multifile inviroment
          philmodjunk

               There are script steps you can use to create a new account. They are listed under Accounts in the script editor. Such a script can be set to "run with full access permissions" You can set up a pair of global fields in one file where the user can enter the account name and password they want unless you set up the script to generate those values for them. In this file, those script steps can be used to add a new account to that file. Then a series of Perform Script steps that pass the account name and password as script parameters can perform similar scripts for creating a new account in each of the other files.

          • 2. Re: Creating account in a multifile inviroment
            KimFritzbøger

                 Okay - I've tried to create 2 global variables one for username and one for name of privileges set.

                 Privileges sets are named similar in all files.

                 perform script in other file (the script use the 2 global variables from the first file) - this dosn't Work.

                 what am I doing wrong?

            • 3. Re: Creating account in a multifile inviroment
              philmodjunk

                   First, I recommended global fields, not variables Variables and fields are not the same thing.

                   Second, I recommended using script parameters to pass the account name and password from the main file to scripts in secondary files in order for scripts in the secondary files to create a new account with the same name and password.

              • 4. Re: Creating account in a multifile inviroment
                MarcMcCall

                     I kind of like this approach this free resource takes for keeping up with accounts that span multiple files. It makes it very easy to add and modify accounts across multiple files.

                SUI User Manager

                     I've used this approach for several projects.

                • 5. Re: Creating account in a multifile inviroment
                  KimFritzbøger

                       I've tried passing name and password to scripts in secondary files.

                       I declared global variables in the primary file and used them in the secondary files - is this the reason that it dosn't Work

                       I thought that global variables spand all files

                       Do I have to put the name and password into fields in the secondary file in order to make it work?

                  • 6. Re: Creating account in a multifile inviroment
                    philmodjunk
                         

                              I declared global variables in the primary file and used them in the secondary files - is this the reason that it dosn't Work

                         This is not what I am recommending that you do. You would pass that data as script parameters from File 1 to a script in File 2.

                         In File 1, define 3 or 4 fields--we'd usually use a global fields as we often do not want to retain account info after the file is closed as a security measure, but you can use a non-global field if you want. Set these fields up on a layout where the user can enter an account name, and a password. You may want to have them enter the password twice and use the Exact function to make sure that the text entered in each is identical. You may need another field with a value list for selecting the privilege set to assign.

                         Then your script uses that data to to create the new account in File 1. To then create an identical account in File 2, a script would use the Perform Script step to perform a script in File 2. The perform script step includes an optional Script parameter box where you can put the account name, password and possibly the privilege set name as a parameter that you pass to the file.

                         Here's an expression you can put in the script parameter box that passes all three values as a single parameter:

                         List ( Globals::gAccountName ; Globals::gPassword ; Globals::gPrivilegeSetName )

                         Then, the script in File 2 would use:

                         GetValue ( Get ( ScriptParameter ) ; 1 ) to extract the account name to use in creating anew account. GetValue ( Get ( ScriptParameter ) ; 2 ) returns the password and GetValue ( Get ( ScriptParameter ) ; 3 ) returns the name of the privilegeset to use.