[THIN] Re: Get client name in WI4

  • From: "Evan Mann" <emann@xxxxxxxxxxxxxxxxxxxxx>
  • To: <thin@xxxxxxxxxxxxx>
  • Date: Thu, 18 Aug 2005 12:49:53 -0400

I follow what you are doing with the String array to get only the name
and understand where to put that into the file.  What is the point of
the last 2 deviceInfo.set lines?  Is that to reset the clientName back
to the unaltered version?

 
 
 

________________________________

From: thin-bounce@xxxxxxxxxxxxx [mailto:thin-bounce@xxxxxxxxxxxxx] On
Behalf Of Ormond_Merino@xxxxxxx
Sent: Thursday, August 18, 2005 12:45 PM
To: thin@xxxxxxxxxxxxx
Subject: [THIN] Re: Get client name in WI4



You could try this...

 

   // Always determine the client name from the user's identity 

    String clientName = MPSClientNames.fromAccessToken( accessToken ); 

              String[] client = clientName.Split('-');    

                        clientName = client[1];

                        deviceState.put(COOKIE_LOGIN_CLIENT_NAME,
clientName); 

      deviceInfo.setDetectedAddress( Request.UserHostAddress );

    deviceInfo.setClientName( clientName );

 

 

Regards,

Ormond Merino

 

________________________________

From: Evan Mann [mailto:emann@xxxxxxxxxxxxxxxxxxxxx] 
Sent: Thursday, August 18, 2005 12:13 PM
To: thin@xxxxxxxxxxxxx
Subject: [THIN] Get client name in WI4

 

Just wanted to pass along that I tried this method below, which was
posted by another person (forget who, sorry!) and it works nicely thus
far.  

All the printers now show up as domain-username.  That doesn't match
exactly with what was mentioned below as the original poster said they
only see the username.  I would ideally like ONLY the username, so can
anyone tell me what I should tweak to have it show only the username?
Perhaps it's a back end setting and not something I need to change in
the code?

--------------- 
I saw that someone already responded with the published Citrix 
solution, however that method disables workspace control. 

We therefore took a different route:  We modified the Session.cs file 
and left workspace control enabled.  Now we get User Name (not 
domain-username) for the Client ID AND we have workspace control 
still. 

We are still testing this method to assure no other problems, but so 
far it looks good. 

Session.cs info: 

Here is the original Code 

Change these lines to decide how the client name is chosen: 

    // Get the client name to use (create a new one, if necessary) 
    String clientName =
(String)deviceState.get(COOKIE_LOGIN_CLIENT_NAME); 
    if (!MPSClientNames.isValidUniqueName(clientName)) { 
        if( config.getWorkspaceControlConfiguration().getEnabled() ) { 
            clientName = MPSClientNames.generateUnique(); 
            deviceState.put(COOKIE_LOGIN_CLIENT_NAME, clientName); //
Remember for future sessions 
        } else { 
            // Use the old client name format when Workspace Control is
disabled for 
            // compatibility (MPS/U and MF1.8 need the old format to do
roaming 
            // reconnection). 
            clientName = MPSClientNames.fromAccessToken( accessToken ); 
        } 
    } 

For example, replacing the lines above with this should always use the 
client name derived from the username: 

    // Always determine the client name from the user's identity 
    String clientName = MPSClientNames.fromAccessToken( accessToken ); 
------------------------ 

________________________________

This message and any attachments are intended only for the use of the
addressee and may contain information that is privileged and
confidential. If the reader of the message is not the intended recipient
or an authorized representative of the intended recipient, you are
hereby notified that any dissemination of this communication is strictly
prohibited. If you have received this communication in error, notify the
sender immediately by return email and delete the message and any
attachments from your system. 

Other related posts: