Search

GlobalSCAPE Knowledge Base

Calling methods in ICIClientSettings (COM)

Karla Marsh
EFT Express (SMB) & Enterprise

THE INFORMATION IN THIS ARTICLE APPLIES TO:

  • EFT Server (All Versions)

QUESTION

How do I call methods in ICIClientSettings (COM)?

ANSWER

Suppose you are trying to use the SetEnableAccount or similar methods in the ICIClientSettings interface. How do you obtain the user or settings level so that the various methods under ICIClientSettings interface can be applied?

You need to obtain a handle to the specific user or Settings Template from ICISite's GetUserSettings method or ICISite's GetSettingsLevelSettings method before you can perform an action upon that user or Settings Template.

Here is a sample code snippet using PHP that demonstrates this technique:

<?php

// first create server object

$Server = new COM("SFTPCOMInterface.CIServer") or die("Unable to

instantiate Server");

// connect to server

$Server->Connect("localhost",1000,"admin","admin");

// get handle to list of sites

$Sites = $Server->Sites();

// chose your site. On most one-site systems this will be "0"

$MySite = $Sites->Item(0);

// Pull the settings for the user that you want.

$Settings = $MySite->GetUserSettings("juser");

// enable or disable or inherit.

// Enable is 1. Disable is 0. Inherit is -2

// Notice that you apply this to the settings for the user that you just pulled

$Settings->SetEnableAccount(1);

// Be sure to apply the settings or else nothing will really change

$Server->ApplyChanges();

// close the connection.

$Server->Close();

?>

Details
Last Modified: 9 Years Ago
Last Modified By: GlobalSCAPE 5
Type: HOWTO
Article not rated yet.
Article has been viewed 12K times.
Options
Also In This Category
Tags