Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2012
    Posts
    5

    how can I access the value of g_HTTPAuthUsername variable from client script?

    Hello:

    I am very new to programming in TrueUpdate 3.5

    I need my client scrpt to use HTTP Authentication login before it can download the server script. During build time, I entered my user name and password.

    In the client script, before:
    if(Screen.Show("Connect to Server") == SR_SUCCESS) then
    TrueUpdate.RunScript("Server Script");
    end

    I added this code:
    "Dialog.Message("The userName is "..g_HTTPAuthUsername);"

    But, when I run the client script, I get an Error:

    "Client Script, Line 37: attempt to concatenate global g_HTTPAuthUsername (a nil value)"

    How can I make the client script tell me what the value is?

    Thank you,

    Erin

  2. #2
    Join Date
    Apr 2005
    Location
    Tabo„o da Serra
    Posts
    3,696
    Quote Originally Posted by erincof View Post
    I need my client scrpt to use HTTP Authentication login before it can download the server script. During build time, I entered my user name and password.
    I assume that you mean that you provided the username and password in the project wizard? Build time is when you compile the TrueUpdate client.

    "Client Script, Line 37: attempt to concatenate global g_HTTPAuthUsername (a nil value)"
    This means that at line 37, the contents of g_HTTPAuthUsername is still undefined. Post your project file, and we can point you your error.

    Ulrich

  3. #3
    Join Date
    Feb 2012
    Posts
    5
    Thank you Ulrich, yes, I meant to say that I provided my userName and passWord in the project wizard. I uploaded "login_with_auth.tu2" to whereever these things get uploaded

    Thank you,

    Erin

  4. #4
    Join Date
    Apr 2005
    Location
    Tabo„o da Serra
    Posts
    3,696
    Ok, here is how this works... In the wizard, you set the username and password for downloading the TrueUpdate control files. This information is saved in the Project Settings > TrueUpdate Servers dialog.

    For downloading the patch, there was an additional dialog with fields for providing a HTTP pasword, which apparently you left blank. This is the dialog:

    SNAP-2012-04-05-01.png

    Using these values as shown in the capture would create this in the Server Script:

    Code:
    -- Where do you want to download the installer/patch file from?
    g_SourceURL = "www.mydomain.com/folder/patch.exe";
    g_HTTPTimeout = 30;
    g_HTTPPort = 80;
    g_HTTPUseBasicAuth = true;
    g_HTTPAuthUsername = "myuser";
    g_HTTPAuthPassword = "mypassword";
    g_HTTPUseSSL = false;
    g_HTTPTransferType = MODE_BINARY;
    But no problem at all, you can write the username and password manually in the script afterwards - check lines 11 and 12 of the Server Script and provide the required values. You can update the TrueUpdate client from one location, and the application from another...

    Ulrich
    Last edited by Ulrich; 04-05-2012 at 05:23 PM.

  5. #5
    Join Date
    Feb 2012
    Posts
    5
    Thank you Ulrich. From running the client script, how do I access the value of the username and password that I supplied to the wizard for downloading the server script?

    I ask because my IT department wants to know the actual username and password of the end user, not the username and password that I supplied to the wizard.

    Is it possible to supply these values to the client script at run time so that it passes the values to our web server? Or, must teh client script only use the parameters that it got from the wizard?

    Thank you,

    Erin

  6. #6
    Join Date
    Apr 2005
    Location
    Tabo„o da Serra
    Posts
    3,696
    Quote Originally Posted by erincof View Post
    Thank you Ulrich. From running the client script, how do I access the value of the username and password that I supplied to the wizard for downloading the server script?
    You don't. This is info is not available in the script, but you can see the data when you inspect the TrueUpdate servers.

    I ask because my IT department wants to know the actual username and password of the end user, not the username and password that I supplied to the wizard.
    I am not sure if I am following. What "end user" are you asking about?

    Is it possible to supply these values to the client script at run time so that it passes the values to our web server? Or, must teh client script only use the parameters that it got from the wizard?
    The Client script's purpose it to update the TrueUpdate client (and the data file) itself. Most likely, if you want to log the customer who is updating the application, this should happen in the Server script instead. You can do this by submitting HTTP form data, for example, or accessing some CGI script where you pass a customer code...

    Ulrich

  7. #7
    Join Date
    Feb 2012
    Posts
    5
    Thank you Ulrich. I now understand that when the client script runs, the user cannot supply a local username and password; the client script only knows the information provided from the wizard.

    I will have the server script relay the customer's username and password to our database.

    Thank you for your help!

    Erin

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts