Want to get rid of Google Ads, click here.
+ Reply to Thread
Results 1 to 6 of 6

Thread: Listo of Actual user logged in java scripts.

  1. #1
    Junior Member
    Join Date
    Feb 2008
    Posts
    17

    Default Listo of Actual user logged in java scripts.

    Hello

    Do You how to get the list of actual users that are logged into HP SM in JS.
    In application I can use the status format to see this. But I need it in my JS function.
    Can anyone know how to achieve this?

    Thanks
    Darek

  2. #2
    Senior Member
    Join Date
    Jan 2002
    Location
    The Netherlands
    Posts
    930

    Default

    I'd go for: system.functions.

    Because there is no JS equivalent.

  3. #3
    Junior Member
    Join Date
    Feb 2008
    Posts
    17

    Default

    Hello

    Could You give me a expample of that function and it is possible to use this is JS. I want to copy actual logged user to database table is any other way than JS for this?

  4. #4
    Senior Member
    Join Date
    Apr 2006
    Location
    United States
    Posts
    178

    Default

    there is an example of this in the help files as shown below....

    var
    usersXML = system.users;//If you uncomment the line of code, recompile, and run the script again, you can view the suppressed output. It prints all logged on users as a large XML document.

    //print( usersXML );This part of the script loops through to process each <user> element within <users>.
    for
    ( userIndex in usersXML )

    {
    var userXML = usersXML[userIndex];//If you uncomment the line of code, recompile, and run the script again, you can view the suppressed output. It prints an individual user as an XML document.

    //print( userXML );This part of the script loops through to process each XML element node within the <user> element.
    for
    ( fldIndex in userXML )
    {

    var node = userXML[fldIndex];


    print( node.getName() +": "+node.getValue() );

    }

    }

  5. #5
    Senior Member glg's Avatar
    Join Date
    Aug 2004
    Location
    Chicago, IL, USA
    Posts
    715

    Default

    You can also do this with file manipulation, similar to the way kill.inactive does it

    var status = new SCFile("status");
    status.processes = system.functions.processes();

    Then you can read through status.processes[i].user_name to see logged in users. Look at the status dbdict to see what the processes structured array looks like.

  6. #6
    Junior Member
    Join Date
    Feb 2008
    Posts
    17

    Default

    Thanks very much it work excellent

    Here is the code to get the logged in users to windows application.

    var status = new SCFile("status");
    status.processes = system.functions.processes();
    var proc = status.processes ;
    for (var i = 0; i < proc.length(); i++)
    {
    if(status.processes[i].terminal_id.substring(0,4) == "Soap")
    {
    p("---" + status.processes[i].user_name + " ---" + status.processes[i].terminal_id);
    }
    }
    Last edited by meton00; 2009-12-17 at 10:57.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Bookmarks

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