PDA

View Full Version : How to get the ClientType of the specified cid?


SysOp
09-23-2009, 01:56 AM
In iTCL, I know that we can get the clienttype of the current connection by using [user ClientType] command. But is it possible to get the ClientType of the specified cid, OR even better, a list of ClientTypes? If it is, how?

Thanks in advance.

Yil
09-23-2009, 04:04 AM
Hmm, there is currently no way to get the client type of any connection other than your own. However, you could add a post-event to the CLNT command and stash the string and CID into an ioTCL variable (a string representation of an array is what I'd use). Don't forget a a user logoff event to clear the entry.

Yil
09-23-2009, 04:07 AM
Client types are just whatever the FTP client chooses to pass with the CLNT command. Thus there is no list of possible values and no attempt to make sense of the string by the server itself however scripts are free to do so.

SysOp
09-23-2009, 05:10 AM
I see. Thank you very much, Yil.
So, if I do not need the original IDENT variable, I can stash that CLNT string to replace it. And thus there is no need to clear it. Is it true?

Yil
09-23-2009, 11:04 AM
Hmm, you lost me there. The ident response is part of the hostmask and totally different than the optional CLNT command which simply serves as a hint to the server which FTP client the user is using in case it wishes to disable/enable certain features.

SysOp
09-23-2009, 08:50 PM
Sorry, but now I understood. Thank you for your patience.