認証および許可イベント処理の無効化

以下のスクリプトは、ポリシー ストアの各レルムのルールをすべて確認します。レルムのルールが認証イベントによってトリガされない場合、スクリプトは認証イベント処理がレルムで有効かどうかを確認します。その場合、スクリプトはレルム用の認証イベント処理を無効にします。スクリプトは、許可イベントに対しても同じ確認を実行します。
casso1283
以下のスクリプトは、ポリシー ストアの各レルムのルールをすべて確認します。レルムのルールが認証イベントによってトリガされない場合、スクリプトは認証イベント処理がレルムで有効かどうかを確認します。その場合、スクリプトはレルム用の認証イベント処理を無効にします。スクリプトは、許可イベントに対しても同じ確認を実行します。
例を簡略化するために、ドメイン内のレルムには子レルムがないものとします。
use Netegrity::PolicyMgtAPI;
$policyapi = Netegrity::PolicyMgtAPI->New();
$session = $policyapi->CreateSession("adminid", "adminpwd");
$auAction=0; # Initialize flag for authentication actions
$azAction=0; # Initialize flag for authorization actions
$auChange="";# Realms with a changed auth event processing property
$azChange="";# Realms with a changed az event processing property
@domains=$session->GetAllDomains();
foreach $domain(@domains) {
   @realms=$domain->GetAllRealms();
   foreach $realm(@realms) {
      @rules=$realm->GetAllRules();
      foreach $rule(@rules) {
         if ($rule->Action()=~/OnAuth./ ) {
            $auAction=1;
         }
         if ($rule->Action()=~/OnAccess./ ) {
            $azAction=1;
         }
      }
      if($auAction==0) {
         if($realm->ProcessAuEvents()==1) {
            $realm->ProcessAuEvents(0);
            $auChange=$auChange.$domain->Name().": ";
            $auChange=$auChange.$realm->Name()."\n";
         }
      }
      else { $auAction=0; }
      if($azAction==0) {
         if($realm->ProcessAzEvents()==1) {
            $realm->ProcessAzEvents(0);
            $azChange=$azChange.$domain->Name().": ";
            $azChange=$azChange.$realm->Name()."\n";
         }
      }
      else { $azAction=0; }
   }
}
if ($auChange ne "") {
   print "Stopped auth event processing for these realms:\n";
   print $auChange . "\n\n";
}
if ($auChange ne "") {
   print "Stopped az event processing for these realms:\n";
   print $azChange . "\n";
}