Create Temp Logins

Former Member
Former Member $organization

Folks I need some help. I need to create a bunch of temporary logins for our new season but don't have a clue as to how to do it. I read the forums and it points to the API harness but when I went there it just seemed to do load testing. Any idea how I can create a bunch of temporary logins?

 

Naomi

Parents
  • Hi Naomi, you can modify and call the following script in a loop to create temporary logins for a bunch of customers.  In the example below the script creates temporary login for customer no 549704, if it does not exist already, and with a login name equal to customer no and password equal to ‘Dance’ + any random number.  You can modify the script to suit your needs and call in a loop with the customer no(s) you want to create temporary login(s) for.  Please, try it on your test database first.

     

    DECLARE @login_no INT,

          @customer_no INT,

          @login VARCHAR(80),

          @password VARCHAR(32)

     

    --Assumption:

    --n1n2_ind: Both (3)

    --login_type: Web (1)

    --login: same as customer_no

    --Password: 'Dance'+ a randomly generated number

    --Associated email address: none (0)

     

    --Call the following in a loop

    SET @customer_no=549704

    SET @login=CONVERT(VARCHAR,@customer_no)

    SET @password='Dance'+CONVERT(VARCHAR,ROUND(RAND()*1000,0))

     

    --SELECT @login_no

    IF NOT EXISTS (SELECT login_no FROM t_cust_login WHERE customer_no=@customer_no AND login=@login)

          BEGIN

                EXEC @login_no=AP_GET_NEXTID_FUNCTION @type = 'LO'

                INSERT INTO t_cust_login ( login_no, customer_no, n1n2_ind, login_type, login, password, eaddress_no, inactive, primary_ind, temporary_ind )

                      VALUES ( @login_no, @customer_no, 3, 1, @login, @password, 0, 'N', 'N', 'Y' )

          END

     

     

    Hope this helps,

     

    Mo

Reply
  • Hi Naomi, you can modify and call the following script in a loop to create temporary logins for a bunch of customers.  In the example below the script creates temporary login for customer no 549704, if it does not exist already, and with a login name equal to customer no and password equal to ‘Dance’ + any random number.  You can modify the script to suit your needs and call in a loop with the customer no(s) you want to create temporary login(s) for.  Please, try it on your test database first.

     

    DECLARE @login_no INT,

          @customer_no INT,

          @login VARCHAR(80),

          @password VARCHAR(32)

     

    --Assumption:

    --n1n2_ind: Both (3)

    --login_type: Web (1)

    --login: same as customer_no

    --Password: 'Dance'+ a randomly generated number

    --Associated email address: none (0)

     

    --Call the following in a loop

    SET @customer_no=549704

    SET @login=CONVERT(VARCHAR,@customer_no)

    SET @password='Dance'+CONVERT(VARCHAR,ROUND(RAND()*1000,0))

     

    --SELECT @login_no

    IF NOT EXISTS (SELECT login_no FROM t_cust_login WHERE customer_no=@customer_no AND login=@login)

          BEGIN

                EXEC @login_no=AP_GET_NEXTID_FUNCTION @type = 'LO'

                INSERT INTO t_cust_login ( login_no, customer_no, n1n2_ind, login_type, login, password, eaddress_no, inactive, primary_ind, temporary_ind )

                      VALUES ( @login_no, @customer_no, 3, 1, @login, @password, 0, 'N', 'N', 'Y' )

          END

     

     

    Hope this helps,

     

    Mo

Children
No Data