/**
* Here are some examples for using IceWarp COM API with Icewarp webserver
* PHP engine
*
* for more info and object function list reffer to merak\api\classes.txt
* for the list of API variables reffer to merak\api\delphi\apiconst.pas
*
*
*
*/
echo "List all disabled accounts
";
//
// Invoke Global API COM object - "IceWarpServer.APIObject"
//
if ($com = new COM("IceWarpServer.APIObject"))
{
echo "IceWarpServer.APIObject invoked
";
}
else
{
echo "API couldn't be invoked";
return;
}
$domCount = $com->GetDomainCount();
for ($i = 0; $i < $domCount; $i++)
{
$domain = $com->OpenDomain($com->GetDomain($i));
$domName = $domain->Name;
echo "=====================
Domain: $domName
\r\n";
$accNum = $domain->GetAccountCount();
for ($j = 0; $j < $accNum; $j++)
{
$acc = $domain->OpenAccount($domain->GetAccount($j));
$accDisabled = $acc->GetProperty("U_AccountDisabled");
if ( $accDisabled > 0 )
{
$accName = $acc->GetProperty("U_Name");
$accPath = $acc->GetProperty("U_FullMailboxPath");
echo "Disabled Account: $accName@$domName - disable type: $accDisabled - mailbox path: $accPath
\r\n";
}
}
}
?>