Viewing User Properties - (Custom)

Use the ICIClientSettings Interface Custom1, Custom2, or Custom3 property to view the custom fields of a user object.

Refer to User Account Details Properties for an illustration of how this and other Client Settings Interface Methods and Properties can be accessed in the Administrator interface.

icon_info.gif

This method is available in EFT Server 5.0 and later.

Signature:

HRESULT Custom1([in] BSTR bstrLogin);

HRESULT Custom1([in] BSTR bstrLogin);

HRESULT Custom1([in] BSTR bstrLogin);

Example

// eftTestCustomFields.js

// CREATED: 24 May 2007

// Script to confirm use of EFT5 Custom Fields properties of a CClientSettings in Javascript through COM API.

//

 

var args = WScript.Arguments;

if ( args.length < 5 )

{

 WScript.Echo("Usage: eftTestCustomFields <eft host> <eft port> <userid> <password> <user id>\n");

 WScript.Echo("Example:  cscript eftTestCustomFields.js 192.168.20.101 1100 admin admin foo\n");

 WScript.Quit(1);

}

var sHost = args(0);

var iPort = args(1);

var sUser = args(2);

var sPass = args(3);

var sAccountName = args(4);

 

var server = new ActiveXObject("SFTPCOMInterface.CIServer");

WScript.Echo("Connecting...");

server.Connect(sHost, iPort, sUser, sPass);

WScript.Echo("Connected!");

var site = server.Sites().SiteByID(1); // for simplicity, assume first site

var oSettings = site.GetUserSettings(sAccountName);

 

WScript.Echo("Obtained user settings for user account '" + oSettings.FullName + "' with home directory: " + oSettings.GetHomeDirString() );

WScript.Echo("Custom1='" + oSettings.Custom1 + "'");

WScript.Echo("Custom2='" + oSettings.Custom2 + "'");

WScript.Echo("Custom3='" + oSettings.Custom3 + "'");

 

// Now set the custom fields to new values

WScript.Echo("\nSetting new values...");

oSettings.Custom1 = "Random=" + Math.floor((65535*Math.random())) + " [" + (new Date()).toLocaleString() + "]";

oSettings.Custom2 = "Random=" + Math.floor((65535*Math.random())) + " [" + (new Date()).toLocaleString() + "]";

oSettings.Custom3 = "Random=" + Math.floor((65535*Math.random())) + " [" + (new Date()).toLocaleString() + "]";

 

server.ApplyChanges();

 

// Now REQUERY to CONFIRM the custom fields are the new values

WScript.Echo("Requerying values...");

var oSettings = site.GetUserSettings(sAccountName);

WScript.Echo("\nObtained NEW user settings for user account '" + oSettings.FullName + "' with home directory: " + oSettings.GetHomeDirString() );

WScript.Echo("Custom1='" + oSettings.Custom1 + "'");

WScript.Echo("Custom2='" + oSettings.Custom2 + "'");

WScript.Echo("Custom3='" + oSettings.Custom3 + "'");

 

server.Close();

 

WScript.Echo("\nDone");

WScript.Quit(0);