Results 1 to 6 of 6

Thread: Sending Client variables to webserver...

  1. #1
    Join Date
    Mar 2007
    Posts
    32
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Sending Client variables to webserver...

    I would like to have the client send a variable that is only available on the client to the server for verification use. What I would need is the name that the user is logged in with on that windows machine, not the password or anything else vital.

    Ofcourse, that doesn't matter how vital it is, since it is not possible to do without using either some bug, or some object of some sorts that the user should have to verify that he allows to run on his machine.

    I am ofcourse Ok with the users validating the object, afterall it's their choice for a sollution like this, but I wonder what the best method of achieving this is?

    I heard normal things like using Java and perhaps even Flash, but I also heard that something should be possible to do using Jscript/WSH?

    Any ideas around this, and/or pointers to someone else that has done something simillar would be appreciated.

    Thanks.

    EDIT:
    Just realised that this might not be suited to be posted in the Javascript area, but I bet there will be a few Javascript lines included no matter what.
    But feel free to move this to a more appropriate area if needed.

  2. #2
    Join Date
    Mar 2007
    Posts
    32
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    No one have any suggestions on the best way of doing this? Or which ways that it is even possible to do it with?

  3. #3
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    There's no really accessible way to do this. If you did do it, it would involve either ActiveX or Java. However, Java is a plugin, making it quite inaccessible, and ActiveX is even more so, since it will only work for IE users. Java would be your best choice, but the way you accomplished it would be different for every operating system. On Windows you'd need the value of the %CURRENTUSER% environment variable, while on UNIX-based systems you'd need the output of the whoami command. There are other operating systems too, though, and it would be impossible to account for every one of them.
    In short, there's no reliable way to do it. I wouldn't bother, if I were you: there are many downsides, and it's a lot of effort, all for something that doesn't have any great use as far as I can see.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  4. #4
    Join Date
    Mar 2007
    Posts
    32
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Well, there is one thing which makes thing alot easier, and it's that I know that it is only around 10 people who will use this system and they are all using windows.

    So this should be doable, since its in a "closed" enviroment I have rather good control over. I just want to do it this way to control which user is doing things on their internal site without needing them to log in. And they having to accept a Java object once is fine with them.

  5. #5
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    In that case:
    Code:
    public class UsernameGetter extends java.swing.JApplet {
      public String getUsername() {
        return getEnv("CURRENTUSER");
      }
    }
    ... should be sufficient. Compile it, put it in a JAR, and sign the JAR with jarsigner.exe.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  6. #6
    Join Date
    Mar 2007
    Posts
    32
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Thanks, I'll try that out.

Bookmarks

Posting Permissions

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