SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 2 of 2
  1. #1
    Member
    Join Date
    Jun 2002
    Location
    SoCal
    Posts
    466
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    save single parameter into array for future use in next action section

    Got a situation I've never encountered before and my c programming skills are admittedly weak.
    Creating users in a loop
    Each loop creates a new user with ID and the application generates a temporary password for that user that I'm parsing like:
    for (loop = 1; loop <= maxtocreate;loop++)
    {
    some steps to create new user, then capture temp password below

    web_reg_save_param_regexp(
    "ParamName=cTempPW",
    "RegExp=Temporary Password Expiration.{1,}<.th>\n.+<.tr>\n.+<tr>\n.+<td>\n.+\ n.+<.td>\n.+<td>\n.+\n.+<.td>\n.+<td>\n.+\n.+<.td> \n.+<td>\n.{16}(.{6})\n.+<.td>",
    SEARCH_FILTERS,
    "Scope=All",
    LAST);
    weburl call to get temporary password.

    arrayName[Loop] = lr_eval_string("{pID}");// this is uniquely generated in unshown code
    arrayTmpPW[Loop] = lr_eval_string("{cTempPW}");
    lr_output_message("C Array Values: %s %s",arrayName[Loop],arrayTmpPW[Loop]);//this gives me correct output so seem to be saving properly into c char arrays

    }
    Next Action Section
    for (nChangePWLoop = 1; nChangePWLoop <= nCreatedCnt; nChangePWLoop++)
    {
    lr_output_message("C Array Values: %s %s",arrayName[nChangePWLoop],arrayTmpPW[nChangePWLoop]);
    lr_save_string(lr_eval_string(arrayName[nChangePWLoop]), "tmpID");
    lr_save_string(lr_eval_string(arrayTmpPW[nChangePWLoop]), "tmpPW");
    steps to login and change password
    }
    My problem is I need to save multiple values from the first action section and then perform a login in the next action section to login first time and change the password.
    The above code works within the first action section it's looping in. However when I move into the other action section and try to find the values again they come back as null.
    FYI, the reason I'm not doing it all in one action section and a single loop is the creation is done logged in as an administrator so I would have to login, create user, logout, login as created user, change password, logout and then start all over again. Additionally there are a number of other action sections that do various things before this point where I'm stuck.
    I've declared the arrays in the global.h file but like I said, my c programming skills have always been weak when dealing with char types.
    Thanks for your help in advance.
    Yes, it really IS rocket science!
    http://www.linkedin.com/in/doncobos

  2. #2
    Member
    Join Date
    Jun 2002
    Location
    SoCal
    Posts
    466
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0
    Ok, well, I figured this out. I was making it harder than it needed to be.
    By using sprintf to create the vugen param name like param_1 a populating into that the captured cTempPW and name I can then retrieve them by using lr_save_string(lr_paramarr_idx in the next action section. No need to do c manipulations once I created the vugen param groups. Hope this explanation makes sense and helps someone else if it does.
    Yes, it really IS rocket science!
    http://www.linkedin.com/in/doncobos

 

 

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.40 (Pro) - vBulletin Mods & Addons Copyright © 2018 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 13.04%
vBulletin Optimisation provided by vB Optimise v2.7.1 (Pro) - vBulletin Mods & Addons Copyright © 2018 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.3.0 (Pro) - vBulletin Mods & Addons Copyright © 2018 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2018 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2018 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2018 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 01:43 AM.

Copyright BetaSoft Inc.